Created
January 4, 2021 22:08
-
-
Save bqqbarbhg/bc4e10d491a6e4e75de8d5aa8d68077a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| struct Vec2 { | |
| a: Int | |
| b: Int | |
| } | |
| def dot(a: Vec2, b: Vec2): Int { | |
| return a.x*b.x + a.y*b.y | |
| } |
This file contains hidden or 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
| (block end-of-line | |
| (struct keyword 'struct' | |
| (name identifier 'Vec2') | |
| (null null) | |
| (list '{' | |
| (param identifier 'a' | |
| (name identifier 'a') | |
| (name identifier 'Int') | |
| ) | |
| (param identifier 'a' | |
| (name identifier 'a') | |
| (name identifier 'Int') | |
| ) | |
| (param identifier 'b' | |
| (name identifier 'b') | |
| (name identifier 'Int') | |
| ) | |
| (param identifier 'b' | |
| (name identifier 'b') | |
| (name identifier 'Int') | |
| ) | |
| ) | |
| ) | |
| (def keyword 'def' | |
| (name identifier 'dot') | |
| (null null) | |
| (block '(' | |
| (param identifier 'a' | |
| (name identifier 'a') | |
| (name identifier 'Vec2') | |
| ) | |
| (param identifier 'a' | |
| (name identifier 'a') | |
| (name identifier 'Vec2') | |
| ) | |
| (param identifier 'b' | |
| (name identifier 'b') | |
| (name identifier 'Vec2') | |
| ) | |
| (param identifier 'b' | |
| (name identifier 'b') | |
| (name identifier 'Vec2') | |
| ) | |
| ) | |
| (name identifier 'Int') | |
| (block '{' | |
| (return keyword 'return' | |
| (binop '+' | |
| (binop '*' | |
| (field '.' | |
| (name identifier 'a') | |
| (name identifier 'x') | |
| ) | |
| (field '.' | |
| (name identifier 'b') | |
| (name identifier 'x') | |
| ) | |
| ) | |
| (binop '*' | |
| (field '.' | |
| (name identifier 'a') | |
| (name identifier 'y') | |
| ) | |
| (field '.' | |
| (name identifier 'b') | |
| (name identifier 'y') | |
| ) | |
| ) | |
| ) | |
| ) | |
| ) | |
| ) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment