-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91fd4ff
commit e5b7fd8
Showing
9 changed files
with
27 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
pub mod model; | ||
pub mod syntax; | ||
pub mod utils; | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
pub mod syntax; | ||
pub mod utils; | ||
|
||
pub use typst::utils::LazyHash; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
//! Typst Syntax | ||
use typst_syntax::LinkedNode; | ||
use typst::syntax::LinkedNode; | ||
use typst::syntax::Side; | ||
|
||
/// The `LinkedNodeExt` trait is designed for compatibility between new and old versions of `typst`. | ||
/// The `LinkedNodeExt` trait is designed for compatibility between new and old | ||
/// versions of `typst`. | ||
pub trait LinkedNodeExt: Sized { | ||
/// Get the leaf at the specified byte offset. | ||
fn leaf_at_compat(&self, cursor: usize) -> Option<Self>; | ||
} | ||
|
||
impl<'a> LinkedNodeExt for LinkedNode<'a> { | ||
impl LinkedNodeExt for LinkedNode<'_> { | ||
fn leaf_at_compat(&self, cursor: usize) -> Option<Self> { | ||
self.leaf_at(cursor) | ||
self.leaf_at(cursor, Side::Before) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
//! Typst utils | ||
pub use typst::util::*; | ||
pub use typst::utils::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters