]> rethought.computer Git - sorel-lang.git/commitdiff
fix comments keep/ef6927232dce09d4d3616e136e72d2472f1a7e87
authorBryan English <bryan@rethought.computer>
Mon, 19 Jan 2026 20:14:01 +0000 (15:14 -0500)
committerBryan English <bryan@rethought.computer>
Tue, 10 Feb 2026 04:08:54 +0000 (04:08 +0000)
hylo-lang/hyloc/src/tokenizer.rs

index a489f157580d9a1263404fce4d11a236b795a5c8..ca4371b42859596c8849bbfd1911b205abf93c88 100644 (file)
@@ -77,7 +77,7 @@ pub fn tokenize<'a>(input: &'a str) -> Result<Vec<Token<'a>>> {
         }
         
         if in_comment {
-            if char == ')' || char == '\n' {
+            if char == ')' {
                 in_comment = false;
                 last_is_whitespace = true; // not really true, but means don't need space after
             }
@@ -144,4 +144,19 @@ mod tests {
 ");
         println!("result: {:?}", result);
     }
+
+    #[test]
+    fn comments() {
+        let result = tokenize("
+            (
+                foo
+                bar
+            )
+            : baz ( x y -- z )
+              chicken
+              soup
+            ;
+        ");
+        println!("result: {:?}", result);
+    }
 }