source_file = { SOI ~ function_definition ~ EOI } function_definition = { fn_kw ~ identifier ~ lparen ~ parameter_list ~ rparen ~ primitive_type ~ block } fn_kw = _{ "fn" } identifier = @{ ASCII_ALPHA ~ ( ASCII_ALPHANUMERIC | "_" )* } lparen = _{ "(" } rparen = _{ ")" } parameter_list = { ( number ~ comma )* ~ number? } comma = _{ "," } primitive_type = { "int" } block = { lbrace ~ inner_block ~ rbrace } inner_block = { return_statement } lbrace = _{ "{" } rbrace = _{ "}" } return_statement = { return_kw ~ number ~ semi } return_kw = _{ "return" } number = @{ ASCII_DIGIT+ } semi = _{ ";" } WHITESPACE = _{ ( " " | "\t" | NEWLINE )+ }