]> code.bitgloo.com Git - bitgloo/alee-forth.git/commitdiff
disable compacted literals
authorClyne Sullivan <clyne@bitgloo.com>
Fri, 17 Nov 2023 22:14:36 +0000 (17:14 -0500)
committerClyne Sullivan <clyne@bitgloo.com>
Fri, 17 Nov 2023 22:14:36 +0000 (17:14 -0500)
libalee/parser.cpp

index 11aba381a0db076ce7592894dd8b4f9b9efd65d3..705fe6764ba19b43ca310f79d91d0086226fb88c 100644 (file)
@@ -124,17 +124,7 @@ LIBALEE_SECTION
 void Parser::processLiteral(State& state, Cell value)
 {
     if (state.compiling()) {
-        constexpr auto ins = CoreWords::token("_lit");
-
-        // Literal compression: opcodes between WordCount and Begin are unused,
-        // so we assign literals to them to save space. Opcode "WordCount"
-        // pushes zero to the stack, "WordCount + 1" pushes a one, etc.
-        const Cell maxlit = Dictionary::Begin - CoreWords::WordCount;
-        if (value >= 0 && value < maxlit)
-            value += CoreWords::WordCount;
-        else
-            state.dict.add(ins);
-
+        state.dict.add(CoreWords::token("_lit"));
         state.dict.add(value);
     } else {
         state.push(value);