Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334259 - [NodeModel] leading whitespace in enum-literal's text
Summary: [NodeModel] leading whitespace in enum-literal's text
Status: CLOSED WORKSFORME
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-13 09:13 EST by Moritz Eysholdt CLA
Modified: 2011-01-13 09:27 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.