[fine] Gobs of work
- Assertion improvements - Type check function calls - Functions in the environment - Compile function calls
This commit is contained in:
parent
9d226b205d
commit
5ebede4a21
6 changed files with 539 additions and 142 deletions
|
|
@ -1,8 +1,9 @@
|
|||
let x = 23;
|
||||
let y = x * 2;
|
||||
y;
|
||||
let z = print(y);
|
||||
z;
|
||||
|
||||
// @type: 27 f64
|
||||
// @type: 41 f64
|
||||
// @concrete:
|
||||
// | File
|
||||
// | LetStatement
|
||||
|
|
@ -23,15 +24,29 @@ y;
|
|||
// | LiteralExpression
|
||||
// | Number:'"2"'
|
||||
// | Semicolon:'";"'
|
||||
// | LetStatement
|
||||
// | Let:'"let"'
|
||||
// | Identifier:'"z"'
|
||||
// | Equal:'"="'
|
||||
// | CallExpression
|
||||
// | Identifier
|
||||
// | Identifier:'"print"'
|
||||
// | ArgumentList
|
||||
// | LeftParen:'"("'
|
||||
// | Argument
|
||||
// | Identifier
|
||||
// | Identifier:'"y"'
|
||||
// | RightParen:'")"'
|
||||
// | Semicolon:'";"'
|
||||
// | ExpressionStatement
|
||||
// | Identifier
|
||||
// | Identifier:'"y"'
|
||||
// | Identifier:'"z"'
|
||||
// | Semicolon:'";"'
|
||||
// |
|
||||
// @compiles-to:
|
||||
// | function << module >> (0 args, 0 locals):
|
||||
// | strings (0):
|
||||
// | code (8):
|
||||
// | code (12):
|
||||
// | 0: PushFloat(23.0)
|
||||
// | 1: StoreModule(0)
|
||||
// | 2: LoadModule(0)
|
||||
|
|
@ -39,5 +54,9 @@ y;
|
|||
// | 4: FloatMultiply
|
||||
// | 5: StoreModule(1)
|
||||
// | 6: LoadModule(1)
|
||||
// | 7: Discard
|
||||
// | 7: LoadExternFunction(0)
|
||||
// | 8: Call(1)
|
||||
// | 9: StoreModule(2)
|
||||
// | 10: LoadModule(2)
|
||||
// | 11: Discard
|
||||
// |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue