diff options
| author | Mustafa Quraish <[email protected]> | 2022-01-29 12:30:40 -0500 |
|---|---|---|
| committer | Mustafa Quraish <[email protected]> | 2022-01-29 12:30:40 -0500 |
| commit | 9bf1055b110c838846898652b1a0cbb667ec1db6 (patch) | |
| tree | 9230588b34c9ac20f2e3216b1e68de7b9e0d1239 /examples/variables.cup | |
| parent | Restore line/col count in Lexer_peek to get correct locations (diff) | |
| download | cup-9bf1055b110c838846898652b1a0cbb667ec1db6.tar.xz cup-9bf1055b110c838846898652b1a0cbb667ec1db6.zip | |
Now supporting local variables! :^)
Diffstat (limited to 'examples/variables.cup')
| -rw-r--r-- | examples/variables.cup | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/variables.cup b/examples/variables.cup new file mode 100644 index 0000000..3ee8ed2 --- /dev/null +++ b/examples/variables.cup @@ -0,0 +1,8 @@ + + +fn main() { + let x: int = 5 * 10; + let y: int = x + x; + let z: int = y - x / 2; + return z; +} |