Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using an attribute with a hypen, followed by a alphanum character throws Antlr4.StringTemplate.Compiler.TemplateException #94

Closed
frederik256 opened this issue Dec 21, 2014 · 3 comments · Fixed by #153
Assignees
Milestone

Comments

@frederik256
Copy link

The following throws Antlr4.StringTemplate.Compiler.TemplateException

new Template("{A-1}.Something", '{', '}');

The following does not:

new Template("{A-}.Something", '{', '}');

Ideally I'd like to use GUIDs, including those starting with numbers as an attribute but that may need a language spec change.

This is using "Antlr4.StringTemplate" C# package from nuget, version=4.0.6.9004 (running on Windows)

@parrt
Copy link
Member

parrt commented Jan 2, 2015

Hi. {A-1} isn't a valid template expression is it? If you just want text then just use the string "A-1".

@sharwell
Copy link
Member

sharwell commented Jan 2, 2015

@parrt The ID rule in Group.g supports hyphens, but the mID() method in STLexer.java does not match the same syntax. This means it is possible to declare a template parameter which cannot be referenced by name within an expression.

@parrt parrt added the type:bug label Jan 3, 2015
@parrt
Copy link
Member

parrt commented Jan 3, 2015

ah! right. sounds familiar. thanks, Sam.

@sharwell sharwell added this to the 4.0.9 milestone Jul 17, 2016
@sharwell sharwell self-assigned this Jul 17, 2016
sharwell added a commit to sharwell/stringtemplate4 that referenced this issue Jul 17, 2016
@parrt parrt closed this as completed in #153 Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants