Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1] Rename V1Parser to Parser; move parser builder within the interface #1637

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions partiql-ast/api/partiql-ast.api
Original file line number Diff line number Diff line change
Expand Up @@ -4983,15 +4983,6 @@ public final class org/partiql/ast/builder/TypeVarcharBuilder {
public final fun setLength (Ljava/lang/Integer;)V
}

public final class org/partiql/ast/helpers/ToBinderKt {
public static final fun toBinder (Lorg/partiql/ast/Expr;I)Lorg/partiql/ast/Identifier$Symbol;
public static final fun toBinder (Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function0;)Lorg/partiql/ast/Identifier$Symbol;
}

public final class org/partiql/ast/normalize/Normalize {
public static final fun normalize (Lorg/partiql/ast/Statement;)Lorg/partiql/ast/Statement;
}

public abstract class org/partiql/ast/sql/SqlBlock {
public static final field Companion Lorg/partiql/ast/sql/SqlBlock$Companion;
public field next Lorg/partiql/ast/sql/SqlBlock;
Expand Down
67 changes: 0 additions & 67 deletions partiql-ast/src/main/kotlin/org/partiql/ast/helpers/ToBinder.kt

This file was deleted.

26 changes: 0 additions & 26 deletions partiql-ast/src/main/kotlin/org/partiql/ast/normalize/AstPass.kt

This file was deleted.

31 changes: 0 additions & 31 deletions partiql-ast/src/main/kotlin/org/partiql/ast/normalize/Normalize.kt

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import org.partiql.ast.v1.Statement
import org.partiql.cli.ErrorCodeString
import org.partiql.eval.Mode
import org.partiql.eval.compiler.PartiQLCompiler
import org.partiql.parser.PartiQLParserBuilderV1
import org.partiql.parser.PartiQLParserV1
import org.partiql.parser.PartiQLParser
import org.partiql.plan.Plan
import org.partiql.planner.PartiQLPlanner
import org.partiql.spi.Context
Expand All @@ -15,7 +14,7 @@ import org.partiql.spi.value.Datum
import java.io.PrintStream

internal class Pipeline private constructor(
private val parser: PartiQLParserV1,
private val parser: PartiQLParser,
private val planner: PartiQLPlanner,
private val compiler: PartiQLCompiler,
private val ctx: Context,
Expand Down Expand Up @@ -83,7 +82,7 @@ internal class Pipeline private constructor(
private fun create(mode: Mode, out: PrintStream, config: Config): Pipeline {
val listener = config.getErrorListener(out)
val ctx = Context.of(listener)
val parser = PartiQLParserBuilderV1().build()
val parser = PartiQLParser.Builder().build()
val planner = PartiQLPlanner.builder().build()
val compiler = PartiQLCompiler.builder().build()
return Pipeline(parser, planner, compiler, ctx, mode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.MethodSource
import org.partiql.eval.Mode
import org.partiql.eval.compiler.PartiQLCompiler
import org.partiql.parser.PartiQLParserV1
import org.partiql.parser.PartiQLParser
import org.partiql.plan.Plan
import org.partiql.planner.PartiQLPlanner
import org.partiql.spi.catalog.Catalog
Expand Down Expand Up @@ -1308,7 +1308,7 @@ class PartiQLEvaluatorTest {
) {

private val compiler = PartiQLCompiler.standard()
private val parser = PartiQLParserV1.standard()
private val parser = PartiQLParser.standard()
private val planner = PartiQLPlanner.standard()

/**
Expand Down Expand Up @@ -1376,7 +1376,7 @@ class PartiQLEvaluatorTest {
) {

private val compiler = PartiQLCompiler.standard()
private val parser = PartiQLParserV1.standard()
private val parser = PartiQLParser.standard()
private val planner = PartiQLPlanner.standard()

internal fun assert() {
Expand Down
24 changes: 3 additions & 21 deletions partiql-parser/api/partiql-parser.api
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
public abstract interface class org/partiql/parser/PartiQLParser {
public static fun builder ()Lorg/partiql/parser/PartiQLParserBuilder;
public static fun builder ()Lorg/partiql/parser/PartiQLParser$Builder;
public fun parse (Ljava/lang/String;)Lorg/partiql/parser/PartiQLParser$Result;
public abstract fun parse (Ljava/lang/String;Lorg/partiql/spi/Context;)Lorg/partiql/parser/PartiQLParser$Result;
public static fun standard ()Lorg/partiql/parser/PartiQLParser;
}

public final class org/partiql/parser/PartiQLParser$Result {
public field locations Lorg/partiql/spi/SourceLocations;
public field statements Ljava/util/List;
public fun <init> (Ljava/util/List;Lorg/partiql/spi/SourceLocations;)V
}

public class org/partiql/parser/PartiQLParserBuilder {
public class org/partiql/parser/PartiQLParser$Builder {
public fun <init> ()V
public fun build ()Lorg/partiql/parser/PartiQLParser;
}

public class org/partiql/parser/PartiQLParserBuilderV1 {
public fun <init> ()V
public fun build ()Lorg/partiql/parser/PartiQLParserV1;
}

public abstract interface class org/partiql/parser/PartiQLParserV1 {
public static fun builder ()Lorg/partiql/parser/PartiQLParserBuilderV1;
public fun parse (Ljava/lang/String;)Lorg/partiql/parser/PartiQLParserV1$Result;
public abstract fun parse (Ljava/lang/String;Lorg/partiql/spi/Context;)Lorg/partiql/parser/PartiQLParserV1$Result;
public static fun standard ()Lorg/partiql/parser/PartiQLParserV1;
}

public final class org/partiql/parser/PartiQLParserV1$Result {
public final class org/partiql/parser/PartiQLParser$Result {
public field locations Lorg/partiql/spi/SourceLocations;
public field statements Ljava/util/List;
public fun <init> (Ljava/util/List;Lorg/partiql/spi/SourceLocations;)V
Expand Down
Loading
Loading