-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try doing this: $ bin/007 --backend=i13n examples/name.007 Should get this output: # static frame #1 # call A from line zero: frame 2 # static frame #3 # call B from line zero: frame 4 1. macro name(expr) { # static frame #5 # call C from line zero: frame 6 2. if expr ~~ Q::Postfix::Property { 3. expr = expr.property; 4. } # static frame #7 # call D from line zero: frame 8 5. if expr !~~ Q::Identifier { 6. throw new Exception { 7. message: "Cannot turn a " ~ type(expr) ~ " into a name" 8. }; 9. } # static frame #9 # call E from line zero: frame 10 # call F from line zero: frame 11 10. return quasi { expr.name }; 11. } 12. 13. my info = { 14. foo: "Bond", 15. bar: { 16. baz: "James Bond" 17. }, 18. }; 19. 20. say(name(info)); # info 21. say(name(info.foo)); # foo 22. say(name(info.bar.baz)); # baz
- Loading branch information
Carl Masak
committed
Mar 4, 2017
1 parent
244f5da
commit 37f778c
Showing
3 changed files
with
28 additions
and
5 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