The baffling case of 0×1D and the mysterious syntax error
It all began not too many keystrokes ago, while porting some old code to ActionScript 2. After running the test, I got a syntax error pointing me to a closing brace. This was going to be easy -- I missed a brace somewhere. It happens! Child's play! Not so, it would appear... After some frantic "CTRL-M"ing in PrimalScript (match brace), I found that all the braces matched. Oh, oh!
Not to be deterred, the code was dutifully copied from the AS file to an empty FLA and stripped to the bare minimum that triggered the error, which left me with:
if ( true ) {}
What the..? Hmm, ok, so let's try some voodoo... hey, what do you know? Deleting the empty space after the second brace fixed the issue, so it was an invisible character messing things up. Using Hexmode in Primalscript revealed the culprit: right after the 0x7D character (right brace) was a sneaky little 0x1D character which I learned is a group separator left over from the days of teletypes.
I have no idea how it managed to sneek in there (me and and fat fingers, no doubt) but one thing is for sure: Flash chokes on it. So, the next time you get a weird error that reduces to something so simple that you know that it must work, take out your trusty hex editor and hunt for our sneeky little friend, 1D
Download the FLA (.zip; 5kb) and see for yourself (please note this is only recommended for those of you who are (A) True geeks, (B) have too much time on your hands or (C) keep exotic FLA collections -- in which case I would seriously urge you to reconsider whether or not you fit into group A. My goodness, I wonder which category I fall into with this post!
Oh yes, and happy holidays!
The The baffling case of 0×1D and the mysterious syntax error article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.

cherreman
Aral, I love the humour in your posts
Keep them coming!
Anyway, thx for the info. I’m sure it’ll save someone a couple of hours some day.
Merry X-mas!
December 24th, 2004 at 1:48 pmcedric
Hi aral!
I had the exact same compile error on my mac!!!
I found my mistake:
anyFunction () {
}
the ” means that this should normally be space (it is visually!), but sometimes, when typing too fast (anticipating the curly brace), I do a ‘option+space’, which leads to a compile error …
hth,
December 27th, 2004 at 7:00 amcedric
whoops sorry, I used tags in the previous example and this left out some chars:
anyFunction ()_{
}
the ‘_’ char should be a space, but when typing too fast, I sometimes do a ‘option+space’ which leads to another char .. hopefully it is the one you’re looking for … now why, oh why ?
December 27th, 2004 at 7:01 am