feat(lib): support no_std

This commit is contained in:
DragonBillow 2024-05-30 16:05:30 +08:00 committed by ObserverOfTime
parent 1c7b518b9d
commit d13d7235d2
8 changed files with 101 additions and 94 deletions

View file

@ -9,6 +9,7 @@ include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
include!("./bindings.rs");
#[cfg(any(unix, target_os = "wasi"))]
#[cfg(feature = "std")]
extern "C" {
pub(crate) fn _ts_dup(fd: std::os::raw::c_int) -> std::os::raw::c_int;
}
@ -18,7 +19,7 @@ extern "C" {
pub(crate) fn _ts_dup(handle: *mut std::os::raw::c_void) -> std::os::raw::c_int;
}
use std::{marker::PhantomData, mem::ManuallyDrop, ptr::NonNull, str};
use core::{marker::PhantomData, mem::ManuallyDrop, ptr::NonNull, str};
use crate::{
Language, LookaheadIterator, Node, Parser, Query, QueryCursor, QueryError, Tree, TreeCursor,