-
Notifications
You must be signed in to change notification settings - Fork 918
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FunC] Reserve '!' for the future, identifiers can't start with it
- Loading branch information
1 parent
79721d2
commit e2467b8
Showing
6 changed files
with
48 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
;; this is allowed, lexer doesn't stop on it | ||
int get_false!() { return false; } | ||
|
||
_ main() { | ||
var x = false; | ||
if (!x) { | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
|
||
{- | ||
@compilation_should_fail | ||
@stderr '!' is reserved for the future | ||
-} |
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,11 @@ | ||
_ main() { | ||
var x = false; | ||
var b = ! x; | ||
return b; | ||
} | ||
|
||
{- | ||
@compilation_should_fail | ||
@stderr var b = ! x; | ||
@stderr '!' is reserved for the future | ||
-} |
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
get slice ascii_slice() { | ||
if (false) { | ||
return "!string!"; // !string! | ||
} | ||
return "string"; | ||
} | ||
|
||
|
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