File tree Expand file tree Collapse file tree 5 files changed +1020
-14
lines changed Expand file tree Collapse file tree 5 files changed +1020
-14
lines changed Original file line number Diff line number Diff line change @@ -131,22 +131,20 @@ export class FTLParserStream extends ParserStream {
131
131
return isDigit ;
132
132
}
133
133
134
- isCharPatternStart ( ch ) {
134
+ isCharPatternContinuation ( ch ) {
135
135
return ! includes ( SPECIAL_LINE_START_CHARS , ch ) ;
136
136
}
137
137
138
138
isPeekPatternStart ( ) {
139
139
this . peekInlineWS ( ) ;
140
-
141
140
const ch = this . currentPeek ( ) ;
142
141
143
- if ( ch === '\n' ) {
144
- return this . isPeekNextLinePatternStart ( ) ;
142
+ // Inline Patterns may start with any char.
143
+ if ( ch !== undefined && ch !== '\n' ) {
144
+ return true ;
145
145
}
146
146
147
- const isPattern = this . isCharPatternStart ( this . currentPeek ( ) ) ;
148
- this . resetPeek ( ) ;
149
- return isPattern ;
147
+ return this . isPeekNextLinePatternStart ( ) ;
150
148
}
151
149
152
150
isPeekNextLineZeroFourStyleComment ( ) {
@@ -276,7 +274,7 @@ export class FTLParserStream extends ParserStream {
276
274
return false ;
277
275
}
278
276
279
- if ( ! this . isCharPatternStart ( this . currentPeek ( ) ) ) {
277
+ if ( ! this . isCharPatternContinuation ( this . currentPeek ( ) ) ) {
280
278
this . resetPeek ( ) ;
281
279
return false ;
282
280
}
Original file line number Diff line number Diff line change
1
+ key01 = .Value
2
+ key02 = …Value
3
+ key03 = { " . " } Value
4
+ key04 =
5
+ { " . " } Value
6
+
7
+ key05 = Value
8
+ { " . " } Continued
9
+
10
+ key06 = .Value
11
+ { " . " } Continued
12
+
13
+ # ERROR (attr .Continued must have a value)
14
+ key07 = Value
15
+ .Continued
16
+
17
+ # ERROR (attr .Value must have a value)
18
+ key08 =
19
+ .Value
20
+
21
+ # ERROR (attr .Value must have a value)
22
+ key09 =
23
+ .Value
24
+ Continued
25
+
26
+ key10 =
27
+ .Value = which looks like an attribute
28
+ Continued
29
+
30
+ key11 =
31
+ { " . " } Value = which looks like an attribute
32
+ Continued
33
+
34
+ key12 =
35
+ .accesskey =
36
+ A
37
+
38
+ key13 =
39
+ .attribute = .Value
40
+
41
+ key14 =
42
+ .attribute =
43
+ { " . " } Value
44
+
45
+ key15 =
46
+ { 1 ->
47
+ [ one ] .Value
48
+ *[ other ]
49
+ { " . " } Value
50
+ }
51
+
52
+ # ERROR (variant must have a value)
53
+ key16 =
54
+ { 1 ->
55
+ *[ one ]
56
+ .Value
57
+ }
58
+
59
+ # ERROR (unclosed placeable)
60
+ key17 =
61
+ { 1 ->
62
+ *[ one ] Value
63
+ .Continued
64
+ }
You can’t perform that action at this time.
0 commit comments