mlscript icon indicating copy to clipboard operation
mlscript copied to clipboard

Proper parsing for immediate applied multi-line lambda functions

Open NeilKleistGao opened this issue 10 months ago • 0 comments

Multi-line lambda functions can be parsed as Jux:

(x =>
  x + 1)(0)
//│ FAILURE: Unexpected type error
//│ ╔══[ERROR] Illegal juxtaposition right-hand side.
//│ ║  l.46: 	  x + 1)(0)
//│ ╙──      	        ^^^

This is because an indent is inserted unexpectedly around the parameter list (0):

:dp
(x =>
  x + 1)(0)
//│ |(|x| |=>|→|x| |+| |1|←|)|→|(|0|)|←|

NeilKleistGao avatar Feb 13 '25 03:02 NeilKleistGao