Skip to content
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

Add Lexer#with and Lexer.lookup_fancy #1565

Merged
merged 4 commits into from Sep 26, 2020

Conversation

jneen
Copy link
Member

@jneen jneen commented Jul 21, 2020

Rebase of #1188.

These are necessary for modifying the options of a lexer. Currently Lexer.find_fancy is a giant monolith, and there is no way to modify or default the lexer that is returned. Lexer#with allows for modifying the options after initialization, and Lexer.lookup_fancy, which returns the lexer class and an options hash, allows for directly manipulating the options before initialization.

@jneen
Copy link
Member Author

jneen commented Jul 21, 2020

This is fully backwards-compatible, so it should not be necessary to wait for 4.0 unless it's imminent (which maybe it should be...?)

http://jneen.net/ added 2 commits July 21, 2020 00:43
These are overridden by any options set in the query parameters.
@pyrmont pyrmont self-assigned this Jul 23, 2020
@pyrmont pyrmont added the needs-review The PR needs to be reviewed label Jul 23, 2020
@jneen
Copy link
Member Author

jneen commented Sep 26, 2020

This one is still ready to go I think. I'm going to merge it if there aren't any objections.

@jneen jneen merged commit 82f3fcd into master Sep 26, 2020
@pyrmont pyrmont removed the needs-review The PR needs to be reviewed label Sep 26, 2020
mattt pushed a commit to NSHipster/rouge that referenced this pull request May 19, 2021
* add Lexer#with, for specifying options after initialization

* split out Lexer.lookup_fancy from Lexer.find_fancy

* rename additional_options -> default_options

These are overridden by any options set in the query parameters.

* provide a comment for Lexer#with

Co-authored-by: http://jneen.net/ <jneen@jneen.net>
@tancnle tancnle deleted the feature.lexer-with-and-lookup-fancy branch September 22, 2021 12:25
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