roc/test/snapshots/expr/lambda_simple.md
Jared Ramirez 2a2ff8d093
Cleanup
2025-11-09 09:59:56 -05:00

582 B

META

description=Lambda expression
type=expr

SOURCE

|x| x + 1

EXPECTED

NIL

PROBLEMS

NIL

TOKENS

OpBar,LowerIdent,OpBar,LowerIdent,OpPlus,Int,
EndOfFile,

PARSE

(e-lambda
	(args
		(p-ident (raw "x")))
	(e-binop (op "+")
		(e-ident (raw "x"))
		(e-int (raw "1"))))

FORMATTED

NO CHANGE

CANONICALIZE

(e-lambda
	(args
		(p-assign (ident "x")))
	(e-binop (op "add")
		(e-lookup-local
			(p-assign (ident "x")))
		(e-num (value "1"))))

TYPES

(expr (type "Num(_size) -> Num(_size2)"))