Fix out-of-range error when parsing certain files.

An example file that breaks on this is https://github.com/ajaxorg/ace-builds/blob/b2f8bf1e745250596afea5b39c70b94421af906d/kitchen-sink/demo.js#L1000