From d55b6dee4ae8b74986b36e02196d68560e191cf1 Mon Sep 17 00:00:00 2001
From: Marijn Haverbeke
Date: Fri, 17 Jan 2014 10:09:15 +0100
Subject: [PATCH] Update lastEnd in tokenizer interface
The hack for parsing --> depends on it.
Closes #84
---
acorn.js | 1 +
index.html | 1 +
2 files changed, 2 insertions(+)
diff --git a/acorn.js b/acorn.js
index bbd32cfcea..c335f650e0 100644
--- a/acorn.js
+++ b/acorn.js
@@ -142,6 +142,7 @@
var t = {};
function getToken(forceRegexp) {
+ lastEnd = tokEnd;
readToken(forceRegexp);
t.start = tokStart; t.end = tokEnd;
t.startLoc = tokStartLoc; t.endLoc = tokEndLoc;
diff --git a/index.html b/index.html
index c1df00bd45..7d7e579cab 100644
--- a/index.html
+++ b/index.html
@@ -96,6 +96,7 @@ reset the internal state, and invalidate existing tokenizers.
var t = {};
function getToken(forceRegexp) {
+ lastEnd = tokEnd;
readToken(forceRegexp);
t.start = tokStart; t.end = tokEnd;
t.startLoc = tokStartLoc; t.endLoc = tokEndLoc;