rust/src/syntax_kinds.rs

23 lines
723 B
Rust
Raw Normal View History

2017-12-28 16:21:54 -06:00
// Generated from grammar.ron
2017-12-28 15:56:36 -06:00
use tree::{SyntaxKind, SyntaxInfo};
2017-12-29 15:48:47 -06:00
pub const ERROR: SyntaxKind = SyntaxKind(0);
pub const IDENT: SyntaxKind = SyntaxKind(1);
pub const UNDERSCORE: SyntaxKind = SyntaxKind(2);
pub const WHITESPACE: SyntaxKind = SyntaxKind(3);
2017-12-30 06:22:40 -06:00
pub const INT_NUMBER: SyntaxKind = SyntaxKind(4);
pub const FLOAT_NUMBER: SyntaxKind = SyntaxKind(5);
2017-12-28 15:56:36 -06:00
2017-12-30 06:22:40 -06:00
static INFOS: [SyntaxInfo; 6] = [
2017-12-29 15:48:47 -06:00
SyntaxInfo { name: "ERROR" },
2017-12-29 11:47:54 -06:00
SyntaxInfo { name: "IDENT" },
2017-12-29 15:48:47 -06:00
SyntaxInfo { name: "UNDERSCORE" },
2017-12-29 11:47:54 -06:00
SyntaxInfo { name: "WHITESPACE" },
2017-12-30 06:22:40 -06:00
SyntaxInfo { name: "INT_NUMBER" },
SyntaxInfo { name: "FLOAT_NUMBER" },
2017-12-29 11:47:54 -06:00
];
2017-12-28 15:56:36 -06:00
pub(crate) fn syntax_info(kind: SyntaxKind) -> &'static SyntaxInfo {
2017-12-29 11:47:54 -06:00
&INFOS[kind.0 as usize]
2017-12-28 16:21:54 -06:00
}