public void SyntaxError26() { string input = @"var a : integer; begin a := 1;;;; a := 1 a := 2 end."; TestHelpers.TestCompileProgramWithError(input, @"(1, 42) Expecting ';'."); }
public void LexError01() { string input = @"~"; TestHelpers.TestExpressionParserWithError(input, @"(1, 1) Unexpected character."); }
public void SyntaxError01() { string input = @""; TestHelpers.TestStatementParserWithError(input, @"(1, 1) Expecting statement."); }
public void SyntaxError23() { string input = @"procedure a(a : 'test'); begin ; end begin ; end."; TestHelpers.TestCompileProgramWithError(input, @"(1, 17) Expecting 'integer', 'string', 'boolean', or 'array'"); }
public void SyntaxError05() { string input = @"while true begin end;"; TestHelpers.TestStatementParserWithError(input, @"(1, 12) Expecting 'do'."); }
public void SyntaxError07() { string input = @"if (true then begin end;"; TestHelpers.TestStatementParserWithError(input, @"(1, 10) Expecting ')'."); }
public void SyntaxError19() { string input = @"procedure a; var a : array['test'] of integer; begin ; end begin ; end."; TestHelpers.TestCompileProgramWithError(input, @"(1, 28) Expecting numeric constant."); }
public void SyntaxError03() { string input = @"if true then"; TestHelpers.TestStatementParserWithError(input, @"(1, 13) Expecting statement."); }
public void SyntaxError16() { string input = @"procedure ; begin ; end begin ; end. unexpected"; TestHelpers.TestCompileProgramWithError(input, @"(1, 11) Expecting procedure or function name."); }
public void SyntaxError18() { string input = @"procedure a; var : integer; begin ; end begin ; end."; TestHelpers.TestCompileProgramWithError(input, @"(1, 18) Expecting variable name."); }
public void SyntaxError15() { TestHelpers.TestCompileProgramWithError(string.Empty, @"(1, 1) Unexpected end of file looking for main block."); }
public void SyntaxError14() { string input = @"procedure a; begin ; end begin ; end. unexpected"; TestHelpers.TestCompileProgramWithError(input, @"(1, 39) Expecting end of file."); }
public void SyntaxError13() { string input = @"procedure a; begin ; end a;"; TestHelpers.TestCompileProgramWithError(input, @"(1, 26) Expecting 'function', 'procedure', or 'begin'."); }
public void LexError03() { string input = @"2222222222222222222222"; TestHelpers.TestExpressionParserWithError(input, @"(1, 1) Invalid numeric constant."); }
public void SyntaxError20() { string input = @"procedure a; var a : array of integer; begin ; end begin ; end."; TestHelpers.TestCompileProgramWithError(input, @"(1, 28) Expecting array subrange."); }
public void LexError04() { string input = @"'aaaa"; TestHelpers.TestExpressionParserWithError(input, @"(1, 1) Unexpected end of line looking for end of string."); }
public void SyntaxError21() { string input = @"procedure a(a : array[0..9] of integer); begin ; end begin ; end."; TestHelpers.TestCompileProgramWithError(input, @"(1, 22) Not expecting array subrange here."); }
public void SyntaxError04() { string input = @"1 +"; TestHelpers.TestExpressionParserWithError(input, @"(1, 4) Expecting expression."); }
public void SyntaxError22() { string input = @"procedure a(a : array of array); begin ; end begin ; end."; TestHelpers.TestCompileProgramWithError(input, @"(1, 26) Expecting 'integer', 'string', or 'boolean'"); }
public void SyntaxError06() { string input = @"if true do begin end;"; TestHelpers.TestStatementParserWithError(input, @"(1, 9) Expecting 'then'."); }
public void SyntaxError02() { string input = @"if"; TestHelpers.TestStatementParserWithError(input, @"(1, 3) Expecting expression."); }
public void SyntaxError09() { string input = @"if true then begin ;"; TestHelpers.TestStatementParserWithError(input, @"(1, 21) Unexpected end of file looking for 'end'."); }
public void SyntaxError12() { string input = @"procedure a; begin ; end var i : integer; begin ; end."; TestHelpers.TestCompileProgramWithError(input, @"(1, 30) Global variables must be declared before the first function or procedure."); }