diff --git a/core/src/main/kotlin/com/alecstrong/sql/psi/core/psi/mixins/InsertStmtValuesMixin.kt b/core/src/main/kotlin/com/alecstrong/sql/psi/core/psi/mixins/InsertStmtValuesMixin.kt index 0b8934dc..42c1f2bc 100644 --- a/core/src/main/kotlin/com/alecstrong/sql/psi/core/psi/mixins/InsertStmtValuesMixin.kt +++ b/core/src/main/kotlin/com/alecstrong/sql/psi/core/psi/mixins/InsertStmtValuesMixin.kt @@ -31,7 +31,7 @@ internal abstract class InsertStmtValuesMixin( parent.columnNameList.mapNotNull { it.name } } - valuesExpressionList.forEach { + valuesExpressionList?.valuesExpressionList?.forEach { if (it.exprList.size != setColumns.size) { annotationHolder.createErrorAnnotation( it, diff --git a/core/src/main/kotlin/com/alecstrong/sql/psi/core/sql.bnf b/core/src/main/kotlin/com/alecstrong/sql/psi/core/sql.bnf index 53cd3c54..08bda448 100644 --- a/core/src/main/kotlin/com/alecstrong/sql/psi/core/sql.bnf +++ b/core/src/main/kotlin/com/alecstrong/sql/psi/core/sql.bnf @@ -321,10 +321,12 @@ insert_stmt ::= [ with_clause ] ( INSERT OR REPLACE | REPLACE | INSERT OR ROLLBA mixin = "com.alecstrong.sql.psi.core.psi.mixins.InsertStmtMixin" pin = 5 } -insert_stmt_values ::= VALUES values_expression ( COMMA values_expression ) * | compound_select_stmt | DEFAULT VALUES { +insert_stmt_values ::= VALUES values_expression_list | compound_select_stmt | DEFAULT VALUES { mixin = "com.alecstrong.sql.psi.core.psi.mixins.InsertStmtValuesMixin" pin = 1 } +values_expression_list ::= values_expression ( COMMA values_expression ) * + pragma_stmt ::= PRAGMA [ database_name DOT ] pragma_name [ EQ pragma_value | LP pragma_value RP ] { pin = 1 }