]> gitweb.factorcode.org Git - factor.git/commitdiff
toml: faster using PEG: syntax for parse-toml
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 6 Dec 2022 21:43:02 +0000 (13:43 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 6 Dec 2022 21:43:02 +0000 (13:43 -0800)
basis/toml/toml.factor

index cfd8f41901fbe5e03c63c5b0d6b72a4d26fc750b..7ab011ff5593c90c10f3cc67f51c361258e31f97 100644 (file)
@@ -291,7 +291,9 @@ M: table update-toml
     [ entries>> [ H{ } clone ] dip [ update-toml ] each swap rot ]
     [ array?>> [ push-at ] [ check-no-key set-at ] if ] tri ;
 
+PEG: parse-toml ( string -- ast ) toml-parser ;
+
 PRIVATE>
 
 : toml> ( string -- assoc )
-    [ H{ } clone ] dip toml-parser parse [ update-toml ] each ;
+    [ H{ } clone ] dip parse-toml [ update-toml ] each ;