Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334259

Summary: [NodeModel] leading whitespace in enum-literal's text
Product: [Modeling] TMF Reporter: Moritz Eysholdt <moritz.eysholdt>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Moritz Eysholdt CLA 2011-01-13 09:13:29 EST
when parsing
----
#13 kw1
----

using the grammar
----
Model: foo=SingleEnum;
SingleEnum: "#13" val=(DefEnum1 | DefEnum2 | DefEnum3);
enum DefEnum1 returns DefEnum: kw1;
enum DefEnum2 returns DefEnum: kw2;
enum DefEnum3 returns DefEnum: kw3;
----

node.getText() returns " kw1" for the enum literal. I would expect the leading whitespace to be a separate hidden LeafNode.
Comment 1 Sebastian Zarnekow CLA 2011-01-13 09:15:13 EST
Where do you get the "node" from? I'd assume it has children?
Comment 2 Moritz Eysholdt CLA 2011-01-13 09:27:42 EST
you are right, it has children. my bad.