This commit is contained in:
HSunboy
2018-09-03 15:44:45 +08:00
parent 05c5b87d04
commit 34af804abb
4 changed files with 40 additions and 12 deletions

10
jison/comment.txt Normal file
View File

@ -0,0 +1,10 @@
ColumnIdentifier
UnsignedValueSpecification #各种非负数字和普通字符串常量bool值
UnsignedLiteral #各种非负数字和普通字符串常量bool值
ExactNumericLiteral #非负数字和小数
ApproximateNumericLiteral #带有E的非负数字
GeneralLiteral #普通字符串常量/bool值
RegularIdentifier #常规标识符
RegularOrBacktickedIdentifier #标识符
NonReservedKeyword #非保留关键字
ColumnIdentifier #标识符和各种对象数组写法

View File

@ -2412,14 +2412,16 @@ NonParenthesizedValueExpressionPrimary
{
// We need to handle arbitrary UDFs here instead of inside UserDefinedFunction or there will be a conflict
// with columnReference for functions like: db.udf(foo)
var fn = $1.chain[$1.chain.length - 1].name.toLowerCase();
var fn = $1.chain[$1.chain.length - 1].name.toLowerCase();
$1.lastLoc.type = 'function';
$1.lastLoc.function = fn;
$1.lastLoc.location = {
first_line: $1.lastLoc.location.first_line,
last_line: $1.lastLoc.location.last_line,
first_column: $1.lastLoc.location.first_column,
last_column: $1.lastLoc.location.last_column - 1
if($1.lastLoc.location){
$1.lastLoc.location = {
first_line: $1.lastLoc.location.first_line,
last_line: $1.lastLoc.location.last_line,
first_column: $1.lastLoc.location.first_column,
last_column: $1.lastLoc.location.last_column - 1
}
}
if ($1.lastLoc !== $1.firstLoc) {
$1.firstLoc.type = 'database';