summary refs log blame commit diff stats
path: root/tests/parser/tletcolon.nim
blob: eab7a8eddb9f657ccfe4c8084720e59a811797e4 (plain) (tree)



















                                

               











                       

















                                                                               
discard """
  output: '''boo
3
44 3
more body code
yes
yes'''
"""

template x(body): untyped =
  body
  44

template y(val, body): untyped =
  body
  val

proc mana =
  let foo = x:
    echo "boo"
  var foo2: int
  foo2 = y 3:
    echo "3"
  echo foo, " ", foo2

mana()
let other = x:
  echo "more body code"
  if true:
    echo "yes"
  else:
    echo "no"
let outer = y(5):
  echo "yes"


# bug #6609
type
  TextureInternalFormat = enum RED, RGB, RGBA

const channels = 4

let format =
    if channels == 1:
        TextureInternalFormat.RED
    elif channels == 3:
        TextureInternalFormat.RGB
    elif channels == 4:
        TextureInternalFormat.RGBA
    else:
        echo "Texture Format Unknown, assuming RGB"  #This echo causes an error
        TextureInternalFormat.RGB