Skip to content

Commit

Permalink
Removes Ast.exprTable method in favor of Ast.exprValues
Browse files Browse the repository at this point in the history
  • Loading branch information
johnedquinn committed Dec 2, 2024
1 parent 247776b commit d828d61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion partiql-ast/api/partiql-ast.api
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public final class org/partiql/ast/Ast {
public static final fun exprStruct (Ljava/util/List;)Lorg/partiql/ast/expr/ExprStruct;
public static final fun exprStructField (Lorg/partiql/ast/expr/Expr;Lorg/partiql/ast/expr/Expr;)Lorg/partiql/ast/expr/ExprStruct$Field;
public static final fun exprSubstring (Lorg/partiql/ast/expr/Expr;Lorg/partiql/ast/expr/Expr;Lorg/partiql/ast/expr/Expr;)Lorg/partiql/ast/expr/ExprSubstring;
public static final fun exprTable (Ljava/util/List;)Lorg/partiql/ast/expr/ExprValues;
public static final fun exprTrim (Lorg/partiql/ast/expr/Expr;Lorg/partiql/ast/expr/Expr;Lorg/partiql/ast/expr/TrimSpec;)Lorg/partiql/ast/expr/ExprTrim;
public static final fun exprValues (Ljava/util/List;)Lorg/partiql/ast/expr/ExprValues;
public static final fun exprVarRef (Lorg/partiql/ast/IdentifierChain;Lorg/partiql/ast/expr/Scope;)Lorg/partiql/ast/expr/ExprVarRef;
Expand Down
9 changes: 2 additions & 7 deletions partiql-ast/src/main/kotlin/org/partiql/ast/Ast.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ public object Ast {
return ExprBag(values)
}

@JvmStatic
public fun exprTable(values: List<Expr>): ExprValues {
// TODO: Is exprTable the right name here? IMO, ExprValues should really just be called TableValueConstructor to match the EBNF
return ExprValues(values)
}

@JvmStatic
public fun exprBetween(value: Expr, from: Expr, to: Expr, not: Boolean): ExprBetween {
return ExprBetween(value, from, to, not)
Expand Down Expand Up @@ -209,7 +203,8 @@ public object Ast {
}

@JvmStatic
public fun exprValues(rows: List<ExprRowValue>): ExprValues {
public fun exprValues(rows: List<Expr>): ExprValues {
// TODO: Is exprTable the right name here? IMO, ExprValues should really just be called TableValueConstructor to match the EBNF
return ExprValues(rows)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ import org.partiql.ast.Ast.exprSessionAttribute
import org.partiql.ast.Ast.exprStruct
import org.partiql.ast.Ast.exprStructField
import org.partiql.ast.Ast.exprSubstring
import org.partiql.ast.Ast.exprTable
import org.partiql.ast.Ast.exprTrim
import org.partiql.ast.Ast.exprValues
import org.partiql.ast.Ast.exprVarRef
import org.partiql.ast.Ast.exprVariant
import org.partiql.ast.Ast.exprWindow
Expand Down Expand Up @@ -1512,7 +1512,7 @@ internal class PartiQLParserDefault : PartiQLParser {

override fun visitTableValueConstructor(ctx: GeneratedParser.TableValueConstructorContext) = translate(ctx) {
val rows = visitOrEmpty<Expr>(ctx.rowValueExpressionList().expr())
exprTable(rows)
exprValues(rows)
}

override fun visitExprGraphMatchMany(ctx: GeneratedParser.ExprGraphMatchManyContext) = translate(ctx) {
Expand Down

0 comments on commit d828d61

Please sign in to comment.