diff options
author | Bad Diode <bd@badd10de.dev> | 2021-10-30 09:02:55 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-10-30 09:02:55 +0200 |
commit | 58dfde37752f87e5df850ebe3a324dcb825fdb35 (patch) | |
tree | 40ae74a8b987b320ce25f2b5c63e7c81c57820ba /src/lexer.c | |
parent | c0520617a974abd27c413fb21ecd64ca2d11d135 (diff) | |
download | bdl-58dfde37752f87e5df850ebe3a324dcb825fdb35.tar.gz bdl-58dfde37752f87e5df850ebe3a324dcb825fdb35.zip |
Add parsing for fun expressionsv0.9
Diffstat (limited to 'src/lexer.c')
-rwxr-xr-x | src/lexer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lexer.c b/src/lexer.c index 704ee66..09c8f6c 100755 --- a/src/lexer.c +++ b/src/lexer.c | |||
@@ -15,6 +15,7 @@ static const char* token_str[] = { | |||
15 | [TOKEN_IF] = "TOKEN_IF", | 15 | [TOKEN_IF] = "TOKEN_IF", |
16 | [TOKEN_DEF] = "TOKEN_DEF", | 16 | [TOKEN_DEF] = "TOKEN_DEF", |
17 | [TOKEN_SET] = "TOKEN_SET", | 17 | [TOKEN_SET] = "TOKEN_SET", |
18 | [TOKEN_FUN] = "TOKEN_FUN", | ||
18 | [TOKEN_EOF] = "TOKEN_EOF", | 19 | [TOKEN_EOF] = "TOKEN_EOF", |
19 | }; | 20 | }; |
20 | 21 | ||
@@ -132,6 +133,7 @@ find_primitive_type(const StringView value) { | |||
132 | if (TOKEN_IS_KEYWORD(value, "if")) { return TOKEN_IF; } | 133 | if (TOKEN_IS_KEYWORD(value, "if")) { return TOKEN_IF; } |
133 | if (TOKEN_IS_KEYWORD(value, "def")) { return TOKEN_DEF; } | 134 | if (TOKEN_IS_KEYWORD(value, "def")) { return TOKEN_DEF; } |
134 | if (TOKEN_IS_KEYWORD(value, "set!")) { return TOKEN_SET; } | 135 | if (TOKEN_IS_KEYWORD(value, "set!")) { return TOKEN_SET; } |
136 | if (TOKEN_IS_KEYWORD(value, "fun")) { return TOKEN_FUN; } | ||
135 | 137 | ||
136 | return TOKEN_SYMBOL; | 138 | return TOKEN_SYMBOL; |
137 | } | 139 | } |