public void BOF_EOF() { var src = @"a"; var lxr = new LL(new StringSource(src)); var expected = new LaconfigTokenType[]{LaconfigTokenType.tBOF, LaconfigTokenType.tIdentifier, LaconfigTokenType.tEOF}; Assert.IsTrue( lxr.Select(t => t.Type).SequenceEqual(expected) ); }
public void String2() { var src = @"{""string""}"; var lxr = new LL(new StringSource(src)); var expected = new LaconfigTokenType[] { LaconfigTokenType.tBOF, LaconfigTokenType.tBraceOpen, LaconfigTokenType.tStringLiteral, LaconfigTokenType.tBraceClose, LaconfigTokenType.tEOF }; Aver.IsTrue(lxr.Select(t => t.Type).SequenceEqual(expected)); }
public void BOF_EOF() { var src = @"a"; var lxr = new LL(new StringSource(src)); var expected = new LaconfigTokenType[] { LaconfigTokenType.tBOF, LaconfigTokenType.tIdentifier, LaconfigTokenType.tEOF }; Aver.IsTrue(lxr.Select(t => t.Type).SequenceEqual(expected)); }
public void Comments2() { var src = @"{ /*'string'}*/ } "; var lxr = new LL(new StringSource(src)); var expected = new LaconfigTokenType[] { LaconfigTokenType.tBOF, LaconfigTokenType.tBraceOpen, LaconfigTokenType.tComment, LaconfigTokenType.tBraceClose, LaconfigTokenType.tEOF }; Aver.IsTrue(lxr.Select(t => t.Type).SequenceEqual(expected)); }
public LaconfigToken(LaconfigLexer lexer, LaconfigTokenType type, SourcePosition startPos, SourcePosition endPos, string text, object value = null) : base(lexer, startPos, endPos, text, value) { Type = type; }
public void String2() { var src = @"{""string""}"; var lxr = new LL(new StringSource(src)); var expected = new LaconfigTokenType[]{LaconfigTokenType.tBOF, LaconfigTokenType.tBraceOpen, LaconfigTokenType.tStringLiteral, LaconfigTokenType.tBraceClose, LaconfigTokenType.tEOF}; Assert.IsTrue( lxr.Select(t => t.Type).SequenceEqual(expected) ); }
public void Comments3() { var src = @"{/* 'string //'}//inner */ } "; var lxr = new LL(new StringSource(src)); var expected = new LaconfigTokenType[]{LaconfigTokenType.tBOF, LaconfigTokenType.tBraceOpen, LaconfigTokenType.tComment, LaconfigTokenType.tBraceClose, LaconfigTokenType.tEOF}; Assert.IsTrue( lxr.Select(t => t.Type).SequenceEqual(expected) ); }