-
Notifications
You must be signed in to change notification settings - Fork 28
Update to Syntax 0.6 #69
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…implementation removed in ast.js, but left functional in this commit.
fd10b56
to
26fe543
Compare
26fe543
to
fe11a32
Compare
Port of projectfluent/fluent.js#255 Move the message.span.start logic from the wrapper to the point where the comment is hooked up to the message. As the message already has the span when it gets there, the wrapper refuses to do it again.
This reverts commit 8f960ae.
Port of projectfluent/fluent.js#257. Comments' content includes the terminal line break and the span should reflect it. The end span should be the offset of the beginning of the next line following the Comment, not the offset of the Comment's terminal line break. This also means that we can remvoe the special case in skipBlankLines. The meaning changes slightly: skipBlankLines now return the number of all line breaks skipped, regardless of whether they belonged to fully-blank lines or not. This is OK for our use-case, however.
Port of projectfluent/fluent.js#258 This is similar to the change made to Comments except here it doesn't affect the values, just the spans. The EBNF defines Message and Term as: Message ::= Comment? Identifier inline_space? "=" inline_space? ((Pattern Attribute*) | (Attribute+)) line_end Term ::= Comment? TermIdentifier inline_space? "=" inline_space? Value Attribute* line_end
Port of projectfluent/fluent.js#259 Revert earlier changes which added the trailing newline to the spans of the Message, Term and Comment, as well as to the content of Comments. The trailing line break should not be part of the span nor the content. Make Junk subclass SyntaxNode directly, rather than Entry. Entry is now an abstract class for useful AST nodes carrying content: Messages, Terms and Comments. Remove the annotations field from Entry togather with the add_annotation method and move it directly onto Junk.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on projectfluent/fluent.js#253.