[fine] The VM lives! We can test it a little!

This commit is contained in:
John Doty 2024-01-14 16:06:14 -08:00
parent 866830b485
commit 1eb7da77fc
8 changed files with 117 additions and 15 deletions

View file

@ -2,7 +2,12 @@ fun foo(x: f64) {
x + 7
}
fun test() {
foo(1)
}
// @no-errors
// @eval: Float(8.0)
// @type: 20 f64
// @concrete:
// | File
@ -27,16 +32,44 @@ fun foo(x: f64) {
// | LiteralExpression
// | Number:'"7"'
// | RightBrace:'"}"'
// | FunctionDecl
// | Fun:'"fun"'
// | Identifier:'"test"'
// | ParamList
// | LeftParen:'"("'
// | RightParen:'")"'
// | Block
// | LeftBrace:'"{"'
// | ExpressionStatement
// | CallExpression
// | Identifier
// | Identifier:'"foo"'
// | ArgumentList
// | LeftParen:'"("'
// | Argument
// | LiteralExpression
// | Number:'"1"'
// | RightParen:'")"'
// | RightBrace:'"}"'
// |
// @compiles-to:
// | function foo (1 args, 0 locals):
// | strings (0):
// | code (3):
// | code (4):
// | 0: LoadArgument(0)
// | 1: PushFloat(7.0)
// | 2: FloatAdd
// | 3: Return
// | function test (0 args, 0 locals):
// | strings (0):
// | code (4):
// | 0: PushFloat(1.0)
// | 1: LoadFunction(0)
// | 2: Call(1)
// | 3: Return
// | function << module >> (0 args, 0 locals):
// | strings (0):
// | code (1):
// | code (2):
// | 0: PushNothing
// | 1: Return
// |