-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Cleanup Css_lexer from #372 #444
Conversation
…s. Added a few test cases, refactored lexer_renderer and moved parse and to_string inside Css_lexer
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
New nightly version has been published to the NPM registry: @davesnx/[email protected]. |
@@ -5,6 +5,8 @@ module Types = Css_types; | |||
module Parser = Css_parser; | |||
module Location = Ppxlib.Location; | |||
|
|||
let (let.ok) = Result.bind; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not define it near its call site?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we use it in a few places, it's almost everywhere.
|> String.concat(" ") | ||
|> String.trim; | ||
|
||
let to_debug = tokens => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be defined near its call site since it has one (call site) so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in the interface of the lexer
); | ||
}; | ||
|
||
let to_string = tokens => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be defined in the file it is called in until there is a need to have it here.
pos.Lexing.pos_cnum - pos.Lexing.pos_bol, | ||
); | ||
|
||
let debug_token = ((token, loc_start, loc_end)) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instance of #444 (comment)
There were a few cleanups left after #372 to keep working towards #432
Css_lexer.parse
, moved that inside the lexer.