private static string GetTokenInfo(HmlTokenType type)
        {
            switch (type)
            {
            case HmlTokenType.EndOfDocument:
                return("<end of document>");

            case HmlTokenType.Equals:
                return("'='");

            case HmlTokenType.Identifier:
                return("<identifier>");

            case HmlTokenType.Indent:
            case HmlTokenType.Whitespaces:
                return("' '");

            case HmlTokenType.LineReturn:
                return("<line return>");

            case HmlTokenType.PropertiesEnd:
                return("')'");

            case HmlTokenType.PropertiesSeparator:
                return("','");

            case HmlTokenType.PropertiesStart:
                return("'('");

            case HmlTokenType.PropertyValue:
                return("'\"'<value>'\"'");

            case HmlTokenType.Text:
                return(":'<value>");

            default:
                return("?");
            }
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Hml.Parser.Lexing.HmlToken"/> class.
 /// </summary>
 /// <param name="type">Type.</param>
 /// <param name="line">Line.</param>
 /// <param name="column">Column.</param>
 /// <param name="start">Start.</param>
 /// <param name="length">Length.</param>
 /// <param name="content">Content.</param>
 public HmlToken(HmlTokenType type, int line, int column, int start, int length, string content)
 {
     this.Position = new Position(line, column, start, length);
     this.Type     = type;
     this.Content  = content;
 }