roc/test/snapshots/expr/tuple.md
2025-12-01 22:52:21 -05:00

43 lines
663 B
Markdown

# META
~~~ini
description=Tuple expression
type=expr
~~~
# SOURCE
~~~roc
(1, "hello", True)
~~~
# EXPECTED
NIL
# PROBLEMS
NIL
# TOKENS
~~~zig
OpenRound,Int,Comma,StringStart,StringPart,StringEnd,Comma,UpperIdent,CloseRound,
EndOfFile,
~~~
# PARSE
~~~clojure
(e-tuple
(e-int (raw "1"))
(e-string
(e-string-part (raw "hello")))
(e-tag (raw "True")))
~~~
# FORMATTED
~~~roc
NO CHANGE
~~~
# CANONICALIZE
~~~clojure
(e-tuple
(elems
(e-num (value "1"))
(e-string
(e-literal (string "hello")))
(e-tag (name "True"))))
~~~
# TYPES
~~~clojure
(expr (type "(a, Str, [True, .._others]) where [a.from_numeral : Numeral -> Try(a, [InvalidNumeral(Str)])]"))
~~~