aboutsummaryrefslogtreecommitdiffstats
path: root/libalee/parser.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2023-10-14 17:38:57 -0400
committerClyne Sullivan <clyne@bitgloo.com>2023-10-14 17:38:57 -0400
commit5991370657b48f5b44fbcc7877a7c26acf07d99e (patch)
treef0967c003302afb0db70a84e959a1513564f6322 /libalee/parser.cpp
parent70e399b49897d9ed6724a8396a015bddcfdfea79 (diff)
consteval and other refactoring
Diffstat (limited to 'libalee/parser.cpp')
-rw-r--r--libalee/parser.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libalee/parser.cpp b/libalee/parser.cpp
index da7ae0b..16281d3 100644
--- a/libalee/parser.cpp
+++ b/libalee/parser.cpp
@@ -111,12 +111,12 @@ Error Parser::parseNumber(State& state, Word word)
auto ins = CoreWords::findi("_lit");
const Cell maxlit = Dictionary::Begin - CoreWords::WordCount;
- if (value >= 0 && value < maxlit) {
- state.dict.add(value + CoreWords::WordCount);
- } else {
+ if (value >= 0 && value < maxlit)
+ value += CoreWords::WordCount;
+ else
state.dict.add(ins);
- state.dict.add(value);
- }
+
+ state.dict.add(value);
} else {
state.push(value);
}