PDA

View Full Version : grammer rules: keywords in middle of identifiers


jamesbaker
13-Aug-2008, 05:50 PM
I'm trying to make a file format for Ruby, cribbing off of the C/C++ definition. See the attached keyword.png for my problem: keywords are recognized not as words but as substrings. This happens regardless of the order of the Grammar rules.

As far as I can tell, this does NOT happen for the factory-defined file types - but I can't see any difference in how I'm defining my list of keywords or my identifier regex.

I played around with making every keyword in my list a regex, but that is obviously not the intent of this list interface.

Help?

Also: maybe bcpkg should be added to the list of allowed file attachments.

Erik
13-Aug-2008, 06:19 PM
Without seeing your grammar list, I'd guess you need to add an identifier definition. The regular expression [_a-z]\w* works for most languages. This item should come after your keyword item(s).

jamesbaker
14-Aug-2008, 11:10 AM
I of course had that.

I started over by cloning C++ and editing from there, and it worked as expected. Diffing the two, I noticed that the IsRegExp flag was somehow turned off on my Identifier grammar item in my first attempt.

So, not far off.

Thanks - where should I send my Ruby bcpkg when it's finished? There's no obvious submission on your file formats page.

Erik
18-Aug-2008, 08:07 AM
Thanks - where should I send my Ruby bcpkg when it's finished? There's no obvious submission on your file formats page.
You could attach it in a response to this message, or email it to us at:
support@scootersoftware.com

knut
04-Aug-2009, 03:51 PM
Did you ever receive the Ruby bcpkg? Is it avalaible?
(I found no ruby in http://www.scootersoftware.com/download.php?zz=kb_moreformats&cartid=234439106 )
Thank you