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

Line continuation #16

Merged
merged 4 commits into from
Apr 22, 2018
Merged

Conversation

metatoaster
Copy link
Member

Refactored the token production so that the lineno/colno is more consistently applied for more correct token reporting, and also properly handle line continuation in strings so that they do not get prematurely mangled which again breaks tracking of positions. Naturally, implement a way that ensures the minified output remains unchanged (i.e. with the line continuation normalised).

@metatoaster metatoaster force-pushed the line_continuation branch 2 times, most recently from 3e5ee6c to d4f1917 Compare April 22, 2018 09:09
- Preparing for reuse in testing of other lexer classes.
- Define a standard function that will produce a token with those filled
  in.
- Implement line terminator sequence as per ECMA-262 specification.
- Also fix a very apparent bug in test case where the 'exc` string is on
  the next line but was reported to be part of the original line, one of
  various cases that will upset the line count.
- Also force unicode_literals on the es5 lexer module.
- Actually provide line continuation in strings that complies to the
  specification, which the fix provided by rspivak/slimit#24 was
  problematic (breaks position tracking) and incomplete as it amounted
  to no more than a clumsy workaround (come on, duplicated regex code).
- Also provide the expected minified output that would strip out these
  line continuation fragments.
@metatoaster metatoaster added this to the 1.1.0 milestone Apr 22, 2018
@metatoaster metatoaster merged commit 9755795 into calmjs:master Apr 22, 2018
@metatoaster metatoaster deleted the line_continuation branch April 22, 2018 10:21
@metatoaster metatoaster added the bug label Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant