]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/xmode/loader/syntax/syntax.factor
xmode: fix handling of HASH_CHAR and always rules
[factor.git] / basis / xmode / loader / syntax / syntax.factor
index e626d230da3a8600ecb6520c88fba9c9be2cd791..a26fa6be716a838462187d4f802edec2f64bd01e 100644 (file)
@@ -65,11 +65,11 @@ SYNTAX: RULE:
 ! XXX: check HASH_CHAR for full prefix, not just first character
 
 : char<< ( value object -- )
 ! XXX: check HASH_CHAR for full prefix, not just first character
 
 : char<< ( value object -- )
-    [ ?first ] dip chars<< ;
+    '[ 1 head _ chars<< ] unless-empty ;
 
 : regexp-attr ( -- )
 
 : regexp-attr ( -- )
-    { "HASH_CHAR" f char<< } ,
-    { "HASH_CHARS" f chars<< } , ;
+    { "HASH_CHARS" f chars<< } ,
+    { "HASH_CHAR" f char<< } , ;
 
 : match-type-attr ( -- )
     { "MATCH_TYPE" string>match-type match-token<< } , ;
 
 : match-type-attr ( -- )
     { "MATCH_TYPE" string>match-type match-token<< } , ;