Javascript Tokeniser

I’m looking for a Javascript Tokeniser, it seems to be missing in JUCE. We have a JavascriptEngine but no tokeniser for it. Oddly enough i found a LUA tokeniser in the JUCE repository but LUA isn’t actually supported as scripting language right?

I could use the CPlusPlusCodeTokeniser of course as a starting point but i actually expected to be part of the CodeBase. A
Anyone made a Javascript tokeniser i could use?

Funnily enough I was looking for the same thing recently! Would be cool to have a JSON tokeniser as well. Both would be really fitting with what JUCE offers.

I’ve tweaked the Lua and C++ tokenizers and I’ve came to this. Please let me know if you’d change anything.

https://github.com/pckerneis/JsTokeniser

2 Likes

@pckerneis, i also took the C++ tokeniser as base and came up with more or less the same as you did. I did add the root methods of the JavaScriptEngine as well, so methods like. exec, eval, trace, charToInt, parseInt, typeof and parsefloat.

2 Likes

Hey @pckerneis, do you mind if I use this? You don’t have any license on your repo…

Yeah sorry, of course feel free to use or modify it.

Your name will remain on the source code. Much appreicated :wink:

It does now and it’s GPL3.0, which may or may not be a problem for you.

Not a problem.