Releases: tdewolff/parse
Releases · tdewolff/parse
v2.5.1
- JS: allow parsing
in
parameters in group expressions (that couldn't have been an arrow function) - JS: store all comments in the head of the document (for license comments)
- JS: fix parsing identifiers in arrow functions, it used to assume they were part of the parameter list causing nil errors
v2.5.0
- Add JS (ECMAScript 2020) lexer and parser.
- Add
parse.Input
and use that instead ofio.Reader
for input to lexers. - Use predefined byte-slices instead of inline ones.
For users, there is a slight breakage of function signatures in this release: instead of calling for example p := css.NewParser(r, false)
you should call
input := parse.NewInput(r)
defer input.Restore()
p := css.NewParser(input, false)
or if the byte-slice behind r
is not used anywhere else (which is generally the case), then you could just call
p := css.NewParser(parse.NewInput(r), false)
This is for all lexers/parsers.
v2.4.4
v2.4.3
- CSS: fix slow execution of selector with many errors
- Fix panic on MediaType that ends in a space
- Fix parsing
+
or-
as integers, and don't parse the exponent if there is no number - Fix parsing
e
as a float - Moving hash tables/entities maps to
minify
repository - JS: improved performance
v2.4.2
v2.4.1
v2.4.0
- XML and HTML:
Text() []byte
returnsnil
for start tag closers - XML and HTML:
Text() []byte
returns textual content forTextToken
,CommentToken
, ... - Added
Offset() int
for all lexers and parsers that returns the current character offset in the input stream - CSS: EOF after
\
now properly handled asDelimToken
and notEscapeToken
in some cases
v2.3.15
v2.3.14
- Re-parse input immediately when encountering parse error. Previously this was only done if the error was actually read which would save us from re-parsing the file (i.e. better performance). However, an error is (a) rare and (b) happens only once per file. Re-parsing on errors does not impact the performance of well formatted files, and a reliable error message is valued more.
- Bugfix: prevent infinite loop on error on input file that contains unicode code points (i.e. any character bigger than
0xC0
usually followed by more bytes). - Improve error messages for parsers to include parser name and print offending byte(s)
v2.3.13
- Improve performance of
ReplaceMultipleWhitespace
by 20%--25% - Add
ReplaceEntities
andReplaceMultipleWhitespaceAndEntities
to replaceQuoteEntity
. These allow to do replacements such as:" => "
," => "
," => "
,’ => ’
,' => '
. - Update list of HTML entity rewrites