Grammar: Allow multiple table keys which are not separated by commas

Fix table definitions like this...
CREATE TABLE [player_tech_branches]
(
	[from_id] INTEGER NOT NULL REFERENCES [techs](id),
	[to_id] INTEGER NOT NULL REFERENCES [techs](id),

	UNIQUE ([from_id], [to_id]) PRIMARY KEY ([from_id], [to_id])
)
...where there are multiple keys which are not separated by commas.

This partially fixed EoD's database in issue #63.
This commit is contained in:
Martin Kleusberg
2014-07-26 21:28:01 +02:00
parent 8d23c77578
commit 2dd0e9516f
4 changed files with 213 additions and 155 deletions

View File

@@ -258,7 +258,7 @@ keywordastablename
createtable
:
CREATE (TEMP|TEMPORARY)? TABLE (IF_T NOT EXISTS)? (tablename | keywordastablename)
( LPAREN columndef (COMMA columndef)* (COMMA tableconstraint)* RPAREN (WITHOUT ROWID)?
( LPAREN columndef (COMMA columndef)* ((COMMA)? tableconstraint)* RPAREN (WITHOUT ROWID)?
| AS selectstmt
)
{#createtable = #([CREATETABLE, "CREATETABLE"], #createtable);}