Remove asType [type] Exp
in favor of function call: #Sort ( Exp, Kwparams)
#889
Labels
[type] Exp
in favor of function call: #Sort ( Exp, Kwparams)
#889
A parser is a function from
str
toTree
anyway and we might as well use the function call syntax for this instead of having an entire operator dedicated to this. If we look at a reified type as a parser function, we might start writing this:#Statement ( "if (true) println(\"hello\");", origin=myLoc)
It's nice that functions can have keyword parameters, i.e. to provide the
origin
of the string, etc. Now we call theparse
function from the standard library all the time instead of using[Statement] "if (true) println(\"hello\");"
, simply because we can't pass the necessary parameters.This would make Rascal smaller. Which is also a good thing.
It is of course an addition for the type checker (a special case for callortree), where the return type of calling a parser is equal to the reified type. This mimicks the behavior of the
[...]
operator in this respect.Comments welcome.
The text was updated successfully, but these errors were encountered: