-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// This example caused the moving of nodes for reductions to move a | ||
// node across a buffer position stored on the parser stack, causing a | ||
// node to fall out of its parent node. | ||
|
||
@skip { space | lineComment } | ||
@top Program { (GlobalConstantDeclaration ";")* } | ||
GlobalConstantDeclaration { | ||
AttributeList @specialize[@name='Keyword']<Identifier, 'const'> Identifier "=" | ||
} | ||
AttributeList { Attribute { "@" Identifier }* } | ||
@tokens { | ||
space { std.whitespace+ } | ||
lineComment { "//" ![\n\r]* $[\n\r]? } | ||
Identifier { $[a-zA-Z_] $[0-9a-zA-Z_]* } | ||
} | ||
|
||
# Doesn't produce corrupt trees | ||
|
||
// Comment | ||
|
||
// Comment Comment | ||
const ACES_INPUT = ; | ||
|
||
// Comment Comment Comment | ||
const ACES_OUTPUT = ; | ||
|
||
==> | ||
|
||
Program( | ||
GlobalConstantDeclaration(AttributeList,Keyword,Identifier), | ||
GlobalConstantDeclaration(AttributeList,Keyword,Identifier)) |