Added support for Tao syntax
This commit is contained in:
parent
aee42780be
commit
d45deb2685
1 changed files with 21 additions and 0 deletions
|
|
@ -35,6 +35,10 @@ impl LangPack {
|
|||
highlighter: Highlighter::default().python(),
|
||||
comment_syntax: Some(vec!['#', ' ']),
|
||||
},
|
||||
"tao" => Self {
|
||||
highlighter: Highlighter::default().tao(),
|
||||
comment_syntax: Some(vec!['#', ' ']),
|
||||
},
|
||||
_ => Self {
|
||||
highlighter: Highlighter::default(),
|
||||
comment_syntax: None,
|
||||
|
|
@ -191,6 +195,23 @@ impl Highlighter {
|
|||
.clike()
|
||||
}
|
||||
|
||||
pub fn tao(self) -> Self {
|
||||
self
|
||||
// Keywords
|
||||
.with(TokenKind::Keyword, r"\b[(data)(member)(def)(class)(type)(effect)(import)(handle)(with)(match)(if)(else)(for)(of)(let)(fn)(return)(in)(mod)(where)(when)(do)]\b")
|
||||
// Primitives
|
||||
.with(TokenKind::Type, r"\b[(Str)(Bool)(Nat)(Char)]\b")
|
||||
// Builtins
|
||||
.with(TokenKind::Macro, r"\b[(True)(False)]\b")
|
||||
// Doc comments
|
||||
.with(TokenKind::Doc, r"^##[^$]*$")
|
||||
// Comments
|
||||
.with(TokenKind::Comment, r"^#[^$]*$")
|
||||
// Attributes
|
||||
.with(TokenKind::Attribute, r"\$!?\[[^\]]*\]")
|
||||
.clike()
|
||||
}
|
||||
|
||||
pub fn toml(self) -> Self {
|
||||
self
|
||||
// Header
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue