Skip to content

Commit

Permalink
Expose cursor method in napi
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonyBlakey committed Oct 23, 2023
1 parent 7004bb5 commit 3f9332d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-wombats-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/slang": patch
---

`cursor` method is now exposed in Typescript API
2 changes: 2 additions & 0 deletions crates/codegen/parser/runtime/src/napi/napi_cst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ impl RuleNode {
.collect()
}

#[napi(getter)]
pub fn cursor(&self) -> Cursor {
Cursor::new(RustNode::Rule(self.0.clone()).cursor())
}
Expand Down Expand Up @@ -74,6 +75,7 @@ impl TokenNode {
self.0.text.clone()
}

#[napi(getter)]
pub fn cursor(&self) -> Cursor {
Cursor::new(RustNode::Token(self.0.clone()).cursor())
}
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.

2 changes: 2 additions & 0 deletions crates/solidity/outputs/npm/package/src/generated/index.d.ts

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

0 comments on commit 3f9332d

Please sign in to comment.