Esempio n. 1
0
        public void SemanticError22()
        {
            string input = @"procedure a : integer; begin ; end begin ; end.";

            TestHelpers.TestCompileProgramWithError(input, @"(1, 22) Procedure cannot have return value.");
        }
Esempio n. 2
0
        public void SemanticError23()
        {
            string input = @"function a; begin ; end begin ; end.";

            TestHelpers.TestCompileProgramWithError(input, @"(1, 11) Expecting return type for function.");
        }
        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 SyntaxError26()
        {
            string input = @"var a : integer; begin a := 1;;;; a := 1 a := 2 end.";

            TestHelpers.TestCompileProgramWithError(input, @"(1, 42) Expecting ';'.");
        }
        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.");
        }
        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 SyntaxError19()
        {
            string input = @"procedure a; var a : array['test'] of integer; begin ; end begin ; end.";

            TestHelpers.TestCompileProgramWithError(input, @"(1, 28) Expecting numeric constant.");
        }
Esempio n. 8
0
        public void SemanticError35()
        {
            string input = @"procedure a; var $a : integer; begin ; end begin ; end.";

            TestHelpers.TestCompileProgramWithError(input, @"(1, 18) Identifiers starting with '$' are reserved.");
        }
        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'.");
        }
Esempio n. 14
0
        public void SemanticError25()
        {
            string input = @"var a : integer; procedure a; begin ; end begin ; end.";

            TestHelpers.TestCompileProgramWithError(input, @"(1, 28) Cannot redefine symbol 'a'.");
        }
        public void SyntaxError20()
        {
            string input = @"procedure a; var a : array of integer; begin ; end begin ; end.";

            TestHelpers.TestCompileProgramWithError(input, @"(1, 28) Expecting array subrange.");
        }
Esempio n. 16
0
        public void SemanticError28()
        {
            string input = @"procedure a(a,a:integer); begin ; end begin ; end.";

            TestHelpers.TestCompileProgramWithError(input, @"(1, 15) Cannot redefine symbol 'a'.");
        }
        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.");
        }
Esempio n. 18
0
        public void SemanticError36()
        {
            string input = @"procedure a; var a : array[1..10] of integer; begin ; end begin ; end.";

            TestHelpers.TestCompileProgramWithError(input, @"(1, 27) Iris only support arrays that start at index zero.");
        }
        public void SyntaxError11()
        {
            string input = @"procedure a; begin ; end";

            TestHelpers.TestCompileProgramWithError(input, @"(1, 25) Unexpected end of file looking for main block.");
        }