Closed patrickhuber closed 6 years ago
Some Requirements:
Given Grammar:
RepeatingWord =
word RepeatingWord
| word ;
word ~ /[\w]+/ ;
whitespace ~ /[\s]+/;
start: RepeatingWord ;
trivia: whitespace ;
When Input
[space][space]aa[space]aa[space][space]
Then
first token leading trivia is [space][space]
first token following trivia is Empty
second token leading trivia is [space]
second token folliwing trivia is [space][space]
When Input
aa[space]aa
Then
first token leading trivia is null
first token following trivia is null
second token leading trivia is [space]
second token following trivia is null
When Input
aa[space][carriage return][line feed]aa[space]
Then
first token leading trivia is null
first token following trivia is [space][carriage return][line feed]
second token leading trivia is [space]
second token following trivia is [space]
When Input
aa[space][carriage return][line feed]aa[space][carriage return][line feed][carriage return][line feed]
Then
first token leading trivia is null
first token following trivia is [space][carriage return][line feed]
second token leading trivia is [space]
second token following trivia is [space][carriage return][line feed][carriage return][line feed]
@ArsenShnurkov please review the pull request #90 that implements trivia.
Text in the input that is not used in the parse but is important for refactoring tools is currently thrown away with ignore rules.