Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Aug 11, 2024
1 parent 4e2d394 commit 2ebdf0f
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 8 deletions.
21 changes: 19 additions & 2 deletions crates/codegen/runtime/cargo/src/runtime/wit/bindings.wit.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ world slang {
}

interface cst {
use kinds.{nonterminal-kind};
use cursor.{cursor};
use kinds.{nonterminal-kind, terminal-kind};
use text-index.{text-index};

variant node {
nonterminal(nonterminal-node),
Expand All @@ -36,6 +38,10 @@ interface cst {
}

interface cursor {
use cst.{node};
use kinds.{edge-label, nonterminal-kind, terminal-kind};
use text-index.{text-index, text-range};

resource cursor {
reset: func();
complete: func();
Expand Down Expand Up @@ -128,6 +134,9 @@ interface kinds {
}

interface language {
use kinds.{nonterminal-kind};
use parse-output.{parse-output};

resource language {
supported-versions: static func() -> list<string>;
new: static func(version: string) -> result<language, string>;
Expand All @@ -137,15 +146,21 @@ interface language {
}

interface parse-error {
use diagnostic.{severity};
use text-index.{text-range};

resource parse-error {
// is-a diagnostic
severity: func() -> severity;
text-range: func() -> text-range;
message: func() -> string;
}
}

interface parse-output {
use cst.{node};
use cursor.{cursor};
use parse-error.{parse-error};

resource parse-output {
tree: func() -> node;
errors: func() -> list<parse-error>;
Expand All @@ -155,6 +170,8 @@ interface parse-output {
}

interface query {
use cursor.{cursor};

resource query {
parse: static func(text: string) -> result<query, query-error>;
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2ebdf0f

Please sign in to comment.