Bug 424260 - Remove the remaining @Ignores on BuiltinTemplatesTest
Summary: Remove the remaining @Ignores on BuiltinTemplatesTest
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Recommenders.incubator (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Stefan Prisca CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2013-12-17 13:12 EST by Stefan Prisca CLA
Modified: 2019-07-24 14:36 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Prisca CLA 2013-12-17 13:12:50 EST
The template syntax problems that need to be solved are the following:

(1) ${var} -> use the "var" word without necessarily having the following form "${ID:var}"

(2) ${type:link(String,int)} -> the problem here is the word "int". Types need to be used as proposals as well (for the moment the 'Proposal' rule only allows QualifiedNames and JavaLiterals)

(3) allow the use of annotations.

@Johannes: There are 2 ignored tests ("nls.cSnip" and "fall-through.cSnip") marked with "Comments are ignored by the parser for now". Can you please explain what is the issue here? For me comments are marked as in java. Thank you!
Comment 1 Andreas Sewe CLA 2013-12-17 15:59:41 EST
Hi Stefan,

(In reply to Stefan Prisca from comment #0)
> @Johannes: There are 2 ignored tests ("nls.cSnip" and "fall-through.cSnip")
> marked with "Comments are ignored by the parser for now". Can you please
> explain what is the issue here? For me comments are marked as in java. Thank
> you!

I put in this comment when I created (and @Ignored) the tests. The issue is that the Xtext default lexer/tokenizer (not the parser, as the comment states) already throws away anything after a "//" and between "/*" and "*/". This means that the parser, who receives its input token stream from the lexer never sees the special $-constructs within in the comments. So, naturally, we cannot offer any syntax highlighting or (more importantly) code completion in comments with the current "throw away comments prior to parsing" strategy.

Does this explain things?
Comment 2 Stefan Prisca CLA 2013-12-18 03:34:51 EST
(In reply to Andreas Sewe from comment #1)

Hi Andreas,

Thanks for clarifying that out! 
I understand now. I'll have to look into it, but AFAIK the comment terminals are defined in the XText.terminals grammar, the one that we use to build our grammar. Maybe re-writing our own terminals for comments would change something?(It's just an idea, it most probably won't work).
Comment 3 Andreas Sewe CLA 2013-12-19 12:24:13 EST
Well, our parent Terminals grammar doesn't define terrible many items, so copy & paste doesn't sound too bad. That being said, maybe a sub-grammar can redefine tokens or what is treated as a comment.