Fix column parser not accepting columns without type

This commit is contained in:
Simon Binder 2019-09-24 22:45:18 +02:00
parent 7c4f807907
commit bf6d60b170
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 7 additions and 7 deletions

View File

@ -80,13 +80,13 @@ mixin SchemaParser on ParserBase {
final name = _consume(TokenType.identifier, 'Expected a column name')
as IdentifierToken;
final typeNames = _typeName();
if (typeNames == null) {
_error('Expected a type name here');
}
final typeTokens = _typeName();
String typeName;
final typeSpan = typeNames.first.span.expand(typeNames.last.span);
final typeName = typeSpan.text;
if (typeTokens != null) {
final typeSpan = typeTokens.first.span.expand(typeTokens.last.span);
typeName = typeSpan.text;
}
final constraints = <ColumnConstraint>[];
ColumnConstraint constraint;
@ -100,7 +100,7 @@ mixin SchemaParser on ParserBase {
constraints: constraints,
)
..setSpan(name, _previous)
..typeNames = typeNames;
..typeNames = typeTokens;
}
List<Token> _typeName() {