Skip to content

Use simple lexical analysis instead of regex #47

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

Closed
wants to merge 2 commits into from
Closed

Use simple lexical analysis instead of regex #47

wants to merge 2 commits into from

Conversation

rtsao
Copy link
Owner

@rtsao rtsao commented Jun 30, 2016

See: #39

This is a pretty significant refactor. Scoping is now based on tokenization, which based on early benchmarks, should speed things up significantly. Lexer is based on the lexer from https://github.com/brettstimmerman/mensch but modified to be faster and avoid doing work we don't need for CSJS

Remaining items:

  • Add back compositions
  • Pass test suite
  • Do benchmarking

This would also be an opportunity to do something like: #34 and #25

Sorry, something went wrong.

@neurosnap
Copy link
Contributor

Did you ever consider using postcss for scoping the CSS?

@rtsao
Copy link
Owner Author

rtsao commented Jul 1, 2016

Yes, originally I looked at postcss but it's a pretty heavy dependency. I wanted csjs to be really lightweight so when I realized I could do the basics with simple regex and replacement, I went with that approach.

The lexer in this PR is very optimized for the concerns of csjs so it should be faster than other more general parsing solutions that need to account for the entirety of CSS.

@rtsao
Copy link
Owner Author

rtsao commented Nov 26, 2016

Closing for now as this is isn't going to happen in the near term. This needs to be investigated further, though.

@rtsao rtsao closed this Nov 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants