Include comment text in token

This commit is contained in:
harupy 2023-01-06 23:29:20 +09:00
parent 2dfd053bed
commit a4a5366504
4 changed files with 11 additions and 10 deletions

View file

@ -37,7 +37,7 @@ pub enum Tok {
Rsqb,
Colon,
Comma,
Comment,
Comment(String),
Semi,
Plus,
Minus,
@ -148,7 +148,7 @@ impl fmt::Display for Tok {
Rsqb => f.write_str("']'"),
Colon => f.write_str("':'"),
Comma => f.write_str("','"),
Comment => f.write_str("#"),
Comment(value) => f.write_str(value),
Semi => f.write_str("';'"),
Plus => f.write_str("'+'"),
Minus => f.write_str("'-'"),