Last active
January 5, 2019 03:37
-
-
Save sejr/315ad3d7edb9be9d19e2fcdccb43c1ba to your computer and use it in GitHub Desktop.
This is a human-readable representation of an AST, or abstract syntax tree, for an Iron module that has been parsed by Forge.
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
```iron | |
function main { | |
let greeting: String = "Hello" | |
let target: String = " world!" | |
assert((greeting + target) == "Hello world!") | |
} | |
``` | |
Module { | |
name: "hello", | |
environment: { | |
"main": Function { | |
public: false, | |
name: "main", | |
parameters: None, | |
returns: None, | |
body: [ | |
Assignment { | |
identifier: "greeting", | |
kind: Some("String"), | |
value: Stack { | |
root: [ | |
Singleton { | |
item: StringValue { | |
value: "\"Hello\"" | |
} | |
} | |
] | |
} | |
}, | |
Assignment { | |
identifier: "target", | |
kind: Some("String"), | |
value: Stack { | |
root: [ | |
Singleton { | |
item: StringValue { | |
value: "\" world!\"" | |
} | |
} | |
] | |
} | |
}, | |
Stack { | |
root: [ | |
Singleton { | |
item: FunctionCall { | |
identifier: "assert", | |
arguments: [ | |
FunctionArgument { | |
label: None, | |
value: [ | |
NestedStack { | |
root: [ | |
Singleton { | |
item: Identifier { | |
name: "greeting" | |
} | |
}, | |
Singleton { | |
item: Operator { | |
name: Add | |
} | |
}, | |
Singleton { | |
item: Identifier { | |
name: "target" | |
} | |
} | |
] | |
}, | |
Singleton { | |
item: Operator { | |
name: EqualTo | |
} | |
}, | |
Singleton { | |
item: FunctionCall { | |
identifier: "hello", | |
arguments: [ | |
FunctionArgument { | |
label: Some("to"), | |
value: [ | |
Singleton { | |
item: StringValue { | |
value: "\"world\"" | |
} | |
} | |
] | |
} | |
] | |
} | |
} | |
] | |
} | |
] | |
} | |
} | |
] | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment