Skip to content

Commit

Permalink
--
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Nov 19, 2024
1 parent 1b6f598 commit 566d375
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
use std::rc::Rc;

use crate::wasm_crate::utils::{
define_rc_wrapper, define_refcell_wrapper, define_wrapper, enum_to_enum, FromFFI, IntoFFI,
};

mod ffi {
pub use crate::wasm_crate::bindings::exports::nomic_foundation::slang::cst::{
AncestorsIterator, Cursor, CursorBorrow, DescendantsIterator, Edge, EdgeLabel, Guest,
GuestCursor, GuestNonterminalNode, GuestQuery, GuestQueryMatchIterator,
AncestorsIterator, AncestorsIteratorBorrow, Cursor, CursorBorrow, DescendantsIterator,
DescendantsIteratorBorrow, Edge, EdgeLabel, Guest, GuestAncestorsIterator, GuestCursor,
GuestDescendantsIterator, GuestNonterminalNode, GuestQuery, GuestQueryMatchIterator,
GuestTerminalKindExtensions, GuestTerminalNode, Node, NonterminalKind, NonterminalNode,
NonterminalNodeBorrow, Query, QueryBorrow, QueryError, QueryMatch, QueryMatchIterator,
QueryMatchIteratorBorrow, TerminalKind, TerminalNode, TerminalNodeBorrow, TextIndex,
Expand Down Expand Up @@ -117,7 +120,7 @@ define_rc_wrapper! { NonterminalNode {
}

fn descendants(&self) -> ffi::DescendantsIterator {
self._borrow_ffi().descendants()._into_ffi()
Rc::clone(self._borrow_ffi()).descendants()._into_ffi()
}

fn unparse(&self) -> String {
Expand Down Expand Up @@ -157,7 +160,7 @@ define_rc_wrapper! { TerminalNode {
}

fn descendants(&self) -> ffi::DescendantsIterator {
self._borrow_ffi().descendants()._into_ffi()
Rc::clone(self._borrow_ffi()).descendants()._into_ffi()
}

fn unparse(&self) -> String {
Expand Down
6 changes: 6 additions & 0 deletions crates/codegen/runtime/npm/package/src/runtime/cst/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ export type Edge = generated.cst.Edge;
export const Cursor = generated.cst.Cursor;
export type Cursor = generated.cst.Cursor;

export const DescendantsIterator = generated.cst.DescendantsIterator;
export type DescendantsIterator = generated.cst.DescendantsIterator;

export const AncestorsIterator = generated.cst.AncestorsIterator;
export type AncestorsIterator = generated.cst.AncestorsIterator;

export const Query = generated.cst.Query;
export type Query = generated.cst.Query;

Expand Down

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

39 changes: 16 additions & 23 deletions crates/metaslang/cst/generated/public_api.txt

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

3 changes: 2 additions & 1 deletion crates/solidity/outputs/cargo/crate/generated/public_api.txt

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.

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

Loading

0 comments on commit 566d375

Please sign in to comment.