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

14
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,14 @@
{
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "启动程序",
"program": "${workspaceFolder}/index.js"
}
]
}

View File

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

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 // 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) // 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.type = 'function';
$1.lastLoc.function = fn; $1.lastLoc.function = fn;
$1.lastLoc.location = { if($1.lastLoc.location){
first_line: $1.lastLoc.location.first_line, $1.lastLoc.location = {
last_line: $1.lastLoc.location.last_line, first_line: $1.lastLoc.location.first_line,
first_column: $1.lastLoc.location.first_column, last_line: $1.lastLoc.location.last_line,
last_column: $1.lastLoc.location.last_column - 1 first_column: $1.lastLoc.location.first_column,
last_column: $1.lastLoc.location.last_column - 1
}
} }
if ($1.lastLoc !== $1.firstLoc) { if ($1.lastLoc !== $1.firstLoc) {
$1.firstLoc.type = 'database'; $1.firstLoc.type = 'database';