Exemplo n.º 1
0
        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) );
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
 public LaconfigToken(LaconfigLexer lexer, LaconfigTokenType type, SourcePosition startPos, SourcePosition endPos, string text, object value = null) :
     base(lexer, startPos, endPos, text, value)
 {
     Type = type;
 }
Exemplo n.º 6
0
 public LaconfigToken(LaconfigLexer lexer, LaconfigTokenType type, SourcePosition startPos, SourcePosition endPos, string text, object value = null) :
                    base(lexer, startPos, endPos, text, value)
 {
   Type = type;
 }
Exemplo n.º 7
0
        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) );
        }
Exemplo n.º 8
0
        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) );
        }