module demo::lang::pico::Extensions
rascal-0.43.0
org.rascalmpl.rascal-lsp-2.23.0
Usage
import demo::lang::pico::Extensions;
Dependencies
extend lang::pico::\syntax::Main;
syntax IdType
syntax IdType
= function: Id id "(" {IdType ","}* args ")" ":" Type retType ":=" Expression body
;
syntax Expression
syntax Expression
= call: Id id "(" {Expression ","}* args ")"
;
function typeOf
str typeOf((IdType) `<Id id>(<{IdType ","}* args>): <Type retType> := <Expression body>`)
= "<id>(<intercalate(", ", [typeOf(a) | a <- args])>): <retType>";