I’m trying to parse a piece of code that is an array of 264 strings with each string on a different line thus:
[ 'String 1', 'String 2', ..... 'String 264' ]
For some reason my parser is recording errors from line 258 onwards even though the codes is fine. When I added some trace lines to the tokenize and getInitialState methods I see the following;
2 calls to getInitialState
11 sets of calls to tokenize for lines 0 - 10 (3 calls per line which I expect)
Another call to getInitialState
A call to tokenize the last line (line 263)
A series of calls to tokenize the lines from 11-263
2 more calls to getInitialState
A series of calls to tokenize lines 0 - 98
A call to getInitialState
A series of calls to tokenize lines 258 - 263.
The call to getInitialState before jumping to lines 258 - 263 seems to be what is causing all the errors to appear from line 258 onwards.
Can anyone suggest why the tokenizer is jumping around like this.
For context, this is in a React application and I am simply opening the window to display the a form which contains a codemirror instance.
Any suggestions gratefully received as I’m stuck at this point.