Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

GeoffreyBooth
Copy link
Collaborator

#5045 had various improvements to comments and the lexer that were unrelated to that PR’s goal of passing extra token data through the parser. This PR wraps up those unrelated improvements.

@helixbass @zdenko

Copy link
Collaborator

@helixbass helixbass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Same as `token`, except this just returns the token without adding it
# to the results.
makeToken: (tag, value, offsetInChunk = 0, length = value.length) ->
makeToken: (tag, value, offsetInChunk = 0, length = value.length, origin) ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GeoffreyBooth ah I see ya once this is merged I can merge into preserve-string-literal and convert to an option arg that gets passed along by token()

# and therefore matching `tokenHash`es, merge the comments from both/all
# tokens together into one array, even if there are duplicate comments;
# they will get sorted out later.
if tokenData[tokenHash].comments?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GeoffreyBooth I know this is just basically moving existing code, but a way I like to write this pattern is:

(tokenData[tokenHash].comments ?= []).push token.comments...

@GeoffreyBooth GeoffreyBooth merged commit 7cf739e into jashkenas:master May 13, 2018
@GeoffreyBooth GeoffreyBooth deleted the lexer-data-unrelated-improvements branch May 13, 2018 23:58
@GeoffreyBooth
Copy link
Collaborator Author

Thanks @helixbass I made the change you recommended.

@GeoffreyBooth GeoffreyBooth mentioned this pull request May 20, 2018
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.