-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
bidi.json
146 lines (146 loc) · 5.04 KB
/
bidi.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{
"scenario": "Bidi support",
"description": "Tests for correct parsing of messages with bidirectional marks and isolates",
"defaultTestProperties": {
"bidiIsolation": "default",
"locale": "en-US"
},
"tests": [
{
"description": "simple-message = o [simple-start pattern]",
"src": " \u061C Hello world!",
"exp": " \u061C Hello world!"
},
{
"description": "complex-message = o *(declaration o) complex-body o",
"src": "\u200E .local $x = {1} {{ {$x}}}",
"exp": " \u20681\u2069"
},
{
"description": "complex-message = o *(declaration o) complex-body o",
"src": ".local $x = {1} \u200F {{ {$x}}}",
"exp": " \u20681\u2069"
},
{
"description": "complex-message = o *(declaration o) complex-body o",
"src": ".local $x = {1} {{ {$x}}} \u2066",
"exp": " \u20681\u2069"
},
{
"description": "input-declaration = input o variable-expression",
"src": ".input \u2067 {$x :number} {{hello}}",
"params": [{"name": "x", "value": "1"}],
"exp": "hello"
},
{
"description": "local s variable o \"=\" o expression",
"src": ".local $x \u2068 = \u2069 {1} {{hello}}",
"exp": "hello"
},
{
"description": "local s variable o \"=\" o expression",
"src": ".local \u2067 $x = {1} {{hello}}",
"exp": "hello"
},
{
"description": "local s variable o \"=\" o expression",
"src": ".local\u2067 $x = {1} {{hello}}",
"exp": "hello"
},
{
"description": "o \"{{\" pattern \"}}\"",
"src": "\u2067 {{hello}}",
"exp": "hello"
},
{
"description": "match-statement s variant *(o variant)",
"src": ".local $x = {1 :number}\n.match $x\n1 {{one}}\n\u061C * {{other}}",
"exp": "one"
},
{
"description": "match-statement s variant *(o variant)",
"src": ".local $x = {1 :number}.match $x \u061c1 {{one}}* {{other}}",
"exp": "one"
},
{
"description": "match-statement s variant *(o variant)",
"src": ".local $x = {1 :number}.match $x\u061c1 {{one}}* {{other}}",
"expErrors": [{"type": "syntax-error"}]
},
{
"description": "variant = key *(s key) quoted-pattern",
"src": ".local $x = {1 :number} .local $y = {$x :number}.match $x $y\n1 \u200E 1 {{one}}* * {{other}}",
"exp": "one"
},
{
"description": "variant = key *(s key) quoted-pattern",
"src": ".local $x = {1 :number} .local $y = {$x :number}.match $x $y\n1\u200E 1 {{one}}* * {{other}}",
"exp": "one"
},
{
"description": "literal-expression = \"{\" o literal [s function] *(s attribute) o \"}\"",
"src": "{\u200E hello \u200F}",
"exp": "\u2068hello\u2069"
},
{
"description": "variable-expression = \"{\" o variable [s function] *(s attribute) o \"}\"",
"src": ".local $x = {1} {{ {\u200E $x \u200F} }}",
"exp": " \u20681\u2069 "
},
{
"description": "function-expression = \"{\" o function *(s attribute) o \"}\"",
"src": "{1 \u200E :number \u200F}",
"exp": "1"
},
{
"description": "markup = \"{\" o \"#\" identifier *(s option) *(s attribute) o [\"/\"] \"}\"",
"src": "{\u200F #b \u200E }",
"exp": ""
},
{
"description": "markup = \"{\" o \"/\" identifier *(s option) *(s attribute) o \"}\"",
"src": "{\u200F /b \u200E }",
"exp": ""
},
{
"description": "option = identifier o \"=\" o (literal / variable)",
"src": "{1 :number minimumFractionDigits\u200F=\u200E1 }",
"exp": "1.0"
},
{
"description": "attribute = \"@\" identifier [o \"=\" o (literal / variable)]",
"src": "{1 :number @locale\u200F=\u200Een }",
"exp": "1"
},
{
"description": " name... excludes U+FFFD and U+061C -- this pases as name -> [bidi] name-start *name-char",
"src": ".local $\u061Cfoo = {1} {{ {$\u061Cfoo} }}",
"exp": " \u20681\u2069 "
},
{
"description": " name matches https://www.w3.org/TR/REC-xml-names/#NT-NCName but excludes U+FFFD and U+061C",
"src": ".local $foo\u061Cbar = {2} {{ }}",
"expErrors": [{"type": "syntax-error"}]
},
{
"description": "name = [bidi] name-start *name-char [bidi]",
"src": ".local $\u200Efoo\u200F = {3} {{{$\u200Efoo\u200F}}}",
"exp": "\u20683\u2069"
},
{
"description": "name = [bidi] name-start *name-char [bidi]",
"src": ".local $foo = {4} {{{$\u200Efoo\u200F}}}",
"exp": "\u20684\u2069"
},
{
"description": "name = [bidi] name-start *name-char [bidi]",
"src": ".local $\u200Efoo\u200F = {5} {{{$foo}}}",
"exp": "\u20685\u2069"
},
{
"description": "name = [bidi] name-start *name-char [bidi]",
"src": ".local $foo\u200Ebar = {5} {{{$foo\u200Ebar}}}",
"expErrors": [{"type": "syntax-error"}]
}
]
}