New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite the parser to be fully incremental #68
Commits on Jan 3, 2014
-
Add a regression test for a tinycss2 bug.
SimonSapin committedJan 3, 2014
Commits on Apr 21, 2014
-
Add more regression tests for tinycss2 bugs.
SimonSapin committedApr 21, 2014
Commits on Jul 21, 2014
-
Identifiers may now begin with "--".
See bullet point two of: http://dev.w3.org/csswg/css-syntax/#changes-CR-20140220
ezequiel committedJul 21, 2014 -
The semicolon token should not be respected.
See: http://dev.w3.org/csswg/css-syntax/#consume-a-declaration0 After consuming the colon token, it states the declaration's value is the consumption of every subsequent component value, until we reach an EOF token.
ezequiel committedJul 21, 2014
Commits on Aug 16, 2014
-
Merge pull request #3 from ezequiel/ident
Identifiers may now begin with "--".
SimonSapin committedAug 16, 2014 -
Merge pull request #4 from ezequiel/semicolon
The semicolon token should not be respected.
SimonSapin committedAug 16, 2014 -
Add some test cases for tinycss2 code coverage.
SimonSapin committedAug 16, 2014 -
`!` not followed by `important` is just another declaration value.
SimonSapin committedAug 16, 2014
Commits on Oct 6, 2014
-
Quoted URLs are now tokenized as functions.
rgrove committedOct 6, 2014
Commits on Oct 8, 2014
-
Make bad URL function tests more useful.
rgrove committedOct 8, 2014 -
Merge pull request #5 from rgrove/url-functions
Quoted URLs are now tokenized as functions
SimonSapin committedOct 8, 2014
Commits on Dec 23, 2014
-
Remove NUL handling from preprocessing.
SimonSapin committedDec 23, 2014 -
Disable line counting temporarily.
SimonSapin committedDec 23, 2014 -
Remove newline handling from preprocessing.
SimonSapin committedDec 23, 2014 -
Remove the tokenizer’s pre-processing step.
SimonSapin committedDec 23, 2014 -
Make the tokenizer borrow rather than own its input.
SimonSapin committedDec 23, 2014
Commits on Dec 28, 2014
-
Merge css-parsing-tests commit '86d34b729978df74bc91a66ce0e2951187a10…
…05c' into incremental
SimonSapin committedDec 28, 2014 -
SimonSapin committed
Dec 28, 2014 -
The tokenizer is now fully incremental, rather than yielding a block/function at a time. The convention is now to take `&mut Parser` as input for parsing, and only consume as necessary.
Commits on Dec 29, 2014
-
Use the `matches` crate rather than re-defining multiple copies of it.
SimonSapin committedDec 29, 2014 -
-
Remove the Tokenizer::length field.
Let’s assume that str::len() calls are optimized away.
SimonSapin committedDec 29, 2014 -
Encapsulate input/position access in tokenizer.
This would help taking input incrementally (rather than having a single `&str`) if we want to do that.
SimonSapin committedDec 29, 2014 -
Avoid "rewinding" the input in the tokenizer.
SimonSapin committedDec 29, 2014
Commits on Jan 5, 2015
-
Merge branch 'rustup_20141221' into incremental
Conflicts: Cargo.toml src/color.rs src/parser.rs src/serializer.rs src/tests.rs src/tokenizer.rs
SimonSapin committedJan 5, 2015 -
-
-
-
Don’t preserve the full string representation of numbers.
SimonSapin committedJan 5, 2015 -
Change all `String` fields in `Token` to `CowString`.
(Most values are still `Owned`, so we don’t take much advantage this yet.)
SimonSapin committedJan 5, 2015
Commits on Jan 6, 2015
-
Use `Cow::Borrowed` for the value of ident-like tokens without escape…
…s or NUL.
SimonSapin committedJan 6, 2015 -
Use `Cow::Borrowed` for the value of string-like tokens without escap…
…es or NUL.
SimonSapin committedJan 6, 2015 -
-
Make Parser.tokenizer not be an Option. Have a boolean field instead.
SimonSapin committedJan 6, 2015 -
Make Tokenizer::slice_from public.
SimonSapin committedJan 6, 2015 -
-
-
Rename TokenizerPosition to SourcePosition
SimonSapin committedJan 6, 2015 -
Add Parser::expect_url_or_string
SimonSapin committedJan 6, 2015 -
Allow parse_until_before to be reentrant
Previous revisions of it were not because they consumed the delimiter token.
SimonSapin committedJan 6, 2015 -
Add Parser::parse_comma_separated
SimonSapin committedJan 6, 2015
Commits on Jan 7, 2015
Commits on Jan 8, 2015
-
-
SimonSapin committed
Jan 8, 2015
Commits on Jan 9, 2015
Commits on Jan 13, 2015
-
Refactor parser.rs to simplify it and propably fix multiple bugs.
"Nested" or "delimited" parsers can now only be used in a closure given to the corresponding `Parser` method. This allows doing cleanup after calling the closure, rather than in a `Drop` implementation. This more local reasoning makes thing easier to understand and less likely to be buggy.
SimonSapin committedJan 13, 2015 -
Make Parser::new take a &str instead of &mut Tokenizer, and remove Pa…
…rser::parse_str.
SimonSapin committedJan 13, 2015 -
A cloned parser is "detatched" from its parent and will progress independently, but it keeps referencing the same input.
SimonSapin committedJan 13, 2015 -
Make source location methods take &self instead of &mut self. (Use a …
…std::cell::Cell.)
Commits on Jan 14, 2015
-
Reformat some code for readability.
SimonSapin committedJan 14, 2015
Commits on Jan 15, 2015
-
-
Remove ast.rs file left over from 41fa928.
Its content is now merged into tokenizer.rs.
SimonSapin committedJan 15, 2015
Commits on Jan 16, 2015
-
Internal refactor: have "nested" parsers not consume their end token.
This simplifies the code by having less special cases.
SimonSapin committedJan 16, 2015 -
Internal refactor: remove the Parser::exhausted boolean flag.
It wasn’t really necessary, and confusigly had a different meaning than Parser::is_exhausted().
SimonSapin committedJan 16, 2015 -
Internal refactor: remove consume_until_end_of_block’s return value.
SimonSapin committedJan 16, 2015 -
Internal refactor: merge parse_until_before_end_of into parse_until_b…
…efore.
SimonSapin committedJan 16, 2015 -
Internal refactor: rename Tokenizer::current_char to next_char.
SimonSapin committedJan 16, 2015 -
Remove peek/push_back/unexpect, add Parser::reset instead.
The new convention is that any parsing function returning `Err(())` may or may not have consumed any number of tokens from the input. Therefore, any the caller wishes to recover and try parsing something else, it should call `parser.reset(position)` where `position` is the result of `parser.position()` that was saved beforehand. The Parser::try helper does this for you by taking a closure returns Result, and resetting the position if the result is Err.
SimonSapin committedJan 16, 2015 -
Internal refactor: Rename Parser::parse_until_before to stop_before.
SimonSapin committedJan 16, 2015
Commits on Jan 19, 2015
-
Enable Parser::try’s return value to borrow the input (e.g. be a token)
SimonSapin committedJan 19, 2015 -
-
Internal refactor: make some code easier to understand.
SimonSapin committedJan 19, 2015 -
Commits on Jan 20, 2015
-
Emit a token for CSS comments.
SimonSapin committedJan 20, 2015 -
Keep in tokens the origin content of whitespace and comments.
It’s cheap, and could be useful for tools such as pre-processors.
Commits on Jan 21, 2015
-
Serialize negative zero with a minus sign.
SimonSapin committedJan 21, 2015 -
Serialize <unicode-range> with question marks when possible.
SimonSapin committedJan 21, 2015 -
Remove some unnecessary conversions.
SimonSapin committedJan 21, 2015 -
Remove serialization special cases now that comments are tokenized.
SimonSapin committedJan 21, 2015 -