Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some grammars needed formatting fixes #3871

Merged
merged 2 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions algol60/algol60.g4
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ fragment Digit
fragment ULCorner_f options {
caseInsensitive = false;
}
: '\u231C';
: '\u231C'
;

ULCorner
: ULCorner_f
Expand All @@ -276,7 +277,8 @@ ULCorner
fragment URCorner_f options {
caseInsensitive = false;
}
: '\u231D';
: '\u231D'
;

URCorner
: URCorner_f
Expand Down Expand Up @@ -441,7 +443,8 @@ number
fragment Proper_string options {
caseInsensitive = false;
}
: ~('\u231C' | '\u231D')*;
: ~('\u231C' | '\u231D')*
;

fragment Open_string
: Proper_string
Expand Down
12 changes: 6 additions & 6 deletions css3/css3Parser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ attrib
;

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

Expand All @@ -137,8 +137,8 @@ functionalPseudo
;

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

Expand Down
16 changes: 10 additions & 6 deletions dot/DOT.g4
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ id_

// "The keywords node, edge, graph, digraph, subgraph, and strict are
// case-independent"

STRICT
: [Ss] [Tt] [Rr] [Ii] [Cc] [Tt]
;
Expand All @@ -125,21 +124,24 @@ SUBGRAPH
: [Ss] [Uu] [Bb] [Gg] [Rr] [Aa] [Pp] [Hh]
;

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

fragment DIGIT
: [0-9]
;

/** "any double-quoted string ("...") possibly containing escaped quotes" */ STRING
/** "any double-quoted string ("...") possibly containing escaped quotes" */
STRING
: '"' ('\\"' | .)*? '"'
;

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

Expand All @@ -149,7 +151,8 @@ fragment LETTER

/** "HTML strings, angle brackets must occur in matched pairs, and
* unescaped newlines are allowed."
*/ HTML_STRING
*/
HTML_STRING
: '<' (TAG | ~ [<>])* '>'
;

Expand All @@ -167,7 +170,8 @@ LINE_COMMENT

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

Expand Down
4 changes: 2 additions & 2 deletions json/JSON.g4
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ NUMBER
;

fragment INT
// integer part forbis leading 0s (e.g. `01`)
// integer part forbis leading 0s (e.g. `01`)
: '0'
| [1-9] [0-9]*
;

// no leading zeros

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

Expand Down
2 changes: 1 addition & 1 deletion lpc/LPC.g4
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ NotEqual
;

Compare
//: '<'
//: '<'
: LessEqual
| Great
| GreatEqual
Expand Down
Loading