[metaas-dev] No viable alternative error
David Holroyd
dave at badgers-in-foil.co.uk
Mon Feb 19 16:35:31 UTC 2007
On Mon, Feb 19, 2007 at 04:57:52PM +0100, Martin Schnabel wrote:
> David Holroyd schrieb:
> >On Sun, Feb 18, 2007 at 11:51:38PM +0100, kiroukou wrote:
> >>Even if in french we are using some special characters, I think it
> >>is better for metass to not support them. Except if it does ot affect
> >>performance in any way.
> >
> >If the ActionScript language spec says the characters are allowed, then
> >metaas should really be supporting them :)
>
> i could not found anything in the as3 spec but
> you can check the old spec at 7.6 Identifiers.
> http://www.mozilla.org/js/language/E262-3.pdf
> i saw some of the ecma 4 drafts referencing that chapter.
> it says unicode letters and unicode escapes are allowed in identifiers,
> but i couldn't find the exact unicode ranges to use.
So, that PDF references the Unicode 3 standard, Section 5.16, and
downloading the relevent PDF from unicode.org suggests that:
Given IDENT defined as 'IDENT_START IDENT_PART*'...
- IDENT_START
be composed of the unicode 'uppercase letter', 'lowercase letter',
'titlecase letter', 'modifier letter', 'other letter' and 'letter
number' categories
- IDENT_PART be composed of the above categories, plus the catagories
'nonspacing mark', 'spacing combining mark', 'decimal number',
'connector punctuation' and 'formatting code'
So then the problem becomes working out which characters are actually in
each of those categories.
Maybe there's a way to get ICU to generate unicode ranges for each...
Poking around in the JavaDoc, it seems to define some promising looking
constants, at least:
http://icu.sourceforge.net/apiref/icu4j/com/ibm/icu/lang/UCharacterEnums.ECharacterCategory.html
> terence parr used the unicode ranges from the java 1.5 spec here
> http://www.antlr.org/grammar/1152141644268/java.g.
> maybe they are similar ?
Yes, that might be a simple way to do a better job than we currently do.
thanks for the spec pointer!
dave
--
http://david.holroyd.me.uk/
More information about the metaas-dev
mailing list