Releases: carocad/parcera
v0.4.4
v0.4.2
v0.4.1
v0.4.0
BREAKING 💀
Parcera now uses Antlr4 as its parsing engine instead of Instaparse. 🚀
This drops the parsing time significantly. For comparison (on my machine) it took instaparse 3 seconds
to parse clojure.core file (~8k loc), with antlr this drops to 100 milliseconds
. Converting it to clojure persistent data structures adds some overhead but it is still way faster than instaparse in all cases that I tested.
Clojurescript support was dropped for the time being.
CHANGES
- all
-
in keywords were changed to_
to allow compatibility with antlr4 allowed characters:simple-keyword
->:simple_keyword
:macro-keyword
->:macro_keyword
:conditional-splicing
->:conditional_splicing
:namespaced-map
->:namespaced_map
:reader-macro
->:reader_macro
:metadata-entry
->:metadata_entry
:auto-resolve
->:auto_resolve
var-quote
->:var_quote
- keywords now dont include the
:
or::
as part of their content and follow Clojure's name syntax parcera/clojure
function was renamed toparcera/ast
for clarity on its purposeast
returns a lazy sequence instead of the eager implementation from Instaparse
- parcera now checks that maps, sets literals conform to Clojure syntax
v0.3.1
v0.3.0
BREAKING 💀
This release makes parcera
3 times faster 🚀
Most of these changes related to the advices in Instaparse performance notes. Unfortunately this lead to some breaking changes to make it work 😞. Sorry for the inconvenience.
CHANGES
:simple-keyword
- before
[:simple-keyword "hello/world"]
- now
[:simple-keyword ":hello/world"]
. Note the:
at the beginning
- before
:macro-keyword
- before
[:macro-keyword "hello"]
- now
[:macro-keyword "::hello"]
. Note the::
at the beginning
- before
:string
- before
[:string "hello world"]
- now
[:string "\"hello world\""]
. Note that\"
is part of the content
- before
:regex
- before
[:regex "hello-world"]
- now
[:regex "#\"hello world\""]
. Note that#\"
is part of the content
- before
:whitespace
- before
[:whitespace ""]
- now
[:whitespace " \n"]
. Note that whitespace now cannot be empty
- before
:function
- before
[:function [:list ... ]]
- now
[:function ... ]
. Note that now the content of the function is directly associated with the function not with the enclosing list
- before
:tag
now only matches for literal and collections:conditional
and:conditional-splicing
- before
[:conditional [:list ... ]]
- now
[:conditional ... ]
. Note that now the content of the conditional is directly associated with the macro not with the enclosing list
- before
:character
- before
[:character "u1234"]
- now
[:character "\u1234"]
. Note that\
is part of the content
- before
REMOVED
-
character
,symbol
,simple-keyword
,macro-keyword
,number
,string
andregex
are now defined outside of the grammar string as regexes. This is to increase reusability of those regexes. -
map-namespace
no longer exists- before
[:map [:map-namespace [:simple-keyword "hello"]] [:map-content ....]]
- now
[:map ...]
. Note the that the namespace is no longer part ofmap
- before
-
comment
rule was removed and included inside:whitespace
.- before
[:comment "hello world"]
- now
[:whitespace " ;hello world"]
. Note the;
in the middle and the whitespace (if any)
- before
ADDED
:namespaced-map
grammar rule.- before
[:map [:map-namespace [:simple-keyword "hello"]] [:map-content ... ]]
- now
[:namespaced-map [:simple-keyword ":hello"] [:map ... ]]
. This way we re-use themap
rule definition and focus on the namespace as a distinctive characteristic instead of an optional "attribute" of a map.
- before