yashrathi-git / loxscript Goto Github PK
View Code? Open in Web Editor NEWLoxscript is an interpreted, dynamically typed scripting language
Loxscript is an interpreted, dynamically typed scripting language
This causes an infinite loop:
var a = "global a";
var b = "global b";
var c = "global c";
{
var a = "outer a";
var b = "outer b" // Missing semicolon
{
var a = "inner a";
print a;
print b;
print c;
}
print a;
print b;
print c;
}
print a;
print b;
print c;
$ dart tools/bin/test.dart jlox --interpreter INTERPRETER
FAIL test/string/error_after_multiline.lox
Expected runtime error 'Undefined variable 'err'.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Undefined variable err' when none was expected.
Got output '[line: 7]' when none was expected.
FAIL test/string/unterminated.lox
Missing expected error: [2] Error: Unterminated string.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error : Unterminated string' when none was expected.
FAIL test/operator/not.lox
Expected output 'false' on line 6 and got 'true'.
Expected output 'false' on line 10 and got 'true'.
FAIL test/operator/subtract_num_nonnum.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/multiply_num_nonnum.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/not_equals.lox
Expected output 'true' on line 13 and got 'false'.
FAIL test/operator/greater_or_equal_num_nonnum.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/add_string_nil.lox
Expected runtime error 'Operands must be two numbers or two strings.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be number or strings' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/less_or_equal_nonnum_num.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/divide_nonnum_num.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/comparison.lox
Expected return code 0 and got 1. Stderr:
Expected output 'false' on line 18 and got 'Operand must be a number'.
Expected output 'false' on line 19 and got '[line: 18]'.
Missing expected output 'false' on line 20.
Missing expected output 'false' on line 21.
Missing expected output 'true' on line 22.
Missing expected output 'true' on line 23.
Missing expected output 'true' on line 24.
Missing expected output 'true' on line 25.
FAIL test/operator/greater_or_equal_nonnum_num.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/negate_nonnum.lox
Expected runtime error 'Operand must be a number.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/add_bool_num.lox
Expected runtime error 'Operands must be two numbers or two strings.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be number or strings' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/negate.lox
Expected return code 0 and got 1. Stderr:
Expected output '-3' on line 1 and got '-4'.
Expected output '3' on line 2 and got 'Operand must be a number'.
Expected output '-3' on line 3 and got '[line: 2]'.
FAIL test/operator/multiply_nonnum_num.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/greater_num_nonnum.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/less_num_nonnum.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/subtract_nonnum_num.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/add_num_nil.lox
Expected runtime error 'Operands must be two numbers or two strings.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be number or strings' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/divide_num_nonnum.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/add_nil_nil.lox
Expected runtime error 'Operands must be two numbers or two strings.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be number or strings' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/add_bool_nil.lox
Expected runtime error 'Operands must be two numbers or two strings.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be number or strings' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/equals.lox
Expected output 'false' on line 13 and got 'true'.
FAIL test/operator/less_nonnum_num.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/add_bool_string.lox
Expected runtime error 'Operands must be two numbers or two strings.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be number or strings' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/greater_nonnum_num.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/operator/less_or_equal_num_nonnum.lox
Expected runtime error 'Operands must be numbers.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Operand must be a number' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/while/var_in_body.lox
Missing expected error: [2] Error at 'var': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at var : Expected expression.' when none was expected.
FAIL test/while/class_in_body.lox
Missing expected error: [2] Error at 'class': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at class : Expected expression.' when none was expected.
FAIL test/while/syntax.lox
Expected return code 0 and got 1. Stderr:
Expected output '1' on line 4 and got '[line: 21] Error at ) : Expected ';' after condition'.
Missing expected output '2' on line 5.
Missing expected output '3' on line 6.
Missing expected output '0' on line 14.
Missing expected output '1' on line 15.
Missing expected output '2' on line 16.
FAIL test/while/fun_in_body.lox
Missing expected error: [2] Error at 'fun': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at fun : Expected expression.' when none was expected.
FAIL test/for/var_in_body.lox
Missing expected error: [2] Error at 'var': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at ) : Expected ';' after condition' when none was expected.
FAIL test/for/return_inside.lox
Expected return code 0 and got 1. Stderr:
Expected output 'i' on line 9 and got '[line: 2] Error at ) : Expected ';' after condition'.
Got output '[line: 6] Error at } : Expected expression.' when none was expected.
FAIL test/for/class_in_body.lox
Missing expected error: [2] Error at 'class': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at ) : Expected ';' after condition' when none was expected.
FAIL test/for/statement_increment.lox
Missing expected error: [2] Error at '{': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at { : Expected expression.' when none was expected.
FAIL test/for/statement_initializer.lox
Missing expected error: [3] Error at '{': Expect expression.
Missing expected error: [3] Error at ')': Expect ';' after expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 3] Error at { : Expected expression.' when none was expected.
Got output '[line: 3] Error at ) : Expected ';' after expression' when none was expected.
FAIL test/for/scope.lox
Expected output '-1' on line 10 and got '-2'.
FAIL test/for/syntax.lox
Expected return code 0 and got 1. Stderr:
Expected output '1' on line 3 and got '[line: 17] Error at ) : Expected ';' after condition'.
Expected output '2' on line 4 and got '[line: 29] Error at i : Expected ';' after condition'.
Expected output '3' on line 5 and got '[line: 33] Error at } : Expected expression.'.
Expected output '0' on line 11 and got '[line: 50] Error at ) : Expected ';' after condition'.
Missing expected output '1' on line 12.
Missing expected output '2' on line 13.
Missing expected output 'done' on line 19.
Missing expected output '0' on line 24.
Missing expected output '1' on line 25.
Missing expected output '0' on line 35.
Missing expected output '1' on line 36.
Missing expected output '2' on line 37.
Missing expected output '0' on line 44.
Missing expected output '1' on line 45.
FAIL test/for/return_closure.lox
Expected return code 0 and got 1. Stderr:
Expected output 'i' on line 10 and got '[line: 2] Error at ) : Expected ';' after condition'.
Got output '[line: 7] Error at } : Expected expression.' when none was expected.
FAIL test/for/fun_in_body.lox
Missing expected error: [2] Error at 'fun': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at ) : Expected ';' after condition' when none was expected.
FAIL test/for/statement_condition.lox
Missing expected error: [3] Error at '{': Expect expression.
Missing expected error: [3] Error at ')': Expect ';' after expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 3] Error at { : Expected expression.' when none was expected.
Got output '[line: 3] Error at ) : Expected ';' after expression' when none was expected.
FAIL test/print/missing_argument.lox
Missing expected error: [2] Error at ';': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at ; : Expected expression.' when none was expected.
FAIL test/this/this_at_top_level.lox
Missing expected error: [1] Error at 'this': Can't use 'this' outside of a class.
Expected return code 65 and got 1. Stderr:
Got output '[line: 1] Error at this : Cannot use 'this' outside of a class' when none was expected.
FAIL test/this/nested_class.lox
Expected output 'Outer instance' on line 3 and got '<instance of Outer>'.
Expected output 'Outer instance' on line 6 and got '<instance of Outer>'.
Expected output 'Inner instance' on line 10 and got '<instance of Inner>'.
FAIL test/this/this_in_top_level_function.lox
Missing expected error: [2] Error at 'this': Can't use 'this' outside of a class.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at this : Cannot use 'this' outside of a class' when none was expected.
FAIL test/method/refer_to_name.lox
Expected runtime error 'Undefined variable 'method'.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Undefined variable method' when none was expected.
Got output '[line: 3]' when none was expected.
FAIL test/method/too_many_arguments.lox
Missing expected error: [259] Error at 'a': Can't have more than 255 arguments.
Expected return code 65 and got 1. Stderr:
Got output '[line: 259] Error at a : Can't have more than 255 arguments.' when none was expected.
FAIL test/method/missing_arguments.lox
Expected runtime error 'Expected 2 arguments but got 1.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Expected 2 arguments but got 1' when none was expected.
Got output '[line: 5]' when none was expected.
FAIL test/method/too_many_parameters.lox
Missing expected error: [258] Error at 'a': Can't have more than 255 parameters.
Expected return code 65 and got 1. Stderr:
Got output '[line: 258] Error at a : Cannot have more than 255 parameters.' when none was expected.
FAIL test/method/not_found.lox
Expected runtime error 'Undefined property 'unknown'.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Undefined property unknown' when none was expected.
Got output '[line: 3]' when none was expected.
FAIL test/method/extra_arguments.lox
Expected runtime error 'Expected 2 arguments but got 4.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Expected 2 arguments but got 4' when none was expected.
Got output '[line: 8]' when none was expected.
FAIL test/unexpected_character.lox
Missing expected error: [3] Error: Unexpected character.
Missing expected error: [3] Error at 'b': Expect ')' after arguments.
Expected return code 65 and got 1. Stderr:
Got output '[line: 3] Error : Illegal character |' when none was expected.
Got output '[line: 3] Error at b : Expected ')' after arguments' when none was expected.
FAIL test/variable/use_nil_as_var.lox
Missing expected error: [2] Error at 'nil': Expect variable name.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at nil : Expected variable name' when none was expected.
FAIL test/variable/duplicate_local.lox
Missing expected error: [3] Error at 'a': Already a variable with this name in this scope.
Expected return code 65 and got 1. Stderr:
Got output '[line: 3] Error at a : a already exists.' when none was expected.
FAIL test/variable/undefined_local.lox
Expected runtime error 'Undefined variable 'notDefined'.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Undefined variable notDefined' when none was expected.
Got output '[line: 2]' when none was expected.
FAIL test/variable/undefined_global.lox
Expected runtime error 'Undefined variable 'notDefined'.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Undefined variable notDefined' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/variable/use_this_as_var.lox
Missing expected error: [2] Error at 'this': Expect variable name.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at this : Expected variable name' when none was expected.
FAIL test/variable/use_false_as_var.lox
Missing expected error: [2] Error at 'false': Expect variable name.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at false : Expected variable name' when none was expected.
FAIL test/variable/use_local_in_initializer.lox
Missing expected error: [3] Error at 'a': Can't read local variable in its own initializer.
Expected return code 65 and got 1. Stderr:
Got output '[line: 3] Error at a : Can't read the local variable in it's own initializer' when none was expected.
FAIL test/variable/duplicate_parameter.lox
Missing expected error: [2] Error at 'arg': Already a variable with this name in this scope.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at arg : arg already exists.' when none was expected.
FAIL test/variable/collide_with_parameter.lox
Missing expected error: [2] Error at 'a': Already a variable with this name in this scope.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at a : a already exists.' when none was expected.
FAIL test/return/at_top_level.lox
Missing expected error: [1] Error at 'return': Can't return from top-level code.
Expected return code 65 and got 1. Stderr:
Got output '[line: 1] Error at return : Cannot use return outside of functions or methods' when none was expected.
FAIL test/call/num.lox
Expected runtime error 'Can only call functions and classes.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Object is not callable' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/call/object.lox
Expected runtime error 'Can only call functions and classes.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Object is not callable' when none was expected.
Got output '[line: 4]' when none was expected.
FAIL test/call/string.lox
Expected runtime error 'Can only call functions and classes.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Object is not callable' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/call/nil.lox
Expected runtime error 'Can only call functions and classes.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Object is not callable' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/call/bool.lox
Expected runtime error 'Can only call functions and classes.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Object is not callable' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/constructor/early_return.lox
Expected output 'Foo instance' on line 10 and got '<instance of Foo>'.
FAIL test/constructor/default.lox
Expected output 'Foo instance' on line 4 and got '<instance of Foo>'.
FAIL test/constructor/call_init_explicitly.lox
Expected output 'Foo instance' on line 12 and got 'nil'.
FAIL test/constructor/return_value.lox
Missing expected error: [3] Error at 'return': Can't return a value from an initializer.
Expected return code 65 and got 0. Stderr:
FAIL test/constructor/missing_arguments.lox
Expected runtime error 'Expected 2 arguments but got 1.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Expected 2 arguments but got 1' when none was expected.
Got output '[line: 5]' when none was expected.
FAIL test/constructor/default_arguments.lox
Expected runtime error 'Expected 0 arguments but got 3.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Expected 0 arguments but got 3' when none was expected.
Got output '[line: 3]' when none was expected.
FAIL test/constructor/return_in_nested_function.lox
Expected output 'Foo instance' on line 10 and got '<instance of Foo>'.
FAIL test/constructor/extra_arguments.lox
Expected runtime error 'Expected 2 arguments but got 4.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Expected 2 arguments but got 4' when none was expected.
Got output '[line: 8]' when none was expected.
FAIL test/constructor/call_init_early_return.lox
Expected output 'Foo instance' on line 11 and got 'nil'.
FAIL test/assignment/infix_operator.lox
Missing expected error: [3] Error at '=': Invalid assignment target.
Expected return code 65 and got 1. Stderr:
Got output '[line: 3] Error at = : Invalid assignment target' when none was expected.
FAIL test/assignment/grouping.lox
Missing expected error: [2] Error at '=': Invalid assignment target.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at = : Invalid assignment target' when none was expected.
FAIL test/assignment/prefix_operator.lox
Missing expected error: [2] Error at '=': Invalid assignment target.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at = : Invalid assignment target' when none was expected.
FAIL test/assignment/to_this.lox
Missing expected error: [3] Error at '=': Invalid assignment target.
Expected return code 65 and got 1. Stderr:
Got output '[line: 3] Error at = : Invalid assignment target' when none was expected.
FAIL test/assignment/undefined.lox
Expected runtime error 'Undefined variable 'unknown'.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Undefined variable unknown' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/logical_operator/and_truth.lox
Expected output 'ok' on line 7 and got '0'.
Missing expected output 'ok' on line 8.
FAIL test/logical_operator/or_truth.lox
Expected output '0' on line 7 and got 'ok'.
FAIL test/super/super_without_name.lox
Missing expected error: [5] Error at ';': Expect superclass method name.
Expected return code 65 and got 1. Stderr:
Got output '[line: 5] Error at ; : Expected superclass method name' when none was expected.
FAIL test/super/no_superclass_call.lox
Missing expected error: [3] Error at 'super': Can't use 'super' in a class with no superclass.
Expected return code 65 and got 1. Stderr:
Got output '[line: 3] Error at super : Cannot use 'super' with no subclass.' when none was expected.
FAIL test/super/super_without_dot.lox
Missing expected error: [6] Error at ';': Expect '.' after 'super'.
Expected return code 65 and got 1. Stderr:
Got output '[line: 6] Error at ; : Expect '.' after super' when none was expected.
FAIL test/super/no_superclass_method.lox
Expected runtime error 'Undefined property 'doesNotExist'.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Undefined method 'doesNotExist'' when none was expected.
Got output '[line: 5]' when none was expected.
FAIL test/super/super_at_top_level.lox
Missing expected error: [1] Error at 'super': Can't use 'super' outside of a class.
Missing expected error: [2] Error at 'super': Can't use 'super' outside of a class.
Expected return code 65 and got 1. Stderr:
Got output '[line: 1] Error at super : Cannot use 'super' outside a class.' when none was expected.
Got output '[line: 1] Error at super : Cannot use 'super' with no subclass.' when none was expected.
Got output '[line: 2] Error at super : Cannot use 'super' outside a class.' when none was expected.
Got output '[line: 2] Error at super : Cannot use 'super' with no subclass.' when none was expected.
FAIL test/super/super_in_closure_in_inherited_method.lox
Expected return code 0 and got 1. Stderr:
Expected output 'A' on line 26 and got 'Undefined property getClosure'.
Got output '[line: 26]' when none was expected.
FAIL test/super/missing_arguments.lox
Expected runtime error 'Expected 2 arguments but got 1.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Expected 2 arguments but got 1' when none was expected.
Got output '[line: 9]' when none was expected.
FAIL test/super/no_superclass_bind.lox
Missing expected error: [3] Error at 'super': Can't use 'super' in a class with no superclass.
Expected return code 65 and got 1. Stderr:
Got output '[line: 3] Error at super : Cannot use 'super' with no subclass.' when none was expected.
FAIL test/super/super_in_inherited_method.lox
Expected return code 0 and got 1. Stderr:
Expected output 'A' on line 23 and got 'Undefined property test'.
Got output '[line: 23]' when none was expected.
FAIL test/super/super_in_top_level_function.lox
Missing expected error: [1] Error at 'super': Can't use 'super' outside of a class.
Expected return code 65 and got 1. Stderr:
Got output '[line: 1] Error at super : Cannot use 'super' outside a class.' when none was expected.
Got output '[line: 1] Error at super : Cannot use 'super' with no subclass.' when none was expected.
FAIL test/super/indirectly_inherited.lox
Expected return code 0 and got 1. Stderr:
Expected output 'A.foo()' on line 18 and got 'Undefined method 'foo''.
Got output '[line: 12]' when none was expected.
FAIL test/super/extra_arguments.lox
Expected runtime error 'Expected 2 arguments but got 4.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Expected 2 arguments but got 4' when none was expected.
Got output '[line: 10]' when none was expected.
FAIL test/super/parenthesized.lox
Missing expected error: [8] Error at ')': Expect '.' after 'super'.
Expected return code 65 and got 1. Stderr:
Got output '[line: 8] Error at ) : Expect '.' after super' when none was expected.
FAIL test/closure/assign_to_shadowed_later.lox
Expected output 'inner' on line 10 and got 'assigned'.
FAIL test/if/fun_in_else.lox
Missing expected error: [2] Error at 'fun': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at fun : Expected expression.' when none was expected.
FAIL test/if/fun_in_then.lox
Missing expected error: [2] Error at 'fun': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at fun : Expected expression.' when none was expected.
FAIL test/if/var_in_then.lox
Missing expected error: [2] Error at 'var': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at var : Expected expression.' when none was expected.
FAIL test/if/var_in_else.lox
Missing expected error: [2] Error at 'var': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at var : Expected expression.' when none was expected.
FAIL test/if/class_in_then.lox
Missing expected error: [2] Error at 'class': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at class : Expected expression.' when none was expected.
FAIL test/if/class_in_else.lox
Missing expected error: [2] Error at 'class': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at class : Expected expression.' when none was expected.
FAIL test/if/truth.lox
Missing expected output '0' on line 7.
Missing expected output 'empty' on line 8.
FAIL test/number/literals.lox
Expected output '-0' on line 4 and got '-1'.
Expected output '-0.001' on line 7 and got '-1'.
FAIL test/number/trailing_dot.lox
Missing expected error: [2] Error at ';': Expect property name after '.'.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at ; : Expected property name after '.'' when none was expected.
FAIL test/number/leading_dot.lox
Missing expected error: [2] Error at '.': Expect expression.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at . : Expected expression.' when none was expected.
FAIL test/number/decimal_point_at_eof.lox
Missing expected error: [2] Error at end: Expect property name after '.'.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at end : Expected property name after '.'' when none was expected.
FAIL test/inheritance/inherit_from_nil.lox
Expected runtime error 'Superclass must be a class.' and got:
Traceback (most recent call last):
Expected stack trace and got:
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 294, in interpret
self._execute(st)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 289, in _execute
st.accept(self)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/parser/stmt.py", line 125, in accept
visitor.visit_class_statement(self)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 58, in visit_class_statement
raise RuntimeException(
loxscript.errors.RuntimeException: Superclass must be a class
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/run.py", line 5, in <module>
main()
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/__main__.py", line 74, in main
run_file(args[1])
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/__main__.py", line 59, in run_file
run(source=code)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/__main__.py", line 27, in __call__
self._interpreter.interpret(statements)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 296, in interpret
runtime_error(err)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/handle_errors.py", line 30, in runtime_error
print(str(runtime_exception) + f"\n[line: {runtime_exception.token.line}]")
AttributeError: 'Variable' object has no attribute 'line'
Expected return code 70 and got 1. Stderr:
Traceback (most recent call last):
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 294, in interpret
self._execute(st)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 289, in _execute
st.accept(self)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/parser/stmt.py", line 125, in accept
visitor.visit_class_statement(self)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 58, in visit_class_statement
raise RuntimeException(
loxscript.errors.RuntimeException: Superclass must be a class
(truncated...)
FAIL test/inheritance/constructor.lox
Expected return code 0 and got 1. Stderr:
Expected output 'value' on line 14 and got 'Expected 0 arguments but got 1'.
Got output '[line: 13]' when none was expected.
FAIL test/inheritance/set_fields_from_base_class.lox
Expected return code 0 and got 1. Stderr:
Expected output 'foo 1' on line 28 and got 'Undefined property foo'.
Expected output 'foo 2' on line 29 and got '[line: 26]'.
Missing expected output 'bar 1' on line 33.
Missing expected output 'bar 2' on line 34.
Missing expected output 'bar 1' on line 37.
Missing expected output 'bar 2' on line 38.
FAIL test/inheritance/parenthesized_superclass.lox
Missing expected error: [4] Error at '(': Expect superclass name.
Expected return code 65 and got 1. Stderr:
Got output '[line: 4] Error at ( : '<' must be followed by superclass name' when none was expected.
FAIL test/inheritance/inherit_from_number.lox
Expected runtime error 'Superclass must be a class.' and got:
Traceback (most recent call last):
Expected stack trace and got:
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 294, in interpret
self._execute(st)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 289, in _execute
st.accept(self)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/parser/stmt.py", line 125, in accept
visitor.visit_class_statement(self)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 58, in visit_class_statement
raise RuntimeException(
loxscript.errors.RuntimeException: Superclass must be a class
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/run.py", line 5, in <module>
main()
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/__main__.py", line 74, in main
run_file(args[1])
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/__main__.py", line 59, in run_file
run(source=code)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/__main__.py", line 27, in __call__
self._interpreter.interpret(statements)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 296, in interpret
runtime_error(err)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/handle_errors.py", line 30, in runtime_error
print(str(runtime_exception) + f"\n[line: {runtime_exception.token.line}]")
AttributeError: 'Variable' object has no attribute 'line'
Expected return code 70 and got 1. Stderr:
Traceback (most recent call last):
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 294, in interpret
self._execute(st)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 289, in _execute
st.accept(self)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/parser/stmt.py", line 125, in accept
visitor.visit_class_statement(self)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 58, in visit_class_statement
raise RuntimeException(
loxscript.errors.RuntimeException: Superclass must be a class
(truncated...)
FAIL test/inheritance/inherit_methods.lox
Expected return code 0 and got 1. Stderr:
Expected output 'foo' on line 12 and got 'Undefined property methodOnFoo'.
Expected output 'bar' on line 13 and got '[line: 12]'.
Missing expected output 'bar' on line 14.
FAIL test/inheritance/inherit_from_function.lox
Expected runtime error 'Superclass must be a class.' and got:
Traceback (most recent call last):
Expected stack trace and got:
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 294, in interpret
self._execute(st)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 289, in _execute
st.accept(self)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/parser/stmt.py", line 125, in accept
visitor.visit_class_statement(self)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 58, in visit_class_statement
raise RuntimeException(
loxscript.errors.RuntimeException: Superclass must be a class
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/run.py", line 5, in <module>
main()
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/__main__.py", line 74, in main
run_file(args[1])
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/__main__.py", line 59, in run_file
run(source=code)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/__main__.py", line 27, in __call__
self._interpreter.interpret(statements)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 296, in interpret
runtime_error(err)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/handle_errors.py", line 30, in runtime_error
print(str(runtime_exception) + f"\n[line: {runtime_exception.token.line}]")
AttributeError: 'Variable' object has no attribute 'line'
Expected return code 70 and got 1. Stderr:
Traceback (most recent call last):
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 294, in interpret
self._execute(st)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 289, in _execute
st.accept(self)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/parser/stmt.py", line 125, in accept
visitor.visit_class_statement(self)
File "/home/yashrathi/Documents/B_Programming/B_Projects/loxscript/loxscript/interpreter/interpreter.py", line 58, in visit_class_statement
raise RuntimeException(
loxscript.errors.RuntimeException: Superclass must be a class
(truncated...)
FAIL test/class/inherited_method.lox
Expected return code 0 and got 1. Stderr:
Expected output 'in foo' on line 20 and got 'Undefined property inFoo'.
Expected output 'in bar' on line 21 and got '[line: 20]'.
Missing expected output 'in baz' on line 22.
FAIL test/class/local_inherit_self.lox
Missing expected error: [2] Error at 'Foo': A class can't inherit from itself.
Expected return code 65 and got 1. Stderr:
Got output '[line: 2] Error at Foo : A class cannot inherit from itself.' when none was expected.
FAIL test/class/inherit_self.lox
Missing expected error: [1] Error at 'Foo': A class can't inherit from itself.
Expected return code 65 and got 1. Stderr:
Got output '[line: 1] Error at Foo : A class cannot inherit from itself.' when none was expected.
FAIL test/field/call_nonfunction_field.lox
Expected runtime error 'Can only call functions and classes.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Object is not callable' when none was expected.
Got output '[line: 6]' when none was expected.
FAIL test/field/set_on_class.lox
Expected runtime error 'Only instances have fields.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Only class instances could have fields' when none was expected.
Got output '[line: 2]' when none was expected.
FAIL test/field/get_on_bool.lox
Expected runtime error 'Only instances have properties.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Only instances can have properties' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/field/set_on_bool.lox
Expected runtime error 'Only instances have fields.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Only class instances could have fields' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/field/set_on_string.lox
Expected runtime error 'Only instances have fields.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Only class instances could have fields' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/field/set_on_function.lox
Expected runtime error 'Only instances have fields.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Only class instances could have fields' when none was expected.
Got output '[line: 3]' when none was expected.
FAIL test/field/set_on_nil.lox
Expected runtime error 'Only instances have fields.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Only class instances could have fields' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/field/get_on_num.lox
Expected runtime error 'Only instances have properties.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Only instances can have properties' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/field/undefined.lox
Expected runtime error 'Undefined property 'bar'.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Undefined property bar' when none was expected.
Got output '[line: 4]' when none was expected.
FAIL test/field/set_evaluation_order.lox
Expected runtime error 'Undefined variable 'undefined1'.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Undefined variable undefined1' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/field/get_on_string.lox
Expected runtime error 'Only instances have properties.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Only instances can have properties' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/field/get_on_class.lox
Expected runtime error 'Only instances have properties.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Only instances can have properties' when none was expected.
Got output '[line: 2]' when none was expected.
FAIL test/field/set_on_num.lox
Expected runtime error 'Only instances have fields.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Only class instances could have fields' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/field/get_on_function.lox
Expected runtime error 'Only instances have properties.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Only instances can have properties' when none was expected.
Got output '[line: 3]' when none was expected.
FAIL test/field/get_on_nil.lox
Expected runtime error 'Only instances have properties.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Only instances can have properties' when none was expected.
Got output '[line: 1]' when none was expected.
FAIL test/function/print.lox
Expected output '<native fn>' on line 4 and got '<native function>'.
FAIL test/function/local_mutual_recursion.lox
Expected runtime error 'Undefined variable 'isOdd'.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Undefined variable isOdd' when none was expected.
Got output '[line: 4]' when none was expected.
FAIL test/function/too_many_arguments.lox
Missing expected error: [260] Error at 'a': Can't have more than 255 arguments.
Expected return code 65 and got 1. Stderr:
Got output '[line: 260] Error at a : Can't have more than 255 arguments.' when none was expected.
FAIL test/function/missing_arguments.lox
Expected runtime error 'Expected 2 arguments but got 1.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Expected 2 arguments but got 1' when none was expected.
Got output '[line: 3]' when none was expected.
FAIL test/function/too_many_parameters.lox
Missing expected error: [257] Error at 'a': Can't have more than 255 parameters.
Expected return code 65 and got 1. Stderr:
Got output '[line: 257] Error at a : Cannot have more than 255 parameters.' when none was expected.
FAIL test/function/body_must_be_block.lox
Missing expected error: [3] Error at '123': Expect '{' before function body.
Expected return code 65 and got 1. Stderr:
Got output '[line: 3] Error at 123 : Expected '{' before body.' when none was expected.
FAIL test/function/missing_comma_in_parameters.lox
Missing expected error: [3] Error at 'c': Expect ')' after parameters.
Expected return code 65 and got 1. Stderr:
Got output '[line: 3] Error at c : Expected ')' after parameters' when none was expected.
FAIL test/function/extra_arguments.lox
Expected runtime error 'Expected 2 arguments but got 4.' and got none.
Expected return code 70 and got 1. Stderr:
Got output 'Expected 2 arguments but got 4' when none was expected.
Got output '[line: 6]' when none was expected.
FAIL test/bool/equality.lox
Expected output 'false' on line 7 and got 'true'.
Expected output 'false' on line 8 and got 'true'.
Expected output 'true' on line 19 and got 'false'.
Expected output 'true' on line 20 and got 'false'.
96 tests passed. 143 tests failed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.