frontend: lexer: Add token for tilde
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
@@ -281,6 +281,10 @@ lexer_scan(struct quip_state *state, struct token *tokres)
|
|||||||
lexer_putback(state, c);
|
lexer_putback(state, c);
|
||||||
tokres->type = TT_COLON;
|
tokres->type = TT_COLON;
|
||||||
return 0;
|
return 0;
|
||||||
|
case '~':
|
||||||
|
tokres->type = TT_TILDE;
|
||||||
|
tokres->c = c;
|
||||||
|
return 0;
|
||||||
default:
|
default:
|
||||||
if (lexer_scan_name(state, c, tokres) == 0) {
|
if (lexer_scan_name(state, c, tokres) == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ static const char *toktab[] = {
|
|||||||
[TT_CC] = qtok(".cc"),
|
[TT_CC] = qtok(".cc"),
|
||||||
[TT_LD] = qtok(".ld"),
|
[TT_LD] = qtok(".ld"),
|
||||||
[TT_COLON] = qtok(":"),
|
[TT_COLON] = qtok(":"),
|
||||||
|
[TT_TILDE] = qtok("~"),
|
||||||
[TT_COLONDUB] = qtok("::")
|
[TT_COLONDUB] = qtok("::")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ typedef enum {
|
|||||||
TT_CC, /* '.cc' */
|
TT_CC, /* '.cc' */
|
||||||
TT_LD, /* '.ld' */
|
TT_LD, /* '.ld' */
|
||||||
TT_COLON, /* ':' */
|
TT_COLON, /* ':' */
|
||||||
|
TT_TILDE, /* '~' */
|
||||||
TT_COLONDUB, /* '::' */
|
TT_COLONDUB, /* '::' */
|
||||||
} tt_t;
|
} tt_t;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user