Beispiel #1
0
        public TagNode([NotNull] TemplateNode parent, [NotNull] TagLex lex)
            : base(parent)
        {
            Debug.Assert(parent != null, "parent cannot be null.");
            Debug.Assert(lex != null, "lex cannot be null.");

            Components = lex.Components;
        }
        internal static void UnexpectedTag([NotNull] TagLex tagLex)
        {
            Debug.Assert(tagLex != null, "tagLex cannot be null.");

            throw new InterpreterException(
                      new Directive[0],
                      tagLex.FirstCharacterIndex,
                      "Unexpected tag {{{0}}} encountered at position {1}.",
                      tagLex.ToString(),
                      tagLex.FirstCharacterIndex);
        }
Beispiel #3
0
        public void TestCaseTagLexConstruction1()
        {
            var tag        = new Tag().Keyword("Hello").Expression();
            var components = new object[] { "Hello", "Some" };

            var lex = new TagLex(tag, components, 100, 999);

            Assert.AreEqual(100, lex.FirstCharacterIndex);
            Assert.AreEqual(999, lex.OriginalLength);
            Assert.AreSame(tag, lex.Tag);
            Assert.AreSame(components, lex.Components);
        }