mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-23 08:48:03 +00:00
691 B
691 B
META
description=If expression with numeric comparison
type=expr
SOURCE
if 5 > 3 1 else 2
EXPECTED
NIL
PROBLEMS
NIL
TOKENS
KwIf,Int,OpGreaterThan,Int,Int,KwElse,Int,
EndOfFile,
PARSE
(e-if-then-else
(e-binop (op ">")
(e-int (raw "5"))
(e-int (raw "3")))
(e-int (raw "1"))
(e-int (raw "2")))
FORMATTED
NO CHANGE
CANONICALIZE
(e-if
(if-branches
(if-branch
(e-binop (op "gt")
(e-num (value "5"))
(e-num (value "3")))
(e-num (value "1"))))
(if-else
(e-num (value "2"))))
TYPES
(expr (type "a where [a.from_numeral : Numeral -> Try(a, [InvalidNumeral(Str)])]"))