Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
b2a94dc7
提交
b2a94dc7
authored
11 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
H2 Console: auto-complete did not work with multi-line statements.
上级
573c2c5d
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
19 行增加
和
7 行删除
+19
-7
Bnf.java
h2/src/main/org/h2/bnf/Bnf.java
+10
-0
RuleElement.java
h2/src/main/org/h2/bnf/RuleElement.java
+1
-1
RuleFixed.java
h2/src/main/org/h2/bnf/RuleFixed.java
+2
-2
DbContextRule.java
h2/src/main/org/h2/bnf/context/DbContextRule.java
+6
-4
没有找到文件。
h2/src/main/org/h2/bnf/Bnf.java
浏览文件 @
b2a94dc7
...
...
@@ -137,6 +137,16 @@ public class Bnf {
rule
.
setLinks
(
ruleMap
);
rule
.
accept
(
visitor
);
}
/**
* Check whether the statement starts with a whitespace.
*
* @param s the statement
* @return if the statement is not empty and starts with a whitespace
*/
public
static
boolean
startWithSpace
(
String
s
)
{
return
s
.
length
()
>
0
&&
Character
.
isWhitespace
(
s
.
charAt
(
0
));
}
/**
* Convert convert ruleLink to rule_link.
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/bnf/RuleElement.java
浏览文件 @
b2a94dc7
...
...
@@ -61,7 +61,7 @@ public class RuleElement implements Rule {
String
up
=
sentence
.
getQueryUpper
().
trim
();
if
(
up
.
startsWith
(
name
))
{
query
=
query
.
substring
(
name
.
length
());
while
(!
"_"
.
equals
(
name
)
&&
query
.
length
()
>
0
&&
Character
.
isSpaceChar
(
query
.
charAt
(
0
)
))
{
while
(!
"_"
.
equals
(
name
)
&&
Bnf
.
startWithSpace
(
query
))
{
query
=
query
.
substring
(
1
);
}
sentence
.
setQuery
(
query
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/bnf/RuleFixed.java
浏览文件 @
b2a94dc7
...
...
@@ -111,7 +111,7 @@ public class RuleFixed implements Rule {
}
break
;
case
ANY_WORD:
while
(
s
.
length
()
>
0
&&
!
Character
.
isSpaceChar
(
s
.
charAt
(
0
)
))
{
while
(
s
.
length
()
>
0
&&
!
Bnf
.
startWithSpace
(
s
))
{
s
=
s
.
substring
(
1
);
}
if
(
s
.
length
()
==
0
)
{
...
...
@@ -185,7 +185,7 @@ public class RuleFixed implements Rule {
throw
new
AssertionError
(
"type="
+
type
);
}
if
(!
s
.
equals
(
query
))
{
while
(
s
.
length
()
>
0
&&
Character
.
isSpaceChar
(
s
.
charAt
(
0
)
))
{
while
(
Bnf
.
startWithSpace
(
s
))
{
s
=
s
.
substring
(
1
);
}
sentence
.
setQuery
(
s
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/bnf/context/DbContextRule.java
浏览文件 @
b2a94dc7
...
...
@@ -8,6 +8,8 @@ package org.h2.bnf.context;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
org.h2.bnf.Bnf
;
import
org.h2.bnf.BnfVisitor
;
import
org.h2.bnf.Rule
;
import
org.h2.bnf.RuleElement
;
...
...
@@ -211,14 +213,14 @@ public class DbContextRule implements Rule {
}
break
;
}
case
PROCEDURE:
autoCompleteProcedure
(
sentence
);
break
;
case
PROCEDURE:
autoCompleteProcedure
(
sentence
);
break
;
default
:
throw
DbException
.
throwInternalError
(
"type="
+
type
);
}
if
(!
s
.
equals
(
query
))
{
while
(
s
.
length
()
>
0
&&
Character
.
isSpaceChar
(
s
.
charAt
(
0
)
))
{
while
(
Bnf
.
startWithSpace
(
s
))
{
s
=
s
.
substring
(
1
);
}
sentence
.
setQuery
(
s
);
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论