Skip to content

v0.3.0

Compare
Choose a tag to compare
@carocad carocad released this 14 Oct 19:19
· 358 commits to master since this release
cce5f73

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
  • :macro-keyword
    • before [:macro-keyword "hello"]
    • now [:macro-keyword "::hello"]. Note the :: at the beginning
  • :string
    • before [:string "hello world"]
    • now [:string "\"hello world\""]. Note that \" is part of the content
  • :regex
    • before [:regex "hello-world"]
    • now [:regex "#\"hello world\""]. Note that #\" is part of the content
  • :whitespace
    • before [:whitespace ""]
    • now [:whitespace " \n"]. Note that whitespace now cannot be empty
  • :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
  • :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
  • :character
    • before [:character "u1234"]
    • now [:character "\u1234"]. Note that \ is part of the content

REMOVED

  • character, symbol, simple-keyword, macro-keyword, number, string and regex 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 of map
  • 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)

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 the map rule definition and focus on the namespace as a distinctive characteristic instead of an optional "attribute" of a map.