mirror of
https://github.com/RGBCube/cstree
synced 2025-07-27 09:07:44 +00:00
Merge branch 'master' into v0.6
This commit is contained in:
commit
5bee3abe73
5 changed files with 11 additions and 11 deletions
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
|
@ -6,7 +6,7 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
# Daily
|
# Daily
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 4 * * *"
|
- cron: "0 4 1/7 * *"
|
||||||
|
|
||||||
# Allows to run this workflow manually from the Actions tab
|
# Allows to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
@ -101,7 +101,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
rust-version: nightly
|
rust-version: nightly
|
||||||
components: miri
|
components: miri
|
||||||
- run: cargo miri test --verbose --all-features -- -Zmiri-disable-isolation
|
env:
|
||||||
|
MIRIFLAGS: -Zmiri-disable-isolation
|
||||||
|
- run: cargo miri test --verbose --all-features
|
||||||
|
|
||||||
sanitizers:
|
sanitizers:
|
||||||
name: ${{ matrix.sanitizer }} sanitizer
|
name: ${{ matrix.sanitizer }} sanitizer
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
name = "cstree"
|
name = "cstree"
|
||||||
version = "0.4.0"
|
version = "0.6.0"
|
||||||
authors = [
|
authors = [
|
||||||
"Domenic Quirl <DomenicQuirl@pm.me>",
|
"Domenic Quirl <DomenicQuirl@pm.me>",
|
||||||
"Aleksey Kladov <aleksey.kladov@gmail.com>",
|
"Aleksey Kladov <aleksey.kladov@gmail.com>",
|
||||||
|
|
|
@ -43,12 +43,8 @@
|
||||||
//! an AST representation, or freely switch between them. To do so, use `cstree` to build syntax and underlying green
|
//! an AST representation, or freely switch between them. To do so, use `cstree` to build syntax and underlying green
|
||||||
//! tree and provide AST wrappers for your different kinds of nodes. An example of how this is done can be seen [here](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/syntax/src/ast/generated.rs) and [here](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/syntax/src/ast/generated/nodes.rs) (note that the latter file is automatically generated by a task).
|
//! tree and provide AST wrappers for your different kinds of nodes. An example of how this is done can be seen [here](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/syntax/src/ast/generated.rs) and [here](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/syntax/src/ast/generated/nodes.rs) (note that the latter file is automatically generated by a task).
|
||||||
|
|
||||||
#![forbid(
|
#![forbid(missing_debug_implementations, unconditional_recursion)]
|
||||||
// missing_debug_implementations,
|
#![deny(unsafe_code, missing_docs, future_incompatible)]
|
||||||
unconditional_recursion,
|
|
||||||
future_incompatible,
|
|
||||||
)]
|
|
||||||
#![deny(unsafe_code, missing_docs)]
|
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
mod green;
|
mod green;
|
||||||
|
|
|
@ -23,6 +23,7 @@ use triomphe::Arc;
|
||||||
/// Syntax nodes can be shared between threads.
|
/// Syntax nodes can be shared between threads.
|
||||||
/// Every syntax tree is reference counted as a whole and nodes are pointer-sized, so copying
|
/// Every syntax tree is reference counted as a whole and nodes are pointer-sized, so copying
|
||||||
/// individual nodes is relatively cheap.
|
/// individual nodes is relatively cheap.
|
||||||
|
#[derive(Debug)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
pub struct SyntaxNode<L: Language, D: 'static = ()> {
|
pub struct SyntaxNode<L: Language, D: 'static = ()> {
|
||||||
data: *mut NodeData<L, D>,
|
data: *mut NodeData<L, D>,
|
||||||
|
@ -983,7 +984,7 @@ impl<'n> Iter<'n> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An iterator over the child nodes of a [`SyntaxNode`].
|
/// An iterator over the child nodes of a [`SyntaxNode`].
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct SyntaxNodeChildren<'n, L: Language, D: 'static = ()> {
|
pub struct SyntaxNodeChildren<'n, L: Language, D: 'static = ()> {
|
||||||
inner: Iter<'n>,
|
inner: Iter<'n>,
|
||||||
parent: &'n SyntaxNode<L, D>,
|
parent: &'n SyntaxNode<L, D>,
|
||||||
|
@ -1014,7 +1015,7 @@ impl<'n, L: Language, D> Iterator for SyntaxNodeChildren<'n, L, D> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An iterator over the children of a [`SyntaxNode`].
|
/// An iterator over the children of a [`SyntaxNode`].
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct SyntaxElementChildren<'n, L: Language, D: 'static = ()> {
|
pub struct SyntaxElementChildren<'n, L: Language, D: 'static = ()> {
|
||||||
inner: Iter<'n>,
|
inner: Iter<'n>,
|
||||||
parent: &'n SyntaxNode<L, D>,
|
parent: &'n SyntaxNode<L, D>,
|
||||||
|
|
|
@ -11,6 +11,7 @@ use super::*;
|
||||||
use crate::{Direction, GreenNode, GreenToken, Language, SyntaxKind};
|
use crate::{Direction, GreenNode, GreenToken, Language, SyntaxKind};
|
||||||
|
|
||||||
/// Syntax tree token.
|
/// Syntax tree token.
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct SyntaxToken<L: Language, D: 'static = ()> {
|
pub struct SyntaxToken<L: Language, D: 'static = ()> {
|
||||||
parent: SyntaxNode<L, D>,
|
parent: SyntaxNode<L, D>,
|
||||||
index: u32,
|
index: u32,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue