Add a "dollar sign" token to lex.hpp and use it in lexer.cpp
This commit is contained in:
parent
e3804aa342
commit
328a073d50
|
@ -26,6 +26,7 @@ vector<tok> lex(const string& in)
|
||||||
case '-': resVal.emplace_back(tok::HYPHEN, "-"); break;
|
case '-': resVal.emplace_back(tok::HYPHEN, "-"); break;
|
||||||
case '>': resVal.emplace_back(tok::LCOMP, ">"); break;
|
case '>': resVal.emplace_back(tok::LCOMP, ">"); break;
|
||||||
case '<': resVal.emplace_back(tok::RCOMP, "<"); break;
|
case '<': resVal.emplace_back(tok::RCOMP, "<"); break;
|
||||||
|
case '$': resVal.emplace_back(tok::DOLLAR_SIGN, "$"); break;
|
||||||
case '\'': resVal.emplace_back(tok::SQUOTE, "\'"); break;
|
case '\'': resVal.emplace_back(tok::SQUOTE, "\'"); break;
|
||||||
case ' ': case '\t': case '\r':
|
case ' ': case '\t': case '\r':
|
||||||
case '\n': break;
|
case '\n': break;
|
||||||
|
|
|
@ -10,7 +10,7 @@ struct tok {
|
||||||
using Yerbacon::Exception::Exception;
|
using Yerbacon::Exception::Exception;
|
||||||
};
|
};
|
||||||
enum type {
|
enum type {
|
||||||
DEFINE, TAG, NUMBER, PLUS, LPAR, LBRACE, LBRACKET, RPAR, RBRACE, RBRACKET, ALPHACHAR, HYPHEN, LCOMP, RCOMP,
|
DEFINE, TAG, DOLLAR_SIGN, NUMBER, PLUS, LPAR, LBRACE, LBRACKET, RPAR, RBRACE, RBRACKET, ALPHACHAR, HYPHEN, LCOMP, RCOMP,
|
||||||
SQUOTE,
|
SQUOTE,
|
||||||
STRING,
|
STRING,
|
||||||
IDENTIFIER,
|
IDENTIFIER,
|
||||||
|
|
Loading…
Reference in New Issue