-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
81 additions
and
39 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
Binary file modified
BIN
+0 Bytes
(100%)
modules/treesitter/src/main/resources/darwin-aarch64/libtree-sitter-smithyql.dylib
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
modules/treesitter/src/main/resources/darwin-x86-64/libtree-sitter-smithyql.dylib
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
modules/treesitter/src/main/resources/linux-aarch64/libtree-sitter-smithyql.so
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
modules/treesitter/src/main/resources/linux-x86-64/libtree-sitter-smithyql.so
Binary file not shown.
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
42 changes: 42 additions & 0 deletions
42
modules/treesitter/src/main/scala/playground/generated/nodes/QueryOperationName.scala
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,42 @@ | ||
// Generated code! Do not modify by hand. | ||
package playground.generated.nodes | ||
|
||
import org.polyvariant.treesitter4s.Node | ||
import playground.treesitter4s.std.Selection | ||
|
||
opaque type QueryOperationName <: Node = Node | ||
|
||
object QueryOperationName { | ||
extension (node: QueryOperationName) { | ||
def select[A](f: QueryOperationName.Selector => Selection[A]): List[A] = f(QueryOperationName.Selector(List(node))).path | ||
// fields | ||
def identifier: List[QualifiedIdentifier] = node.fields.getOrElse("identifier", Nil).toList.collect { | ||
case QualifiedIdentifier(node) => node | ||
} | ||
|
||
def name: Option[OperationName] = node.fields.getOrElse("name", Nil).headOption.map { | ||
case OperationName(node) => node | ||
} | ||
// typed children | ||
|
||
// precise typed children | ||
|
||
} | ||
|
||
def apply(node: Node): Either[String, QueryOperationName] = | ||
if node.tpe == "query_operation_name" | ||
then Right(node) | ||
else Left(s"Expected QueryOperationName, got ${node.tpe}") | ||
|
||
def unsafeApply(node: Node): QueryOperationName = apply(node).fold(sys.error, identity) | ||
|
||
def unapply(node: Node): Option[QueryOperationName] = apply(node).toOption | ||
|
||
final case class Selector(path: List[QueryOperationName]) extends Selection[QueryOperationName] { | ||
def identifier: QualifiedIdentifier.Selector = QualifiedIdentifier.Selector(path.flatMap(_.identifier)) | ||
def name: OperationName.Selector = OperationName.Selector(path.flatMap(_.name)) | ||
|
||
type Self = Selector | ||
protected val remake = Selector.apply | ||
} | ||
} |
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