]> gitweb.factorcode.org Git - factor.git/blobdiff - unmaintained/peg-lexer/peg-lexer.factor
tools.test: Make the flag public. Finish porting tester changes to fuzzer.
[factor.git] / unmaintained / peg-lexer / peg-lexer.factor
index dcde55c91ada82f2a6c696b928ebb2d58549a219..7449b92604ed9a8bc123deee8a5c1f048978064d 100644 (file)
@@ -14,10 +14,10 @@ CONSULT: assoc-protocol lex-hash hash>> ;
            v CHAR: \n n last-index -1 or 1 + -
            n [ CHAR: \n = ] count 1 +
     ] ;
-      
+
 : store-pos ( v a -- )
-    input swap at prepare-pos
-    lexer get [ (>>line) ] keep (>>column) ;
+    input of prepare-pos
+    lexer get [ line<< ] keep column<< ;
 
 M: lex-hash set-at
     swap {
@@ -25,7 +25,7 @@ M: lex-hash set-at
         [ swap hash>> set-at ]
     } case ;
 
-:: at-pos ( t l c -- p ) t l head-slice [ length ] map sum l 1 - + c + ;
+:: at-pos ( t l c -- p ) t l head-slice [ length ] map-sum l 1 - + c + ;
 
 M: lex-hash at*
     swap {
@@ -52,8 +52,8 @@ M: lex-hash at*
     define-syntax word make-inline ;
     
 SYNTAX: ON-BNF:
-    CREATE-WORD reset-tokenizer ";ON-BNF" parse-multiline-string parse-ebnf
-    main swap at create-bnf ;
+    scan-new-word reset-tokenizer ";ON-BNF" parse-multiline-string parse-ebnf
+    main of create-bnf ;
 
 ! Tokenizer like standard factor lexer
 EBNF: factor