]> rethought.computer Git - sorel-lang.git/commitdiff
fix imports and exports keep/43abaa22299b7b1730c1d56312410d1bca7318aa
authorBryan English <bryan@rethought.computer>
Sat, 31 Jan 2026 03:52:58 +0000 (22:52 -0500)
committerBryan English <bryan@rethought.computer>
Tue, 10 Feb 2026 04:08:54 +0000 (04:08 +0000)
rel-lang/relc/src/parser.rs

index a5a95eeaee0b500b17586ccb7d5689de7b7b0584..32141395c6805919946fe30ab79b31f5d7fdf385 100644 (file)
@@ -67,6 +67,7 @@ impl<'a> Module<'a> {
                         } else {
                             if last_was_export {
                                 exports.push(word);
+                                last_was_export = false;
                             } else {
                                 main.push(token.clone());
                             }
@@ -75,6 +76,7 @@ impl<'a> Module<'a> {
                     Token::String(string) => {
                         if last_was_import {
                             imports.push(string);
+                            last_was_import = false;
                         } else {
                             main.push(token.clone());
                         }
@@ -96,7 +98,7 @@ impl<'a> Module<'a> {
                 instructions: main,
             });
         }
-
+        
         Ok(Module { words: result, imports, exports })
     }