-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-any-type-in-anyoftype
- Loading branch information
Showing
9 changed files
with
995 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
partiql-ast/src/main/kotlin/org/partiql/ast/sql/internal/InternalSqlBlock.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at: | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific | ||
* language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package org.partiql.ast.sql.internal | ||
|
||
/** | ||
* Representation of some textual elements as a token (singly-linked) list. | ||
*/ | ||
internal sealed class InternalSqlBlock { | ||
|
||
/** | ||
* Next token (if any) in the list. | ||
*/ | ||
internal var next: InternalSqlBlock? = null | ||
|
||
/** | ||
* A newline / link break token. | ||
*/ | ||
internal class NL : InternalSqlBlock() | ||
|
||
/** | ||
* A raw text token. Cannot be broken. | ||
*/ | ||
internal class Text(val text: String) : InternalSqlBlock() | ||
|
||
/** | ||
* A nest token representing a (possible indented) token sublist. | ||
* | ||
* @property prefix A prefix character such as '{', '(', or '['. | ||
* @property postfix A postfix character such as '}', ')', or ']]. | ||
* @property child | ||
*/ | ||
internal class Nest( | ||
val prefix: String?, | ||
val postfix: String?, | ||
val child: InternalSqlBlock, | ||
) : InternalSqlBlock() | ||
|
||
companion object { | ||
|
||
/** | ||
* Helper function to create root node (empty). | ||
*/ | ||
@JvmStatic | ||
internal fun root(): InternalSqlBlock = Text("") | ||
} | ||
} |
Oops, something went wrong.