forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pragma for sfCallsite instead of name check + better semantics, test (n…
…im-lang#20464) * pragma for sfCallsite instead of name check at every template definition Not documented because it seems to be for internal use? Should also make it possible to make comparisons and setops imports, but this doesn't have to be done. I can reuse a name like `cursor` for the pragma as well, added a new name just to be safe. * make sfCallsite recursive, add tests
- Loading branch information
Showing
13 changed files
with
73 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
discard """ | ||
nimout: ''' | ||
tcallsitelineinfo.nim(17, 4) Warning: abc [User] | ||
''' | ||
exitcode: 1 | ||
outputsub: ''' | ||
tcallsitelineinfo.nim(17) tcallsitelineinfo | ||
Error: unhandled exception: def [ValueError] | ||
''' | ||
""" | ||
|
||
template foo(): untyped {.callsite.} = | ||
{.warning: "abc".} | ||
raise newException(ValueError, "def") | ||
echo "hello" | ||
|
||
foo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
discard """ | ||
nimout: ''' | ||
tcallsitelineinfo2.nim(18, 1) Warning: abc [User] | ||
tcallsitelineinfo2.nim(19, 12) Warning: def [User] | ||
''' | ||
exitcode: 1 | ||
outputsub: ''' | ||
tcallsitelineinfo2.nim(20) tcallsitelineinfo2 | ||
Error: unhandled exception: ghi [ValueError] | ||
''' | ||
""" | ||
|
||
template foo(a: untyped): untyped {.callsite.} = | ||
{.warning: "abc".} | ||
a | ||
echo "hello" | ||
|
||
foo: # with `{.line.}:`, the following do not keep their line information: | ||
{.warning: "def".} | ||
raise newException(ValueError, "ghi") |