pvdz / tenko

An 100% spec compliant ES2021 JavaScript parser written in JS

Home Page:https://pvdz.github.io/tenko/repl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tokens format not compatible with Esprima and other parsers

coderaiser opened this issue · comments

esprima and babel, estree, acorn has tokens format that has loc field:

{
    "loc": {
        "start": {
            "line": 8,
            "column": 4
         },
         "end": {
             "line": 8,
             "column": 8
         }
    }
} 

Would be great if tenko also has it because recast uses esprima if it can't find tokens field, but it works great for parsers mentioned earlier.

So compatible tokens field is crucial to avoid double parsing.

So the tokens get the locs? Sure that can be done.

I will make it optional as it adds a tax to the GC while the parser doesn't use or need it.

Sorry for the delay, but here you go :)

Don't you forget to rebuild tenko.prod.js? Just updated, flag doesn't works for me.