mirror of https://github.com/apache/cassandra
CASSANDRA-296 fix grammar breakage
Changeset ada820 was an attempt to make hostname parsing less stupid,
(i.e. don't allow underscores; do allow hyphens; allow IP addresses).
It didn't entirely fix the problems it set out to and it broke
parsing of anything that used the "Identifier" lexer, (for example
the thrift {get,set} ... commands).
This changeset partially reverts ada820 until a proper fix to
hostname parsing can be found.
git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@802908 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bf6236ddf6
commit
e3f6bd529f
|
|
@ -85,7 +85,7 @@ stmt
|
|||
|
||||
connectStmt
|
||||
: K_CONNECT host SLASH port -> ^(NODE_CONNECT host port)
|
||||
| K_CONNECT ip SLASH port -> ^(NODE_CONNECT ip port)
|
||||
| K_CONNECT ipaddr SLASH port -> ^(NODE_CONNECT ipaddr port)
|
||||
;
|
||||
|
||||
helpStmt
|
||||
|
|
@ -150,9 +150,9 @@ value: StringLiteral;
|
|||
|
||||
columnOrSuperColumn: StringLiteral;
|
||||
|
||||
host: id+=HostIdentifier -> ^(NODE_ID_LIST $id+);
|
||||
host: id+=Identifier (id+=DOT id+=Identifier)* -> ^(NODE_ID_LIST $id+);
|
||||
|
||||
ip: id+=IntegerLiteral id+=DOT id+=IntegerLiteral id+=DOT id+=IntegerLiteral id+=DOT id+=IntegerLiteral -> ^(NODE_ID_LIST $id+);
|
||||
ipaddr: id+=IntegerLiteral id+=DOT id+=IntegerLiteral id+=DOT id+=IntegerLiteral id+=DOT id+=IntegerLiteral -> ^(NODE_ID_LIST $id+);
|
||||
|
||||
port: IntegerLiteral;
|
||||
|
||||
|
|
@ -195,9 +195,15 @@ Digit
|
|||
: '0'..'9'
|
||||
;
|
||||
|
||||
fragment
|
||||
Alnum
|
||||
: Letter
|
||||
| Digit
|
||||
;
|
||||
|
||||
// syntactic Elements
|
||||
Identifier
|
||||
: Letter ( Letter | Digit | '_')*
|
||||
: Letter ( Alnum | '_' )*
|
||||
;
|
||||
|
||||
// literals
|
||||
|
|
@ -206,14 +212,10 @@ StringLiteral
|
|||
'\'' (~'\'')* '\'' ( '\'' (~'\'')* '\'' )*
|
||||
;
|
||||
|
||||
|
||||
IntegerLiteral
|
||||
: Digit+;
|
||||
|
||||
|
||||
HostIdentifier
|
||||
: ( Letter | Digit ) ( Letter | Digit | DOT | '-' )* ( Letter | Digit )
|
||||
;
|
||||
|
||||
//
|
||||
// syntactic elements
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in New Issue