Add a "dollar sign" token to lex.hpp and use it in lexer.cpp

This commit is contained in:
Username404 2021-08-05 00:03:50 +02:00
parent e3804aa342
commit 328a073d50
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
2 changed files with 2 additions and 1 deletions

View File

@ -26,6 +26,7 @@ vector<tok> lex(const string& in)
case '-': resVal.emplace_back(tok::HYPHEN, "-"); break;
case '>': resVal.emplace_back(tok::LCOMP, ">"); break;
case '<': resVal.emplace_back(tok::RCOMP, "<"); break;
case '$': resVal.emplace_back(tok::DOLLAR_SIGN, "$"); break;
case '\'': resVal.emplace_back(tok::SQUOTE, "\'"); break;
case ' ': case '\t': case '\r':
case '\n': break;

View File

@ -10,7 +10,7 @@ struct tok {
using Yerbacon::Exception::Exception;
};
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,
STRING,
IDENTIFIER,