Beispiel #1
0
        public void ExpandIdAsFunctionWithDot()
        {
            ExpressionLexer l = new ExpressionLexer("id1.id2.id3(", moveToFirstToken: true, useSemicolonDelimeter: false);

            Assert.True(l.ExpandIdentifierAsFunction());
            Assert.Equal("id1.id2.id3", l.CurrentToken.Text);
            Assert.Equal(0, l.CurrentToken.Position);
        }
        public void ExpandIdAsFunctionFail_WhitespaceInBetween()
        {
            ExpressionLexer l = new ExpressionLexer("id1.id2 .id3(", moveToFirstToken: true, useSemicolonDelimiter: false);

            Assert.False(l.ExpandIdentifierAsFunction());
            Assert.Equal("id1", l.CurrentToken.Text);
            Assert.Equal(0, l.CurrentToken.Position);
        }
        public void ExpandIdAsFunctionFail_DoesNotEndWithId()
        {
            ExpressionLexer l = new ExpressionLexer("id1.(", moveToFirstToken: true, useSemicolonDelimiter: false);

            Assert.False(l.ExpandIdentifierAsFunction());
            Assert.Equal("id1", l.CurrentToken.Text);
            Assert.Equal(0, l.CurrentToken.Position);
        }
        public void ExpandIdAsFunctionFail_WhitespaceInBetween()
        {
            ExpressionLexer l = new ExpressionLexer("id1.id2 .id3(");

            Assert.IsFalse(l.ExpandIdentifierAsFunction());
            Assert.AreEqual("id1", l.CurrentToken.Text);
            Assert.AreEqual(0, l.CurrentToken.Position);
        }
        public void ExpandIdAsFunctionFail_DoesNotEndWithParen()
        {
            ExpressionLexer l = new ExpressionLexer("id1.id2.id3");

            Assert.IsFalse(l.ExpandIdentifierAsFunction());
            Assert.AreEqual("id1", l.CurrentToken.Text);
            Assert.AreEqual(0, l.CurrentToken.Position);
        }
        public void ExpandIdAsFunction()
        {
            ExpressionLexer l = new ExpressionLexer("id1(");

            Assert.IsTrue(l.ExpandIdentifierAsFunction());
            Assert.AreEqual("id1", l.CurrentToken.Text);
            Assert.AreEqual(0, l.CurrentToken.Position);
        }