-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow numbers to be written in queries in scientific (exponential) no…
…tation (#52) (#65) * Allow numbers to be written in queries in scientific (exponential) notation (#52 * Support hex and octal numbers
- Loading branch information
1 parent
f5c039a
commit fdc3602
Showing
9 changed files
with
123 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...albertoventurini/graphdbplugin/test/integration/neo4j/tests/cypher/parsing/LexerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.albertoventurini.graphdbplugin.test.integration.neo4j.tests.cypher.parsing; | ||
|
||
import com.albertoventurini.graphdbplugin.test.integration.neo4j.tests.cypher.util.BaseParsingTest; | ||
|
||
public class LexerTest extends BaseParsingTest { | ||
|
||
public LexerTest() { | ||
super("lexer"); | ||
} | ||
|
||
public void testScientificNotation() { | ||
doTest(true); | ||
} | ||
|
||
public void testHexNumbers() { | ||
doTest(true); | ||
} | ||
|
||
public void testOctalNumbers() { | ||
doTest(true); | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
testing/integration-neo4j/src/test/resources/parsing/lexer/HexNumbers.cyp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
RETURN 0x10 |
20 changes: 20 additions & 0 deletions
20
testing/integration-neo4j/src/test/resources/parsing/lexer/HexNumbers.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Cypher file: FILE(0,11) | ||
CypherStatementItemImpl(STATEMENT_ITEM)(0,11) | ||
CypherStatementImpl(STATEMENT)(0,11) | ||
CypherQueryOptionsImpl(QUERY_OPTIONS)(0,0) | ||
<empty list> | ||
CypherQueryImpl(QUERY)(0,11) | ||
CypherRegularQueryImpl(REGULAR_QUERY)(0,11) | ||
CypherSingleQueryImpl(SINGLE_QUERY)(0,11) | ||
CypherSinglePartQueryImpl(SINGLE_PART_QUERY)(0,11) | ||
CypherReadingWithReturnImpl(READING_WITH_RETURN)(0,11) | ||
CypherReturnImpl(RETURN)(0,11) | ||
PsiElement(RETURN)('RETURN')(0,6) | ||
CypherReturnBodyImpl(RETURN_BODY)(7,11) | ||
CypherReturnItemsImpl(RETURN_ITEMS)(7,11) | ||
CypherReturnItemImpl(RETURN_ITEM)(7,11) | ||
CypherExpressionImpl(EXPRESSION)(7,11) | ||
CypherNumberLiteralImpl(NUMBER_LITERAL)(7,11) | ||
CypherIntegerLiteralImpl(INTEGER_LITERAL)(7,11) | ||
CypherUnsignedIntegerImpl(UNSIGNED_INTEGER)(7,11) | ||
PsiElement(hex_integer)('0x10')(7,11) |
1 change: 1 addition & 0 deletions
1
testing/integration-neo4j/src/test/resources/parsing/lexer/OctalNumbers.cyp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
RETURN 0o01234567 |
20 changes: 20 additions & 0 deletions
20
testing/integration-neo4j/src/test/resources/parsing/lexer/OctalNumbers.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Cypher file: FILE(0,17) | ||
CypherStatementItemImpl(STATEMENT_ITEM)(0,17) | ||
CypherStatementImpl(STATEMENT)(0,17) | ||
CypherQueryOptionsImpl(QUERY_OPTIONS)(0,0) | ||
<empty list> | ||
CypherQueryImpl(QUERY)(0,17) | ||
CypherRegularQueryImpl(REGULAR_QUERY)(0,17) | ||
CypherSingleQueryImpl(SINGLE_QUERY)(0,17) | ||
CypherSinglePartQueryImpl(SINGLE_PART_QUERY)(0,17) | ||
CypherReadingWithReturnImpl(READING_WITH_RETURN)(0,17) | ||
CypherReturnImpl(RETURN)(0,17) | ||
PsiElement(RETURN)('RETURN')(0,6) | ||
CypherReturnBodyImpl(RETURN_BODY)(7,17) | ||
CypherReturnItemsImpl(RETURN_ITEMS)(7,17) | ||
CypherReturnItemImpl(RETURN_ITEM)(7,17) | ||
CypherExpressionImpl(EXPRESSION)(7,17) | ||
CypherNumberLiteralImpl(NUMBER_LITERAL)(7,17) | ||
CypherIntegerLiteralImpl(INTEGER_LITERAL)(7,17) | ||
CypherUnsignedIntegerImpl(UNSIGNED_INTEGER)(7,17) | ||
PsiElement(octal_integer)('0o01234567')(7,17) |
2 changes: 2 additions & 0 deletions
2
testing/integration-neo4j/src/test/resources/parsing/lexer/ScientificNotation.cyp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
RETURN 1e6; | ||
RETURN 1.7976931348623157e+308; |
41 changes: 41 additions & 0 deletions
41
testing/integration-neo4j/src/test/resources/parsing/lexer/ScientificNotation.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Cypher file: FILE(0,43) | ||
CypherStatementItemImpl(STATEMENT_ITEM)(0,11) | ||
CypherStatementImpl(STATEMENT)(0,10) | ||
CypherQueryOptionsImpl(QUERY_OPTIONS)(0,0) | ||
<empty list> | ||
CypherQueryImpl(QUERY)(0,10) | ||
CypherRegularQueryImpl(REGULAR_QUERY)(0,10) | ||
CypherSingleQueryImpl(SINGLE_QUERY)(0,10) | ||
CypherSinglePartQueryImpl(SINGLE_PART_QUERY)(0,10) | ||
CypherReadingWithReturnImpl(READING_WITH_RETURN)(0,10) | ||
CypherReturnImpl(RETURN)(0,10) | ||
PsiElement(RETURN)('RETURN')(0,6) | ||
CypherReturnBodyImpl(RETURN_BODY)(7,10) | ||
CypherReturnItemsImpl(RETURN_ITEMS)(7,10) | ||
CypherReturnItemImpl(RETURN_ITEM)(7,10) | ||
CypherExpressionImpl(EXPRESSION)(7,10) | ||
CypherNumberLiteralImpl(NUMBER_LITERAL)(7,10) | ||
CypherDoubleLiteralImpl(DOUBLE_LITERAL)(7,10) | ||
CypherUnsignedDoubleImpl(UNSIGNED_DOUBLE)(7,10) | ||
PsiElement(decimal)('1e6')(7,10) | ||
PsiElement(;)(';')(10,11) | ||
CypherStatementItemImpl(STATEMENT_ITEM)(12,43) | ||
CypherStatementImpl(STATEMENT)(12,42) | ||
CypherQueryOptionsImpl(QUERY_OPTIONS)(12,12) | ||
<empty list> | ||
CypherQueryImpl(QUERY)(12,42) | ||
CypherRegularQueryImpl(REGULAR_QUERY)(12,42) | ||
CypherSingleQueryImpl(SINGLE_QUERY)(12,42) | ||
CypherSinglePartQueryImpl(SINGLE_PART_QUERY)(12,42) | ||
CypherReadingWithReturnImpl(READING_WITH_RETURN)(12,42) | ||
CypherReturnImpl(RETURN)(12,42) | ||
PsiElement(RETURN)('RETURN')(12,18) | ||
CypherReturnBodyImpl(RETURN_BODY)(19,42) | ||
CypherReturnItemsImpl(RETURN_ITEMS)(19,42) | ||
CypherReturnItemImpl(RETURN_ITEM)(19,42) | ||
CypherExpressionImpl(EXPRESSION)(19,42) | ||
CypherNumberLiteralImpl(NUMBER_LITERAL)(19,42) | ||
CypherDoubleLiteralImpl(DOUBLE_LITERAL)(19,42) | ||
CypherUnsignedDoubleImpl(UNSIGNED_DOUBLE)(19,42) | ||
PsiElement(decimal)('1.7976931348623157e+308')(19,42) | ||
PsiElement(;)(';')(42,43) |