Skip to content

Commit 5660ba5

Browse files
authored
Some grammars needed formatting fixes (#3871)
* Some grammars needed formatting fixes The formatter had a few bugs that have been fixed now. * Some grammars needed formatting fixes The formatter had a few bugs that have been fixed now. Closes #3863 additional issue with formatting
1 parent b6b2eb8 commit 5660ba5

File tree

16 files changed

+1502
-1481
lines changed

16 files changed

+1502
-1481
lines changed

algol60/algol60.g4

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ fragment Digit
267267
fragment ULCorner_f options {
268268
caseInsensitive = false;
269269
}
270-
: '\u231C';
270+
: '\u231C'
271+
;
271272

272273
ULCorner
273274
: ULCorner_f
@@ -276,7 +277,8 @@ ULCorner
276277
fragment URCorner_f options {
277278
caseInsensitive = false;
278279
}
279-
: '\u231D';
280+
: '\u231D'
281+
;
280282

281283
URCorner
282284
: URCorner_f
@@ -441,7 +443,8 @@ number
441443
fragment Proper_string options {
442444
caseInsensitive = false;
443445
}
444-
: ~('\u231C' | '\u231D')*;
446+
: ~('\u231C' | '\u231D')*
447+
;
445448

446449
fragment Open_string
447450
: Proper_string

css3/css3Parser.g4

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ attrib
125125
;
126126

127127
pseudo
128-
/* '::' starts a pseudo-element, ':' a pseudo-class */
129-
/* Exceptions: :first-line, :first-letter, :before And :after. */
130-
/* Note that pseudo-elements are restricted to one per selector And */
131-
/* occur MediaOnly in the last simple_selector_sequence. */
128+
/* '::' starts a pseudo-element, ':' a pseudo-class */
129+
/* Exceptions: :first-line, :first-letter, :before And :after. */
130+
/* Note that pseudo-elements are restricted to one per selector And */
131+
/* occur MediaOnly in the last simple_selector_sequence. */
132132
: ':' ':'? (ident | functionalPseudo)
133133
;
134134

@@ -137,8 +137,8 @@ functionalPseudo
137137
;
138138

139139
expression
140-
/* In CSS3, the expressions are identifiers, strings, */
141-
/* or of the form "an+b" */
140+
/* In CSS3, the expressions are identifiers, strings, */
141+
/* or of the form "an+b" */
142142
: (( Plus | Minus | Dimension | UnknownDimension | Number | String_ | ident) ws)+
143143
;
144144

dot/DOT.g4

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ id_
100100

101101
// "The keywords node, edge, graph, digraph, subgraph, and strict are
102102
// case-independent"
103-
104103
STRICT
105104
: [Ss] [Tt] [Rr] [Ii] [Cc] [Tt]
106105
;
@@ -125,21 +124,24 @@ SUBGRAPH
125124
: [Ss] [Uu] [Bb] [Gg] [Rr] [Aa] [Pp] [Hh]
126125
;
127126

128-
/** "a numeral [-]?(.[0-9]+ | [0-9]+(.[0-9]*)? )" */ NUMBER
127+
/** "a numeral [-]?(.[0-9]+ | [0-9]+(.[0-9]*)? )" */
128+
NUMBER
129129
: '-'? ('.' DIGIT+ | DIGIT+ ( '.' DIGIT*)?)
130130
;
131131

132132
fragment DIGIT
133133
: [0-9]
134134
;
135135

136-
/** "any double-quoted string ("...") possibly containing escaped quotes" */ STRING
136+
/** "any double-quoted string ("...") possibly containing escaped quotes" */
137+
STRING
137138
: '"' ('\\"' | .)*? '"'
138139
;
139140

140141
/** "Any string of alphabetic ([a-zA-Z\200-\377]) characters, underscores
141142
* ('_') or digits ([0-9]), not beginning with a digit"
142-
*/ ID
143+
*/
144+
ID
143145
: LETTER (LETTER | DIGIT)*
144146
;
145147

@@ -149,7 +151,8 @@ fragment LETTER
149151

150152
/** "HTML strings, angle brackets must occur in matched pairs, and
151153
* unescaped newlines are allowed."
152-
*/ HTML_STRING
154+
*/
155+
HTML_STRING
153156
: '<' (TAG | ~ [<>])* '>'
154157
;
155158

@@ -167,7 +170,8 @@ LINE_COMMENT
167170

168171
/** "a '#' character is considered a line output from a C preprocessor (e.g.,
169172
* # 34 to indicate line 34 ) and discarded"
170-
*/ PREPROC
173+
*/
174+
PREPROC
171175
: '#' ~[\r\n]* -> skip
172176
;
173177

json/JSON.g4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ NUMBER
6060
;
6161

6262
fragment INT
63-
// integer part forbis leading 0s (e.g. `01`)
63+
// integer part forbis leading 0s (e.g. `01`)
6464
: '0'
6565
| [1-9] [0-9]*
6666
;
6767

6868
// no leading zeros
6969

7070
fragment EXP
71-
// exponent number permits leading 0s (e.g. `1e01`)
71+
// exponent number permits leading 0s (e.g. `1e01`)
7272
: [Ee] [+\-]? [0-9]+
7373
;
7474

lpc/LPC.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ NotEqual
7777
;
7878

7979
Compare
80-
//: '<'
80+
//: '<'
8181
: LessEqual
8282
| Great
8383
| GreatEqual

0 commit comments

Comments
 (0)