Пример #1
0
        public static AttributeValueToken Create(IHtmlToken token, char openQuote, char closeQuote) {
            if ((openQuote != '"') || (closeQuote != '"')) {
                return new ComplexAttributeValueToken(token, openQuote, closeQuote);
            }

            return new AttributeValueToken(token);
        }
        public CompositeAttributeValueToken(IHtmlToken[] tokens, char openQuote, char closeQuote, bool isScript)
            : base(tokens) {
            Debug.Assert(tokens.Length > 1, "Use AttributeValueToken for token count less than 2");

            IsScript = isScript;

            OpenQuote = openQuote;
            CloseQuote = closeQuote;
        }
Пример #3
0
 public CommentToken(IHtmlToken[] tokens)
     : base(tokens) {
 }
Пример #4
0
 public AttributeToken(IHtmlToken nameToken)
     : this(nameToken, -1, null) {
 }
Пример #5
0
 public AttributeToken(IHtmlToken nameToken, int equalsPosition)
     : this(nameToken, equalsPosition, null) {
 }
Пример #6
0
 public AttributeToken(IHtmlToken nameToken, int equalsPosition, IHtmlAttributeValueToken value) {
     NameToken = nameToken;
     EqualsSign = equalsPosition;
     ValueToken = value;
 }
Пример #7
0
 protected AttributeValueToken(IHtmlToken token)
     : base(token.Start, token.Length) {
 }
Пример #8
0
 public ScriptAttributeValueToken(IHtmlToken token, char openQuote, char closeQuote) :
     base(token, openQuote, closeQuote) {
 }
Пример #9
0
        void AppendToken(string prefix, IHtmlToken t, bool isGhost = false) {
            if (t != null) {
                var text = _parser.Text;

                Debug.Assert(t.Start >= 0 && t.End >= 0);

                if (isGhost) {
                    Log.AppendFormat("{0}: {1}: @[{2} ... {3}] <<ghost>>\r\n\r\n", prefix,
                            TokenTypeAsString(t.TokenType), t.Start, t.End);
                } else {
                    Log.AppendFormat("{0}: {1}: @[{2} ... {3}] '{4}'\r\n\r\n", prefix,
                            TokenTypeAsString(t.TokenType), t.Start, t.End, text.GetText(t));
                }
            } else {
                Log.AppendFormat("{0} <<null>>\r\n\r\n", prefix);
            }
        }
Пример #10
0
 public ComplexAttributeValueToken(IHtmlToken token, char openQuote, char closeQuote)
     : base(token) {
     _tokenType = token.TokenType;
     _openQuote = openQuote;
     _closeQuote = closeQuote;
 }