Add a DOT token to lex.hpp, and only use the enum characters.
This commit is contained in:
parent
7a23e31dea
commit
e9ce6362af
|
@ -19,7 +19,8 @@ vector<tok> lex(const string& in)
|
|||
case TAG: case DEFINE: case LPAR: case RPAR:
|
||||
case LBRACE: case RBRACE: case LBRACKET: case RBRACKET:
|
||||
case PLUS: case HYPHEN: case LCOMP: case RCOMP:
|
||||
case '$': case '\'': resVal.emplace_back(static_cast<tok::type>(current), string(1, current));
|
||||
case DOT: case DOLLAR_SIGN: case SQUOTE:
|
||||
resVal.emplace_back(static_cast<tok::type>(current), string(1, current));
|
||||
[[likely]] case ' ': case '\t': case '\r':
|
||||
[[likely]] case '\n': break;
|
||||
default: {
|
||||
|
|
|
@ -12,7 +12,7 @@ struct tok {
|
|||
};
|
||||
enum type: const unsigned short {
|
||||
UNEXPECTED = std::numeric_limits<unsigned char>::max() + 1, IDENTIFIER, NUMBER, ALPHACHAR,
|
||||
DEFINE = '=', TAG = '#', DOLLAR_SIGN = '$',
|
||||
DEFINE = '=', TAG = '#', DOLLAR_SIGN = '$', DOT = '.',
|
||||
PLUS = '+', LPAR = '(', LBRACE = '{', LBRACKET = '[', RPAR = ')',
|
||||
RBRACE = '}', RBRACKET = ']',
|
||||
HYPHEN = '-', LCOMP = '>', RCOMP = '<',
|
||||
|
|
Loading…
Reference in New Issue