diff options
author | kpdecker <kpdecker@gmail.com> | 2015-06-26 14:30:34 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2015-06-26 16:58:34 -0500 |
commit | 93faffa549166c492267cc96d3e6848923760d90 (patch) | |
tree | 77233e09591a29459e42f7b6b34de6791404f973 /src | |
parent | d2fb3a49062d4914007152b9fcd55369d978c497 (diff) | |
download | handlebars.js-93faffa549166c492267cc96d3e6848923760d90.zip handlebars.js-93faffa549166c492267cc96d3e6848923760d90.tar.gz handlebars.js-93faffa549166c492267cc96d3e6848923760d90.tar.bz2 |
Fix location information for programs
There appears to be a bug in our use of jison causing the parent location information to be reported to programs. I wasn’t able to work through what might be causing this so instead using the location information of the statements collection to generate the proper location information.
This is a bit of a hack but we are very far behind on the Jison release train and upgrading will likely be a less than pleasant task that doesn’t provide us much benefit.
Fixes #1024
Diffstat (limited to 'src')
-rw-r--r-- | src/handlebars.yy | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/handlebars.yy b/src/handlebars.yy index d67a7da..2424e27 100644 --- a/src/handlebars.yy +++ b/src/handlebars.yy @@ -9,7 +9,7 @@ root ; program - : statement* -> new yy.Program($1, null, {}, yy.locInfo(@$)) + : statement* -> yy.prepareProgram($1) ; statement @@ -57,7 +57,7 @@ inverseAndProgram inverseChain : openInverseChain program inverseChain? { var inverse = yy.prepareBlock($1, $2, $3, $3, false, @$), - program = new yy.Program([inverse], null, {}, yy.locInfo(@$)); + program = yy.prepareProgram([inverse], $2.loc); program.chained = true; $$ = { strip: $1.strip, program: program, chain: true }; |