[fine] Rebuild main, it's probably broken
This commit is contained in:
parent
a9c1b04920
commit
b205ebcb4c
4 changed files with 24 additions and 892 deletions
|
|
@ -4,8 +4,6 @@ use crate::tokens::{Lines, Token, TokenKind, Tokens};
|
|||
use std::fmt::Write as _;
|
||||
use std::{cell::Cell, num::NonZeroU32};
|
||||
|
||||
pub mod old; // Until I decide to delete it.
|
||||
|
||||
pub struct SyntaxTree<'a> {
|
||||
trees: Vec<Tree<'a>>,
|
||||
root: Option<TreeRef>,
|
||||
|
|
@ -68,6 +66,10 @@ impl<'a> SyntaxTree<'a> {
|
|||
self[t].end_pos
|
||||
}
|
||||
|
||||
pub fn trees(&self) -> impl Iterator<Item = TreeRef> {
|
||||
(0..self.trees.len()).map(|i| TreeRef::from_index(i))
|
||||
}
|
||||
|
||||
pub fn find_tree_at(&self, pos: usize) -> Option<TreeRef> {
|
||||
let mut current = self.root?;
|
||||
let mut tree = &self[current];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue