From dcfc52e2f46945f0856afeae07625bfc898a986d Mon Sep 17 00:00:00 2001 From: Ruslan Akbashev Date: Thu, 15 May 2025 18:58:26 +0400 Subject: [PATCH] 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 --- src/attributes.rst | 6 +++--- src/generics.rst | 2 +- src/patterns.rst | 4 ++-- src/types-and-traits.rst | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/attributes.rst b/src/attributes.rst index eea216e7..35fabc0c 100644 --- a/src/attributes.rst +++ b/src/attributes.rst @@ -38,7 +38,7 @@ Attributes | $$=$$ Expression AttributeContentList ::= - AttributeContent (, AttributeContent)* ,? + AttributeContent ($$,$$ AttributeContent)* $$,$$? .. rubric:: Legality Rules @@ -472,7 +472,7 @@ Attribute ``target_feature`` $$target_feature$$ $$($$ $$enable$$ $$=$$ $$"$$ FeatureList $$"$$ $$)$$ FeatureList ::= - Feature (, Feature)* + Feature ($$,$$ Feature)* Feature ::= $$adx$$ @@ -1030,7 +1030,7 @@ Attribute ``link`` $$name$$ $$=$$ StringLiteral NativeLibraryNameWithKind ::= - NativeLibraryName , NativeLibrayKind + NativeLibraryName $$,$$ NativeLibrayKind WebAssemblyModuleName ::= $$wasm_import_module$$ $$=$$ StringLiteral diff --git a/src/generics.rst b/src/generics.rst index a1df5c0f..bedd3d1c 100644 --- a/src/generics.rst +++ b/src/generics.rst @@ -246,7 +246,7 @@ Where Clauses $$where$$ WhereClausePredicateList WhereClausePredicateList ::= - WhereClausePredicate (, WhereClausePredicate)* $$,$$? + WhereClausePredicate ($$,$$ WhereClausePredicate)* $$,$$? WhereClausePredicate ::= LifetimeBoundPredicate diff --git a/src/patterns.rst b/src/patterns.rst index f482864a..6140e90c 100644 --- a/src/patterns.rst +++ b/src/patterns.rst @@ -769,13 +769,13 @@ Record Struct Patterns RecordStructPatternContent ::= RecordStructRestPattern - | FieldDeconstructorList (, RecordStructRestPattern | ,?) + | FieldDeconstructorList ($$,$$ RecordStructRestPattern | $$,$$?) RecordStructRestPattern ::= OuterAttributeOrDoc* RestPattern FieldDeconstructorList ::= - FieldDeconstructor (, FieldDeconstructor)* + FieldDeconstructor ($$,$$ FieldDeconstructor)* FieldDeconstructor ::= OuterAttributeOrDoc* ( diff --git a/src/types-and-traits.rst b/src/types-and-traits.rst index 3b780f27..1982ef09 100644 --- a/src/types-and-traits.rst +++ b/src/types-and-traits.rst @@ -23,7 +23,7 @@ Types | TypeSpecificationWithoutBounds TypeSpecificationList ::= - TypeSpecification (, TypeSpecification)* $$,$$? + TypeSpecification ($$,$$ TypeSpecification)* $$,$$? TypeSpecificationWithoutBounds ::= ArrayTypeSpecification @@ -576,7 +576,7 @@ Tuple Types $$($$ TupleFieldList? $$)$$ TupleFieldList ::= - TupleField (, TupleField)* ,? + TupleField ($$,$$ TupleField)* $$,$$? TupleField ::= TypeSpecification