lang/interpret_test/TestAstFunc2/lexer-parser0.txtar
raw| 1 | -- main.mcl -- |
| 2 | import "fmt" |
| 3 | # unfortunately, for now `in` is a reserved keyword, see: |
| 4 | # https://github.com/purpleidea/mgmt/issues/728 |
| 5 | $map = 55 |
| 6 | $fn = func($in) { # in is a special keyword |
| 7 | 13 |
| 8 | } |
| 9 | test fmt.printf("%d", $fn(0)) {} |
| 10 | func fn($in) { # in is a special keyword |
| 11 | 42 + $map |
| 12 | } |
| 13 | test fmt.printf("%d", $fn(0)) {} |
| 14 | test fmt.printf("%d", fn(0)) {} |
| 15 | -- OUTPUT -- |
| 16 | # err: errLexParse: parser: `syntax error: unexpected IN, expecting MAP_IDENTIFIER or IDENTIFIER` @5:2 |