]> gitweb.factorcode.org Git - factor.git/commitdiff
bare: more liberal union schema parsing.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 16 Jun 2022 00:27:08 +0000 (17:27 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 16 Jun 2022 00:27:08 +0000 (17:27 -0700)
extra/bare/bare.factor

index 9e6db39a39cc2abcae7928f40b96ca2a321a8b59..df4caf03bbdb61e49980d82eb67fc4796429394f 100644 (file)
@@ -217,7 +217,7 @@ struct    = "struct"~ ws "{"~ ws~ struct-fields ws "}"~
 
 union-members = union-member (ws "|"~ ws union-member)* => [[ first2 swap prefix ]]
 union-member  = any-type (ws "="~ ws number)? => [[ >array ]]
-union     = "union"~ ws "{"~ (ws|"|")~ ws union-members ws ("|"|ws)~ "}"~
+union     = "union"~ ws "{"~ ws ("|"?)~ ws union-members ws ("|"?)~ ws "}"~
           => [[ assign-values union boa ]]
 
 aggregate = optional|list|map|struct|union