File tree 6 files changed +26
-3
lines changed
6 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ use serde_json::{from_value as from_json, to_value as to_json};
26
26
// TODO:
27
27
// - Implement text document API, instead of reading from disk.
28
28
// - Record spans in tokens.
29
+ // - About lazy analyses and ties between syntax and semantics:
30
+ // https://rust-analyzer.github.io/blog/2023/12/26/the-heart-of-a-language-server.html
31
+ // - To infer imports, it could eagerly parse every Whitespace file. For
32
+ // inactive files, only labels would need to be retained, instead of the
33
+ // full CST.
29
34
30
35
fn main ( ) {
31
36
if let Err ( err) = do_main ( ) {
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ use crate::{
27
27
// - Allow using invalid mnemonics as label defs and refs.
28
28
// - Allow adjacent instructions without slashes. At every misplaced mnemonic,
29
29
// unless the previous was `rep` or it's used as a label, start a new token.
30
+ // - Recover `break:` as `label break`, instead of `jmp reak:`.
30
31
31
32
/// A parser for the Palaiologos Whitespace assembly dialect.
32
33
#[ derive( Clone , Debug ) ]
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ use enumset::{EnumSet, EnumSetType};
6
6
7
7
use crate :: syntax:: { HasError , Pretty } ;
8
8
9
+ // TODO:
10
+ // - Block comments should be parsed into a list or even hierarchy of tokens.
11
+ // - Line comments within block comments could be highlighted differently.
12
+
9
13
/// Line comment token (e.g., `#` or `//`).
10
14
#[ derive( Clone , DebugCustom , PartialEq , Eq ) ]
11
15
pub struct LineCommentToken < ' s > {
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use rug::Integer;
6
6
use crate :: { lex:: Scanner , tokens:: integer:: BaseStyle } ;
7
7
8
8
// TODO:
9
+ // - Parse parens as `GroupToken`.
9
10
// - Implement remainder of parsing, particularly digits.
10
11
// - Handle digit separator position errors.
11
12
// - Handle `0` octal prefix and `0b`/`0B` prefix as digits for `h`/`H` suffix.
Original file line number Diff line number Diff line change @@ -9,10 +9,13 @@ use enumset::{EnumSet, EnumSetType};
9
9
use crate :: syntax:: { HasError , Pretty } ;
10
10
11
11
// TODO:
12
+ // - String tokens could be like `format_args!` and have a list of literal
13
+ // chunks and escapes, where each escape would have source and parsed
14
+ // interpretations and its own errors.
12
15
// - Create StringSyntax to describe escapes.
13
16
// - How to represent char literals with buggy delimiters, like those allowed
14
17
// with littleBugHunter's `'..` pattern? Maybe QuoteStyle::Custom with open
15
- // and close.
18
+ // and close. Or just mark it as unterminated and error.
16
19
// - Improve Debug for CharData::Byte.
17
20
18
21
/// A string literal token.
Original file line number Diff line number Diff line change @@ -22,9 +22,18 @@ use crate::{
22
22
} ;
23
23
24
24
// TODO:
25
- // - Whitelips, Lime, and Respace macro definitions.
26
- // - Respace `@define`.
27
25
// - Store spans in tokens.
26
+ // - `Spanned<T>` or `Loc<T>`.
27
+ // - Use length-based spans, instead of offsets, like Rowan. Since the root
28
+ // node has the length of the full file, it needs to be `u64`, not shorter.
29
+ // - Organization:
30
+ // - Merge `Token` into CST.
31
+ // - Remove Token suffix from type names. What about `StringToken`?
32
+ // - Possibly reference enum variants as `cst::Variant` like `ty::FnDef(_, _)`
33
+ // for `rustc_middle::ty::TyKind::FnDef(_, _)`.
34
+ // - Features:
35
+ // - Whitelips, Lime, and Respace macro definitions.
36
+ // - Respace `@define`.
28
37
// - Store byte string uniformly (named Text?), instead of a mix of &[u8] and
29
38
// Cow.
30
39
// - Create utilities for slicing and manipulating easier than Cow.
You can’t perform that action at this time.
0 commit comments