Compare commits
No commits in common. "b8c4d0a6c628d5dcb906a72d9384a667a1750d96" and "2d007c977c43cc7255244f82f0a7918755ac3aee" have entirely different histories.
b8c4d0a6c6
...
2d007c977c
2 changed files with 13 additions and 21 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,6 +1,3 @@
|
||||||
/target
|
/target
|
||||||
.direnv
|
.direnv
|
||||||
.devenv
|
.devenv
|
||||||
out.png
|
|
||||||
.pre-commit-config.yaml
|
|
||||||
src
|
|
||||||
|
|
31
src/parse.rs
31
src/parse.rs
|
@ -55,22 +55,25 @@ pub fn parse_the_shit_out_of_this_but_manually<'a>(
|
||||||
Ok(Token::Text(s)) => r.push(LanguageStructureThingy::Text(s)),
|
Ok(Token::Text(s)) => r.push(LanguageStructureThingy::Text(s)),
|
||||||
Ok(Token::Newline) => r.push(LanguageStructureThingy::Text("\n".to_owned())),
|
Ok(Token::Newline) => r.push(LanguageStructureThingy::Text("\n".to_owned())),
|
||||||
Ok(Token::ParenOpen) => hehe_sexpression_funy(&mut r, &mut lex),
|
Ok(Token::ParenOpen) => hehe_sexpression_funy(&mut r, &mut lex),
|
||||||
Err(())
|
Ok(Token::String(_)) => todo!(),
|
||||||
| Ok(Token::ParenClose)
|
Ok(Token::Equals) => todo!(),
|
||||||
| Ok(Token::String(_))
|
Ok(Token::Asterisk) => todo!(),
|
||||||
| Ok(Token::Equals)
|
Ok(Token::Underscore) => todo!(),
|
||||||
| Ok(Token::Asterisk)
|
Ok(Token::Backslash) => todo!(),
|
||||||
| Ok(Token::Underscore)
|
Ok(Token::WavyThing) => todo!(),
|
||||||
| Ok(Token::Backslash)
|
Ok(Token::Sparkles) => todo!(),
|
||||||
| Ok(Token::WavyThing)
|
Ok(Token::HeadingLevelIndicator) => todo!(),
|
||||||
| Ok(Token::Sparkles)
|
Err(()) | Ok(Token::ParenClose) => {
|
||||||
| Ok(Token::HeadingLevelIndicator) => {
|
|
||||||
reporter.report_diagnostic(*file_id, loc, DiagnosticKind::InvalidToken)
|
reporter.report_diagnostic(*file_id, loc, DiagnosticKind::InvalidToken)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reporter.fail_step_if_failed();
|
reporter.fail_step_if_failed();
|
||||||
|
// match lex.next() {
|
||||||
|
// Some(Err(e)) => panic!("mauuu~ :(, e: {e:?}"),
|
||||||
|
// None => break,
|
||||||
|
// }
|
||||||
|
|
||||||
r
|
r
|
||||||
}
|
}
|
||||||
|
@ -109,11 +112,3 @@ fn hehe_sexpression_funy(r: &mut Vec<LanguageStructureThingy>, lex: &mut Lexer<'
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mk_simple_sexpression(name: impl ToString, content: impl ToString) -> LanguageStructureThingy {
|
|
||||||
LanguageStructureThingy::Sexpression {
|
|
||||||
name: name.to_string(),
|
|
||||||
attrs: HashMap::new(),
|
|
||||||
content: Box::new(LanguageStructureThingy::Text(content.to_string())),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue