/*! * sqlite-parser - v1.0.1 * @copyright 2015-2017 Code School (http://codeschool.com) * @author Nick Wronski */ 'use strict';Object.defineProperty(exports,"__esModule",{value:true});function findLastIndex(arr,func){for(var i=arr.length-1;i>=0;i-=1){if(func(arr[i])){return i;}}return-1;}function takeWhile(arr,func){var len=arr.length;var i=0;for(;i1){return false;}if(!deep){if(elem.indentation>bestNode.indentation){bestNode=elem;}else{deep=true;}}else if(/^(stmt)$/i.test(elem.rule)){deep=true;return true;}return true;});if(chain.length){location=bestNode.location;firstNode=chain.find(function(elem){return that.firstNodeRule.test(elem.description)&&elem.description!==bestNode.description&&elem.indentation!==bestNode.indentation;});if(firstNode!=null){if(this.statementRule.test(bestNode.description)&&this.statementRule.test(firstNode.description)){chainDetail=firstNode.description;}else{chainDetail=bestNode.description+' ('+firstNode.description+')';}}else{chainDetail=bestNode.description;}message='Syntax error found near '+chainDetail;Object.assign(err,{'message':message,'location':location});}return err;};return Tracer;}();