]> gitweb.factorcode.org Git - factor.git/commitdiff
syntax: allow anonymous MAIN:.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 21 May 2020 21:19:43 +0000 (14:19 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 21 May 2020 21:19:43 +0000 (14:19 -0700)
core/syntax/syntax.factor

index 06ec62fb8ccbd0b7bf6dc9c6c2de188764a09853..d6ce678e4d1231257c8c0d7f26644029d378da4c 100644 (file)
@@ -242,8 +242,10 @@ IN: bootstrap.syntax
     ] define-core-syntax
 
     "MAIN:" [
-        scan-word
-        dup ( -- ) check-stack-effect
+        scan-word dup \ [ = [
+            drop "( main )" <uninterned-word> dup
+            parse-quotation ( -- ) define-declared
+        ] when dup ( -- ) check-stack-effect
         [ current-vocab main<< ]
         [ current-source-file get [ main<< ] [ drop ] if* ] bi
     ] define-core-syntax