joshbtn / excelFormulaUtilitiesJS

Based on ewbi's go calc excel formula parser http://ewbi.blogs.com/develops/popular/excelformulaparsing.html. This library contains methods to beautify an excel formula. This library also contains functions to convert an excel formula to JavaScript (ECMAScript) or C# and python.
http://excelformulabeautifier.com/
Other
394 stars 101 forks source link

getTokens issue with escape charactors #76

Open aubrijesh opened 5 years ago

aubrijesh commented 5 years ago

Hi, I am unable to get correct no of tokens with escape when my string contains escape charector. eg :

var str = 'FOO "\"hello world\""';
var items = excelFormulaUtilities.getTokens(str).items

Its giving me five tokens. [{"value":"FOO","type":"operand","subtype":"range"},{"value":"","type":"operand","subtype":"text"},{"value":"hello","type":"operand","subtype":"range"},{"value":"world","type":"unknown","subtype":""},{"value":"","type":"operand","subtype":"text"}]

As you can see there is only two tokens "FOO" and "hello world";