]> gitweb.factorcode.org Git - factor.git/commitdiff
peg.ebnf: use with-words.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 15 Dec 2020 03:18:20 +0000 (19:18 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 15 Dec 2020 03:18:20 +0000 (19:18 -0800)
basis/peg/ebnf/ebnf.factor

index 1061cfaac7e3727ade3fd6d4514144472ab9ba40..c83dbfe64e0292e845e5e4622438f26a13343101 100644 (file)
@@ -474,14 +474,10 @@ ERROR: bad-effect quot effect ;
     [ parser>> (transform) ]
     [ code>> insert-escapes ]
     [ parser>> ] tri build-locals
-    ! Add words we need for build-locals, then remove them
-    ! so we don't pollute the manifest qualified-vocabs
-    ! and also so restarts don't add multiple times
-    qualified-vocabs length
-    "kernel" { "dup" "nip" "over" } add-words-from
-    "sequences" { "nth" } add-words-from
-    [ string-lines parse-lines ] dip
-    dup 2 + qualified-vocabs delete-slice ;
+    H{
+        { "dup" dup } { "nip" nip } { "over" over } ! kernel
+        { "nth" nth } ! sequences
+    } [ string-lines parse-lines ] with-words ;
 
 M: ebnf-action (transform)
     ebnf-transform check-action-effect action ;