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("."); }
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'); }