Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
refactor: rename "inline_comment" to "comment"
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Consumers should now expect a node of type "comment"
where before there was a node of type "inline_comment.
The specificity of "inline_comment" is unnecessary here as there is only one
type of comment in Lux
  • Loading branch information
fachammer committed Sep 29, 2019
1 parent 258b9a5 commit bf32031
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions corpus/comment/comment-inside-form.txt
Expand Up @@ -6,7 +6,7 @@ comment with closing parenthesis inside
)
---
(lux
(form (inline_comment)))
(form (comment)))

===
comment consumes whole line
Expand All @@ -15,4 +15,4 @@ comment consumes whole line
)
---
(lux
(form (inline_comment)))
(form (comment)))
2 changes: 1 addition & 1 deletion corpus/comment/inline-comments.txt
Expand Up @@ -7,4 +7,4 @@ Inline comments
---

(lux
(inline_comment))
(comment))
4 changes: 2 additions & 2 deletions corpus/comment/multiple-inline-comments.txt
Expand Up @@ -8,5 +8,5 @@ Multiple inline comments
---

(lux
(inline_comment)
(inline_comment))
(comment)
(comment))
2 changes: 1 addition & 1 deletion corpus/form/form-of-forms.txt
Expand Up @@ -30,7 +30,7 @@ nested forms of forms
(identifier) (identifier) (text))
(tuple
(tag) (nat) (rev))
(inline_comment)
(comment)
(record
(record_pair
(int)
Expand Down
8 changes: 4 additions & 4 deletions corpus/record/comment-inside-record.txt
Expand Up @@ -4,7 +4,7 @@ comment inside empty record
{## comment
}
---
(lux (record (inline_comment)))
(lux (record (comment)))

===
comment before record pairs
Expand All @@ -15,7 +15,7 @@ comment before record pairs
---
(lux
(record
(inline_comment)
(comment)
(record_pair (tag) (identifier))))

===
Expand All @@ -26,7 +26,7 @@ comment inside pair
---
(lux
(record
(record_pair (tag) (inline_comment) (tag))))
(record_pair (tag) (comment) (tag))))

===
comment between pairs
Expand All @@ -39,5 +39,5 @@ comment between pairs
(lux
(record
(record_pair (tag) (tag))
(inline_comment)
(comment)
(record_pair (tag) (tag))))
4 changes: 2 additions & 2 deletions grammar.js
Expand Up @@ -97,10 +97,10 @@ module.exports = grammar({
record_pair: $ =>
seq($._expression, repeat1($._white_space), $._expression),

_white_space: $ => choice($._end_line, /\s/, $.inline_comment),
_white_space: $ => choice($._end_line, /\s/, $.comment),
_end_line: _ => /[\r\n]|\r\n/,

inline_comment: _ => /##.*/,
comment: _ => /##.*/,

__enclosed: $ => choice($.text, $.form, $.tuple, $.record),
__non_enclosed: $ =>
Expand Down

0 comments on commit bf32031

Please sign in to comment.