JSTQL-JS-Transform/dsl_files/do.jstql

33 lines
839 B
Text
Raw Normal View History

proposal DoExpression{
case arrowFunction{
applicable to {
"let <<ident:Identifier>> = () => {
2024-05-22 12:44:45 +00:00
<<statements: (Statement && !ReturnStatement)+>>
return <<returnVal : Expression>>;
}
"
}
transform to {
"let <<ident>> = do {
<<statements>>
<<returnVal>>
}"
}
}
case immediatelyInvokedUnnamedFunction {
applicable to {
"let <<ident:Identifier>> = function(){
2024-05-22 12:44:45 +00:00
<<statements: (Statement && !ReturnStatement)+>>
return <<returnVal : Expression>>;
}();"
}
transform to {
"let <<ident>> = do {
<<statements>>
<<returnVal>>
}"
}
}
}