Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342295 - [templates] Template variable names can only contain ASCII characters
Summary: [templates] Template variable names can only contain ASCII characters
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P1 minor (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-08 10:11 EDT by Markus Keller CLA
Modified: 2011-04-26 10:58 EDT (History)
1 user (show)

See Also:


Attachments
Fix (4.40 KB, patch)
2011-04-08 10:11 EDT, Markus Keller CLA
no flags Details | Diff
Fix 2 (3.32 KB, patch)
2011-04-11 08:53 EDT, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-04-08 10:11:44 EDT
Created attachment 192836 [details]
Fix

HEAD

Template variable names can only contain ASCII characters. Templates like this one are rejected:

System.out.println(${blöd:var} + " with element type " + ${hä:elemType(blöd)});

The patch allows all Java identifiers as names.

I made a pass over my workspace to find similar problems as bug 341977, and that's the only other bad place I found.
Comment 1 Markus Keller CLA 2011-04-08 10:44:05 EDT
Fixed in HEAD.
Comment 2 Dani Megert CLA 2011-04-11 04:03:17 EDT
1. start Eclipse
2. start to use/load the templates
==> tons of exceptions and many templates disabled  :-(

For bg see also bug 21926.
Comment 3 Markus Keller CLA 2011-04-11 08:53:18 EDT
Created attachment 192927 [details]
Fix 2

(In reply to comment #2)
> ==> tons of exceptions and many templates disabled  :-(

The problem is that the EBNF in TemplateTranslator was not honest. It didn't define 'identifier', and the implementation accepted \w++. To support existing clients, Fix 2 allows numbers at the start of an 'identifier' again and adjusts the grammar to reality.


> For bg see also bug 21926.

That bug is about template names. This bug only deals with the template pattern.
Comment 4 Markus Keller CLA 2011-04-11 08:53:36 EDT
Fixed in HEAD.
Comment 5 Dani Megert CLA 2011-04-26 10:58:00 EDT
Verified in I20110425-1800. Also verified that exported templates which contain non-ASCII variables are silently ignored when imported into 3.6.x.