示例#1
0
        public void PointerG_Should_ReturnDot()
        {
            var input = @"^G";

            var tokens = lexer.Tokenize(input);

            ast.CreateIterator(tokens);

            var node = ast.Expression();

            interpreter.CreateGlobalMemory();
            var s = interpreter.VisitNode(node);

            s.ToString().Should().Be(".");
        }
示例#2
0
        public void FunctionAssignment_Should_Pass()
        {
            var input  = @"
function GetNum: char;
var look : char;
begin
   if look = 't' then Writeln('Integer');
   GetNum := Look;
end;";
            var tokens = lexer.Tokenize(input);

            ast.CreateIterator(tokens);
            var node = ast.FunctionDeclaration();

            analyzer.CreateCurrentScope("test");
            this.analyzer.VisitFunctionDeclaration(node);
        }
        public void PointerI_Should_BeI()
        {
            var input = @"^I";

            var tokens = lexer.Tokenize(input);

            ast.CreateIterator(tokens);
            var node = ast.Expression();

            node.Should().BeOfType <PointerNode>().Which.Value.Should().Be('I');
        }