From 774a35ae21dada36af48ae32c862b22587fba107 Mon Sep 17 00:00:00 2001 From: JJ Date: Thu, 28 Dec 2023 02:18:50 -0800 Subject: docs: sweeping changes. cement an understanding of error handling, async, modules, and unions. rewrite documentation on interfaces. complete the introductory overview. many minor cleanups. --- src/frontend/lex.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/frontend/lex.rs b/src/frontend/lex.rs index f751c63..e0aa76d 100644 --- a/src/frontend/lex.rs +++ b/src/frontend/lex.rs @@ -31,12 +31,13 @@ impl std::error::Error for LexicalError {} /// **Basic** syntax tokens. Form an unambiguous TokenStream. #[derive(Clone, PartialEq)] pub enum Token { - Key(Keyword), // keyword identifiers. - Word(String), // non-keyword identifiers. - Num(String), // numeric value, ex. 413, 0b101011, 0xabcd - Lit(Literal), // literal value, ex. for strings/comments. - Sep(Punctuation), // punctuation. non-word tokens. operators are lexed as this and later transformed to words. - Indent(usize), // indentation. denotes line breaks and scope at which a line starts. + Key(Keyword), // keyword identifiers. + Word(String), // non-keyword identifiers. + Op(String), // operators. separate tokens lexographically so the parser knows to parse infix notation. + Num(String), // numeric value, ex. 413, 0b101011, 0xabcd + Lit(Literal), // literal value, ex. for strings/comments. + Sep(Punctuation), // punctuation. non-word tokens. ~~operators are lexed as this and later transformed to words.~~ + Indent(usize), // indentation. denotes line breaks and scope at which a line starts. } #[derive(Clone, PartialEq)] -- cgit v1.2.3-70-g09d2