Grammar symbol definition?


#1

Can someone who has worked with grammars tell me how to find the regex or character list that defines a symbol like a variable name? I’m working on a new autocomplete package and I need to parse symbols to go in the suggestion list. I’m looking at the grammar object returned from editor.getGrammar() and it is gigantic and confusing to me.

For example in javascript it would be the characters [a-zA-Z_$].


#2

Do you mean you want to retrieve it from the code or a pointer to the source is fine?


#3

Maybe you can open the file, wait for Atom to syntax-highlight it, then go through it and find pieces with the right kind of syntax. Err, scope. I think the name is scope. The it wouldn’t matter if the grammar asked the Oracle of Delphi, you could still benefit.