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

# SYNTAX: 1.

# SYNTAX: 1.1
# keys and values should display differently
# sections should be highlighted
[a]
    b = c
    [[d]]
        -j = k  # keys can have hyphens
        j j = k  # and spaces
        g = h=i  # values can have equals
        e = "f"  # and quotes
        e = "${HOME} `$HOME`"  # and funny characters
    [[l, m, n]]  # sections can contain commas
        [[[o]]]  # sections can be deeply nested

# SYNTAX: 1.2
l=m  # no comment

# SYNTAX: 1.3
# display should be consistent throughout multi-line string
n = """foo"""
n = """
    foo
    bar
    baz
"""

# SYNTAX: 1.4
# highlighting should be consistent with the following examples
%include bar
%include "bar/baz"
%include "baz/bo ol"


# SYNTAX: 2.
R1 = """
    # settings should not be highlighted here
    a = b

    # SYNTAX: 2.1
    # tasks and dependency arrows should display differently
    foo => bar
    foo=>bar

    # chaining should work in-line and across lines ending in `=>` or `|`
    foo => bar => baz
    foo => bar =>
    pub => baz
    foo => \
    bar => \
    pub

    # SYNTAX: 2.2
    # comment highlighting should be un-affected
    foo => bar  # pub
    foo => bar  # pub => baz

    # SYNTAX: 2.3
    # &|() should be highlighted
    # !foo should be highlighted
    # ! foo should NOT be highlighted
    foo | bar & baz => pub & qux
    (foo | bar) & baz => (pub & qux)
    foo => !foo & bar
    ! foo => bar

    # SYNTAX: 2.4
    # text inside <> should be highlighted
    # optionally suite / task could be highlighted
    <other.suite::foo> => foo
    foo & <other.suite::task_bar> => baz

    # SYNTAX: 2.5
    # @x should be highlighted
    @wall_clock => foo
    foo & @myxtrig1 => bar

    # SYNTAX: 2.6
    # text inside <> should be highlighted
    foo<x> => bar<x>
    <x> => <y>

    # SYNTAX: 2.7
    # text inside <> should be highlighted
    # optionally +- could be highlighted
    <x-1> => <x+1>
    <x - 1> => <x + 1>

    # SYNTAX: 2.8
    # text inside <> should be highlighted
    # optionally = could be highlighted
    a<x=1> => a<x=2>
    a<x = 1> => a<x = 2>

    # SYNTAX: 2.9
    # qualifier should be highlighted, whole and nothing but
    foo:succeed => bar
    pub & foo:fail => bar
    FOO:succeed-all => bar
    foo:custom_a => bar

    # SYNTAX: 2.10
    # inter-cycle dep should be highlighted
    # integer intervals:
    foo[P1] => bar
    foo[-P1] => bar
    # iso8601 intervals:
    foo[P1D] => bar
    foo[-P1D] => bar
    foo[P1DT1M] => bar
    foo[PT1M] => bar
    foo[-P1Y1M1DT1H1M1S] => bar
    foo[^] => bar
    # integer points:
    foo[123] => bar
    foo[-123] => bar
    # iso8601 points:
    foo[20000000T0000] => bar
    foo[2000-01-01T00:00] => bar
    foo[2000-01-01T00] => bar
    foo[2000-01-01] => bar
    foo[2000-00] => bar
    foo[2000] => bar
    # arithmetic:
    foo[^+P1D]
    foo[^+P1]
    foo[20000101T0000+P1D]
    foo[2+P1]
    # optionally invalid syntax can be marked as erroneous:
    foo[2000T00] => bar  # corrupted date
    foo[2000-01-01T0000] => bar  # mixed long and short syntax (-:)
    foo[20000101T00:00] => bar  # mixed long and short syntax (-:)
    foo[P1D1Y] => bar  # missing T separator
    foo[P1H] => bar  # missing T separator
    foo[PT1M1H] => bar  # incorrect component ordering
    foo[01T00] => bar  # truncated date
    foo[T00] => bar  # truncated date
"""

# graph strings should not highlight here, this should display as a setting:
foo => bar => baz => quz
