summaryrefslogtreecommitdiff
path: root/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs
index fbeacc5..8e2b63c 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -75,7 +75,17 @@ pub fn process(strs: SplitWithMetadata<'_>) -> Vec<Expr<'_>> {
// TODO: fix one line if else as not delimited by {}
for s in str.split_whitespace() {
- if let Some(token) = tokenizer::parse(s) {
+ if let Some(token) = tokenizer::parse(if let len = s.len() {
+ if s.starts_with("println") {
+ "println"
+ } else if s.starts_with("throw") {
+ "throw"
+ } else {
+ s
+ }
+ } else {
+ s
+ }) {
match token {
If(t) => {
if let Some(ExprT::Decision((_, Scope::If(If::Else)))) = exp {