#!empy
# ^ SYNTAX:3.1

# SYNTAX numbering matches the table in https://github.com/cylc/cylc/issues/2752

# SYNTAX: 3.4
# templating code should be displayed differently to cylc code
@# no comment  # should display as a comment
@foo
@{foo="bar"}
@{ foo = "bar" }
@{ foo = "bar"; bar = "baz" }
@{ foo = '%s' % 'bar' }
@{ set foo = {"1": 2, "3", []} }  # highlight to the last }
@{ set foo = foo.bar(1, 2, 3) }  # highlight to the last }
@{ foo_bar }
@{foo_bar}
@{ foo.bar(1, 2, 3, []) }  # highlight to the last }
@[if x]a = b@[end if]  # highlight all but "a = b"
@[if x.y[]]a = b@[end if]  # highlight all but "a = b"
a = b  
# SYNTAX 3.5
# non-exhaustive list of advanced empy syntax
@# no comment
@?NewContextName
@!100
invisible@ whitespace  # the @ character should be highlighted
foo = @\0 bar @\xHH # @\0 and @\xHH should both be highlighted
foo = @@  # the @@ should NOT be highlighted
@"foo"  # this should be highlighted the same as @foo?
@( x ? "true" ! "false )
@os.environ
@`x`
@:2 + 2:
@%title  "Cylc"
**'@<CONTENTS>'**  # custom markup
@[def f(x, y=z, **kwargs)] @[end def]
@[try]  @[except]

# SYNTAX 3./1.1
# keys, values and sections outside of the templating code should display
# as normal
a = @b
@a = b
a = @( b + 1 )
a = @( b_b | c.d('1', "2", 3) )
[[@a]]
    d = e  # check highlighting of this line un-affected by section
[[@( a_a | c.d('1', "2", 3) )]]
    d = e  # check highlighting of this line un-affected by section
[[@( "%(foo)s" % {"foo": "abc"} )]]
    d = e  # check highlighting of this line un-affected by section

# SYNTAX 3./1.2
# comments outside of the templating code should display as normal
@( foo )  # foo
@{ foo }  # foo
@[ foo ]  # foo

# syntax 3./1.3
# tasks and deps outside of the templating code should display as normal
R1 = """
    foo => @( b_az.pub('1', "2", 3) ) => qux =>
@[ if BAR ]
    bar => pub
@[ else ]
    baz => pub
@[ endif ]
"""

# syntax 3./2.5
# clashing xtrigger and empy syntax should somehow be handled
R1 = """
    @wall_clock => @@bar => baz  # note empy evaluates @@ as @
"""
