Skip to content

Commit

Permalink
Extract insert values into its own rule to get the range
Browse files Browse the repository at this point in the history
  • Loading branch information
hfhbd committed Nov 21, 2023
1 parent fb53ff3 commit c5beaf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/kotlin/com/alecstrong/sql/psi/core/sql.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c5beaf7

Please sign in to comment.