frg 2.0.2

Compiled programming language with frogs!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::{TreeCursor, Expression, expressions};

pub fn parse(cursor: &mut TreeCursor, code: &str) -> Box<Expression> {
    cursor.goto_first_child();

    // skip "("
    cursor.goto_next_sibling();
    let inner = Box::new(expressions::parse(cursor, code));

    cursor.goto_parent();
    inner
}

pub fn transpile(inner: &Expression) -> String {
    let contents = expressions::transpile(inner);
    format!("({contents})")
}