There is a lot of great information on this SO thread
I can grab the keywords from websites provided there, BUT I am asking is it possible to grab reserved keywords in real time ? Maybe there is some structure where they are stored?
For global objects in window, I can grab them with this:
for(var i in window) doSomethingWith(i)
But I also need all the language specific keywords like: if, case, switch, etc.
SORRY I didn't want to write "then". I was coding in Pascal in the last hour(remembering old times) and god damn it stuck into my head!
What I want to do: It may sound strange, however I am building an app where you can create elements, they have names, values, formulas and formulas are pure JS formulas, except I run a regular expression to modify variables a bit and want to leave the javascript syntax.
For example if formula is: if (a < b) { c = d; }
In this case I would like to modify only a, b, c and d.
If formula would be something like: switch(a) { case 0: a=b; break; case 1: b=c; ... }
In this case I would like to filter out "switch, break, case".
Well maybe I should delete this question