提交 d69b5792 authored 作者: Thomas Mueller's avatar Thomas Mueller

Pull request #118: Fix DbContextRule.PROCEDURE in BNF

上级 f36f879f
......@@ -2140,6 +2140,7 @@ value
| ?[ int ]
| NEXT VALUE FOR sequenceName
| function
| procedure
| { - | + } term
| ( expression )
| select
......
......@@ -131,6 +131,9 @@ class WebSession {
new DbContextRule(contents, DbContextRule.SCHEMA);
DbContextRule columnAliasRule =
new DbContextRule(contents, DbContextRule.COLUMN_ALIAS);
DbContextRule procedure =
new DbContextRule(contents, DbContextRule.PROCEDURE);
newBnf.updateTopic("procedure", procedure);
newBnf.updateTopic("column_name", columnRule);
newBnf.updateTopic("new_table_alias", newAliasRule);
newBnf.updateTopic("table_alias", aliasRule);
......
......@@ -136,13 +136,17 @@ public class TestBnf extends TestBase {
DbContextRule columnRule = new
DbContextRule(dbContents, DbContextRule.COLUMN);
bnf.updateTopic("column_name", columnRule);
bnf.updateTopic("expression", new
bnf.updateTopic("procedure", new
DbContextRule(dbContents, DbContextRule.PROCEDURE));
bnf.linkStatements();
// Test partial
Map<String, String> tokens = bnf.getNextTokenList("SELECT CUSTOM_PR");
assertTrue(tokens.values().contains("INT"));
// Test built-in function
tokens = bnf.getNextTokenList("SELECT LEAS");
assertTrue(tokens.values().contains("T"));
// Test parameters
tokens = bnf.getNextTokenList("SELECT CUSTOM_PRINT(");
assertTrue(tokens.values().contains("STRING_FIELD"));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论