diff options
| Commit | 9a7a8a31e75d1b85274ef46ca29714270062809e (patch) | |
|---|---|---|
| Author | 2018-11-14 19:47:37 +0200 | |
| Committer | 2018-11-14 19:47:37 +0200 | |
| Files | 587a120e78e7c0d50c381d8f38bf0665ed8733a7 /spasm/src/asm/lexer.re | |
| IPL-9a7a8a31e75d1b85274ef46ca29714270062809e.tar IPL-9a7a8a31e75d1b85274ef46ca29714270062809e.tar.gz IPL-9a7a8a31e75d1b85274ef46ca29714270062809e.zip | ||
| Parent | 990a8f5e2c2d6e246acfd8b7a99ac1cbf4fb1675 (diff) | |
| Parent | e7c2a14f3e424f1ef1109d7634ece820a058e862 (diff) | |
Merge pull request #45 from SofiaCPP/feature/spasm_improvements
Feature/spasm improvements
1 files changed, 10 insertions, 23 deletions
| -rw-r--r-- | spasm/src/asm/lexer.re | 33 |
diff --git a/spasm/src/asm/lexer.re b/spasm/src/asm/lexer.re index c6f87ea..c54d54f 100644 --- a/spasm/src/asm/lexer.re +++ b/spasm/src/asm/lexer.re @@ -106,35 +106,35 @@ XINTEGER { continue; } -"+" { +"add" { ts.push_token (Token (Token::plus, lineno)); token_start = cursor; continue; } -"-" { +"sub" { ts.push_token (Token (Token::minus, lineno)); token_start = cursor; continue; } -"*" { +"mul" { ts.push_token (Token (Token::multiply, lineno)); token_start = cursor; continue; } -"/" { +"div" { ts.push_token (Token (Token::divide, lineno)); token_start = cursor; continue; } -"%" { +"mod" { ts.push_token (Token (Token::modulus, lineno)); token_start = cursor; @@ -142,21 +142,21 @@ XINTEGER { } "jmpt" { - ts.push_token (Token (Token::gotrue, lineno)); + ts.push_token (Token (Token::jmpt, lineno)); token_start = cursor; continue; } "jmpf" { - ts.push_token (Token (Token::gofalse, lineno)); + ts.push_token (Token (Token::jmpf, lineno)); token_start = cursor; continue; } "jmp" { - ts.push_token (Token (Token::go, lineno)); + ts.push_token (Token (Token::jmp, lineno)); token_start = cursor; continue; @@ -176,26 +176,13 @@ XINTEGER { continue; } -"load" { - ts.push_token (Token (Token::load, lineno)); - token_start = cursor; - - continue; - } - -"store" { - ts.push_token (Token (Token::store, lineno)); - token_start = cursor; - - continue; - } -"<=" { +"leq" { ts.push_token (Token (Token::lesseq, lineno)); token_start = cursor; continue; } -"<" { +"less" { ts.push_token (Token (Token::less, lineno)); token_start = cursor; |
