Skip to content

Commit dcfc52e

Browse files
committed
fix not considering some commas as literals
In some cases, especially after parentheses, commas are mistakenly not considered as "literal characters" (per 1.1.4:7) because they are not wrapped in '$$' signs. $ rg '\(\$\$,\$\$' | wc -l 27 $ rg '\(,' | wc -l 7
1 parent 0017904 commit dcfc52e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/attributes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Attributes
3838
| $$=$$ Expression
3939
4040
AttributeContentList ::=
41-
AttributeContent (, AttributeContent)* ,?
41+
AttributeContent ($$,$$ AttributeContent)* $$,$$?
4242

4343
.. rubric:: Legality Rules
4444

@@ -472,7 +472,7 @@ Attribute ``target_feature``
472472
$$target_feature$$ $$($$ $$enable$$ $$=$$ $$"$$ FeatureList $$"$$ $$)$$
473473

474474
FeatureList ::=
475-
Feature (, Feature)*
475+
Feature ($$,$$ Feature)*
476476

477477
Feature ::=
478478
$$adx$$
@@ -1030,7 +1030,7 @@ Attribute ``link``
10301030
$$name$$ $$=$$ StringLiteral
10311031

10321032
NativeLibraryNameWithKind ::=
1033-
NativeLibraryName , NativeLibrayKind
1033+
NativeLibraryName $$,$$ NativeLibrayKind
10341034

10351035
WebAssemblyModuleName ::=
10361036
$$wasm_import_module$$ $$=$$ StringLiteral

src/generics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ Where Clauses
246246
$$where$$ WhereClausePredicateList
247247

248248
WhereClausePredicateList ::=
249-
WhereClausePredicate (, WhereClausePredicate)* $$,$$?
249+
WhereClausePredicate ($$,$$ WhereClausePredicate)* $$,$$?
250250

251251
WhereClausePredicate ::=
252252
LifetimeBoundPredicate

src/patterns.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,13 +769,13 @@ Record Struct Patterns
769769

770770
RecordStructPatternContent ::=
771771
RecordStructRestPattern
772-
| FieldDeconstructorList (, RecordStructRestPattern | ,?)
772+
| FieldDeconstructorList ($$,$$ RecordStructRestPattern | $$,$$?)
773773
774774
RecordStructRestPattern ::=
775775
OuterAttributeOrDoc* RestPattern
776776

777777
FieldDeconstructorList ::=
778-
FieldDeconstructor (, FieldDeconstructor)*
778+
FieldDeconstructor ($$,$$ FieldDeconstructor)*
779779

780780
FieldDeconstructor ::=
781781
OuterAttributeOrDoc* (

src/types-and-traits.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Types
2323
| TypeSpecificationWithoutBounds
2424
2525
TypeSpecificationList ::=
26-
TypeSpecification (, TypeSpecification)* $$,$$?
26+
TypeSpecification ($$,$$ TypeSpecification)* $$,$$?
2727

2828
TypeSpecificationWithoutBounds ::=
2929
ArrayTypeSpecification
@@ -576,7 +576,7 @@ Tuple Types
576576
$$($$ TupleFieldList? $$)$$
577577

578578
TupleFieldList ::=
579-
TupleField (, TupleField)* ,?
579+
TupleField ($$,$$ TupleField)* $$,$$?
580580

581581
TupleField ::=
582582
TypeSpecification

0 commit comments

Comments
 (0)