mirror of
https://forge.katzen.cafe/katzen-cafe/iowo.git
synced 2024-11-24 14:28:44 +01:00
3eee768ce1
- work on new world - add file db - source_file parsing - locs - fix some test stuff
26 lines
772 B
Rust
26 lines
772 B
Rust
#![feature(type_alias_impl_trait, lint_reasons, box_into_inner)]
|
|
|
|
use crate::lst_parser::syntax_kind::SyntaxKind;
|
|
|
|
pub mod ast;
|
|
pub mod lst_parser;
|
|
pub mod world;
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
|
pub enum Lang {}
|
|
impl rowan::Language for Lang {
|
|
type Kind = SyntaxKind;
|
|
#[allow(unsafe_code)]
|
|
fn kind_from_raw(raw: rowan::SyntaxKind) -> Self::Kind {
|
|
assert!(raw.0 <= SyntaxKind::ROOT as u16);
|
|
unsafe { std::mem::transmute::<u16, SyntaxKind>(raw.0) }
|
|
}
|
|
fn kind_to_raw(kind: Self::Kind) -> rowan::SyntaxKind {
|
|
kind.into()
|
|
}
|
|
}
|
|
|
|
pub type SyntaxNode = rowan::SyntaxNode<Lang>;
|
|
pub type SyntaxToken = rowan::SyntaxNode<Lang>;
|
|
pub type SyntaxElement = rowan::NodeOrToken<SyntaxNode, SyntaxToken>;
|