Skip to content

Commit

Permalink
syntax: feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sadielbartholomew authored and oliver-sanders committed Jan 16, 2019
1 parent a10f26d commit 8ca36e3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 10 deletions.
35 changes: 32 additions & 3 deletions etc/syntax/reference-files/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
g = h=i # values can have equals
e = "f" # and quotes
e = "${HOME} `$HOME`" # and funny characters
[[l, m, n]] # sections can be contain commas
[[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 consistant throught multi-line string
# display should be consistent throughout multi-line string
n = """foo"""
n = """
foo
Expand Down Expand Up @@ -104,11 +104,40 @@ graph = """

# 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
foo[123] => bar # optionally invalid offsets should display as an error
# 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:
Expand Down
6 changes: 3 additions & 3 deletions etc/syntax/reference-files/suite_empy.rc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SYNTAX numbering matches the table in https://github.com/cylc/cylc/issues/2752

# SYNTAX: 3.2
# templating code should be displayed diffently to cylc code
# templating code should be displayed differently to cylc code
@# no comment # should display as a comment
@foo
@{foo="bar"}
Expand Down Expand Up @@ -32,8 +32,8 @@ foo = @@ # the @@ should NOT be highlighted
@os.environ
@`x`
@:2 + 2:
:%title "Cylc"
**'@<CONTENTS>'** # ???
@%title "Cylc"
**'@<CONTENTS>'** # custom markup
@[def f(x, y=z, **kwargs)] @[end def]
@[try] @[except]

Expand Down
9 changes: 5 additions & 4 deletions etc/syntax/reference-files/suite_jinja2.rc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SYNTAX numbering matches the table in https://github.com/cylc/cylc/issues/2752

# SYNTAX: 3.2
# templating code should be displayed diffently to cylc code
# templating code should be displayed differently to cylc code
{# no comment #} # should display as a comment
{% set foo = "bar" %}
{% set foo = '%s' % 'bar' %}
Expand All @@ -19,13 +19,14 @@
{% from 'foo' import foo as a, b %}

# SYNTAX 3.3
# multi-line templating code should be consistent with single-line code
# multi-line template code should appear the same as single-line template code
# if it were distributed over multiple lines
{#
no comment
#} # all three lines should display as a single comment
#} # all three lines should display as a single comment with no gaps
{# a
b
c #} # all three lines should display as a single comment
c #} # all three lines should display as a single comment with no gaps
{%
set foo = {"1": 2, "3", []}
%}
Expand Down

0 comments on commit 8ca36e3

Please sign in to comment.