diff --git a/crates/codegen/ebnf/src/builder.rs b/crates/codegen/ebnf/src/builder.rs index 3610415927..a77dc38885 100644 --- a/crates/codegen/ebnf/src/builder.rs +++ b/crates/codegen/ebnf/src/builder.rs @@ -143,8 +143,7 @@ impl Builder { let variants = variants.iter().map(|EnumVariant { reference, enabled }| { Value::new( - Self::build_label_comment(BuiltInLabel::Variant.as_ref()), - Self::build_ref(reference), + Self::build_ref(Some(BuiltInLabel::Variant.as_ref()), reference), Self::build_enabled_comment(enabled), ) }); @@ -167,20 +166,17 @@ impl Builder { self.add_entry(name, Terminal::No, Inlined::No); + let label = BuiltInLabel::Item.as_ref(); let expression = if allow_empty.unwrap_or_default() { - Expression::new_zero_or_more(Self::build_ref(reference).into()) + Expression::new_zero_or_more(Self::build_ref(Some(label), reference).into()) } else { - Expression::new_one_or_more(Self::build_ref(reference).into()) + Expression::new_one_or_more(Self::build_ref(Some(label), reference).into()) }; self.add_definition( name, Self::build_enabled_comment(enabled), - Some(Value::new( - Self::build_label_comment(BuiltInLabel::Item.as_ref()), - expression, - None, - )), + Some(Value::new(expression, None)), DefinitionKind::Sequence, ); } @@ -197,11 +193,11 @@ impl Builder { self.add_entry(name, Terminal::No, Inlined::No); let mut expression = Expression::new_sequence(vec![ - Self::build_ref(reference), + Self::build_ref(Some(BuiltInLabel::Item.as_ref()), reference), Expression::new_zero_or_more( Expression::new_sequence(vec![ - Self::build_ref(separator), - Self::build_ref(reference), + Self::build_ref(Some(BuiltInLabel::Separator.as_ref()), separator), + Self::build_ref(Some(BuiltInLabel::Item.as_ref()), reference), ]) .into(), ), @@ -214,7 +210,7 @@ impl Builder { self.add_definition( name, Self::build_enabled_comment(enabled), - Some(Value::new(None, expression, None)), + Some(Value::new(expression, None)), DefinitionKind::Sequence, ); } @@ -235,8 +231,7 @@ impl Builder { let PrecedenceExpression { name, operators } = precedence_expression.as_ref(); values.push(Value::new( - Self::build_label_comment(BuiltInLabel::Variant.as_ref()), - Self::build_ref(name), + Self::build_ref(Some(BuiltInLabel::Variant.as_ref()), name), None, )); @@ -251,8 +246,7 @@ impl Builder { let PrimaryExpression { reference, enabled } = primary_expression; values.push(Value::new( - Self::build_label_comment(BuiltInLabel::Variant.as_ref()), - Self::build_ref(reference), + Self::build_ref(Some(BuiltInLabel::Variant.as_ref()), reference), Self::build_enabled_comment(enabled), )); } @@ -286,8 +280,7 @@ impl Builder { leading_comments.push("Prefix unary operator".to_string()); values.push(Value::new( - Self::build_label_comment(BuiltInLabel::Operand.as_ref()), - Self::build_ref(base_name), + Self::build_ref(Some(BuiltInLabel::Operand.as_ref()), base_name), None, )); } @@ -297,8 +290,7 @@ impl Builder { values.insert( 0, Value::new( - Self::build_label_comment(BuiltInLabel::Operand.as_ref()), - Self::build_ref(base_name), + Self::build_ref(Some(BuiltInLabel::Operand.as_ref()), base_name), None, ), ); @@ -309,14 +301,12 @@ impl Builder { values.insert( 0, Value::new( - Self::build_label_comment(BuiltInLabel::LeftOperand.as_ref()), - Self::build_ref(base_name), + Self::build_ref(Some(BuiltInLabel::LeftOperand.as_ref()), base_name), None, ), ); values.push(Value::new( - Self::build_label_comment(BuiltInLabel::RightOperand.as_ref()), - Self::build_ref(base_name), + Self::build_ref(Some(BuiltInLabel::RightOperand.as_ref()), base_name), None, )); } @@ -326,14 +316,12 @@ impl Builder { values.insert( 0, Value::new( - Self::build_label_comment(BuiltInLabel::LeftOperand.as_ref()), - Self::build_ref(base_name), + Self::build_ref(Some(BuiltInLabel::LeftOperand.as_ref()), base_name), None, ), ); values.push(Value::new( - Self::build_label_comment(BuiltInLabel::RightOperand.as_ref()), - Self::build_ref(base_name), + Self::build_ref(Some(BuiltInLabel::RightOperand.as_ref()), base_name), None, )); } @@ -348,14 +336,11 @@ impl Builder { fields .iter() .map(|(identifier, field)| match field { - Field::Required { reference } => Value::new( - Self::build_label_comment(identifier), - Self::build_ref(reference), - None, - ), + Field::Required { reference } => { + Value::new(Self::build_ref(Some(identifier), reference), None) + } Field::Optional { reference, enabled } => Value::new( - Self::build_label_comment(identifier), - Expression::new_optional(Self::build_ref(reference).into()), + Expression::new_optional(Self::build_ref(Some(identifier), reference).into()), Self::build_enabled_comment(enabled), ), }) @@ -370,7 +355,7 @@ impl Builder { self.add_definition( name, None, - Some(Value::new(None, Self::build_scanner(scanner), None)), + Some(Value::new(Self::build_scanner(scanner), None)), DefinitionKind::Sequence, ); } @@ -398,7 +383,7 @@ impl Builder { self.add_definition( name, leading_comments, - Some(Value::new(None, Self::build_keyword_value(value), None)), + Some(Value::new(Self::build_keyword_value(value), None)), DefinitionKind::Sequence, ); } @@ -413,7 +398,7 @@ impl Builder { self.add_definition( name, Self::build_enabled_comment(enabled), - Some(Value::new(None, Self::build_scanner(scanner), None)), + Some(Value::new(Self::build_scanner(scanner), None)), DefinitionKind::Sequence, ); } @@ -431,7 +416,7 @@ impl Builder { self.add_definition( name, Self::build_enabled_comment(enabled), - Some(Value::new(None, Self::build_scanner(scanner), None)), + Some(Value::new(Self::build_scanner(scanner), None)), DefinitionKind::Sequence, ); } @@ -475,10 +460,6 @@ impl Builder { } } - fn build_label_comment(label: &str) -> Option { - Some(format!("{label}:")) - } - fn build_scanner(scanner: &Scanner) -> Expression { match scanner { Scanner::Sequence { scanners } => { @@ -521,12 +502,13 @@ impl Builder { scanner, not_followed_by: _, } => Self::build_scanner(scanner), - Scanner::Fragment { reference } => Self::build_ref(reference), + Scanner::Fragment { reference } => Self::build_ref(None, reference), } } - fn build_ref(reference: &Identifier) -> Expression { - Expression::new_reference(reference.to_owned()) + fn build_ref(label: Option<&str>, reference: &Identifier) -> Expression { + let leading_comment = label.map(|label| format!("{label}:")); + Expression::new_reference(leading_comment, reference.to_owned()) } } diff --git a/crates/codegen/ebnf/src/model.rs b/crates/codegen/ebnf/src/model.rs index 5b520b4cf5..6046564c88 100644 --- a/crates/codegen/ebnf/src/model.rs +++ b/crates/codegen/ebnf/src/model.rs @@ -52,7 +52,6 @@ pub enum DefinitionKind { /// ``` #[derive(derive_new::new)] pub struct Value { - pub leading_comment: Option, pub expression: Expression, pub trailing_comment: Option, } @@ -91,6 +90,7 @@ pub enum Expression { atom: String, }, Reference { + leading_comment: Option, reference: Identifier, }, } diff --git a/crates/codegen/ebnf/src/serializer.rs b/crates/codegen/ebnf/src/serializer.rs index deb06dcfaf..59faf86efe 100644 --- a/crates/codegen/ebnf/src/serializer.rs +++ b/crates/codegen/ebnf/src/serializer.rs @@ -71,7 +71,6 @@ impl<'s, W: EbnfWriter> Serializer<'s, W> { for (index, value) in values.iter().enumerate() { let Value { - leading_comment, expression, trailing_comment, } = value; @@ -88,11 +87,6 @@ impl<'s, W: EbnfWriter> Serializer<'s, W> { ))?; } - if let Some(comment) = leading_comment { - self.serialize_comment(comment)?; - self.serialize_punctuation(" ")?; - } - self.serialize_expr(expression)?; if index + 1 == values.len() { @@ -153,7 +147,14 @@ impl<'s, W: EbnfWriter> Serializer<'s, W> { Expression::Atom { atom } => { self.serialize_string_literal(atom)?; } - Expression::Reference { reference } => { + Expression::Reference { + leading_comment, + reference, + } => { + if let Some(comment) = leading_comment { + self.serialize_comment(comment)?; + self.serialize_punctuation(" ")?; + } self.serialize_identifier(reference)?; } }; diff --git a/crates/codegen/spec/src/model.rs b/crates/codegen/spec/src/model.rs index 92721bcfe7..f9b493c47c 100644 --- a/crates/codegen/spec/src/model.rs +++ b/crates/codegen/spec/src/model.rs @@ -1,7 +1,7 @@ use std::rc::Rc; use codegen_ebnf::EbnfModel; -use codegen_language_definition::model::{Identifier, Language, Section, Topic, Item}; +use codegen_language_definition::model::{Identifier, Item, Language, Section, Topic}; use inflector::Inflector; use serde::Serialize; @@ -94,9 +94,12 @@ impl SpecTopic { // We need to also add any precedence expressions, as they define // items but are not direct children of the topic - if let Item::Precedence{ item: precedence_item } = item { + if let Item::Precedence { + item: precedence_item, + } = item + { for precedence_expr in &precedence_item.as_ref().precedence_expressions { - items.push(precedence_expr.as_ref().name.to_owned()); + items.push(precedence_expr.as_ref().name.clone()); } } } diff --git a/crates/solidity/outputs/spec/generated/grammar.ebnf b/crates/solidity/outputs/spec/generated/grammar.ebnf index 4cb2f8f8cb..9c3627ae1f 100644 --- a/crates/solidity/outputs/spec/generated/grammar.ebnf +++ b/crates/solidity/outputs/spec/generated/grammar.ebnf @@ -50,7 +50,7 @@ ExperimentalFeature = (* variant: *) IDENTIFIER VersionPragma = (* solidity_keyword: *) SOLIDITY_KEYWORD (* sets: *) VersionExpressionSets; -VersionExpressionSets = VersionExpressionSet (BAR_BAR VersionExpressionSet)*; +VersionExpressionSets = (* item: *) VersionExpressionSet ((* separator: *) BAR_BAR (* item: *) VersionExpressionSet)*; VersionExpressionSet = (* item: *) VersionExpression+; @@ -93,7 +93,7 @@ VersionComparator = (* operator: *) LESS_THAN_EQUAL VersionComparator = (* operator: *) GREATER_THAN_EQUAL (* operand: *) VersionExpression; -VersionSpecifiers = VERSION_SPECIFIER (PERIOD VERSION_SPECIFIER)*; +VersionSpecifiers = (* item: *) VERSION_SPECIFIER ((* separator: *) PERIOD (* item: *) VERSION_SPECIFIER)*; VERSION_SPECIFIER = «VERSION_SPECIFIER_FRAGMENT»; @@ -136,7 +136,7 @@ ImportDeconstruction = (* open_brace: *) OPEN_BRACE (* from_keyword: *) FROM_KEYWORD (* path: *) StringLiteral; -ImportDeconstructionSymbols = ImportDeconstructionSymbol (COMMA ImportDeconstructionSymbol)*; +ImportDeconstructionSymbols = (* item: *) ImportDeconstructionSymbol ((* separator: *) COMMA (* item: *) ImportDeconstructionSymbol)*; ImportDeconstructionSymbol = (* name: *) IDENTIFIER (* alias: *) ImportAlias?; @@ -162,7 +162,7 @@ UsingDeconstruction = (* open_brace: *) OPEN_BRACE (* close_brace: *) CLOSE_BRACE; (* Introduced in 0.8.13 *) -UsingDeconstructionSymbols = UsingDeconstructionSymbol (COMMA UsingDeconstructionSymbol)*; +UsingDeconstructionSymbols = (* item: *) UsingDeconstructionSymbol ((* separator: *) COMMA (* item: *) UsingDeconstructionSymbol)*; (* Introduced in 0.8.13 *) UsingDeconstructionSymbol = (* name: *) IdentifierPath @@ -623,7 +623,7 @@ ContractDefinition = (* abstract_keyword: *) ABSTRACT_KEYWORD? (* Introduced in InheritanceSpecifier = (* is_keyword: *) IS_KEYWORD (* types: *) InheritanceTypes; -InheritanceTypes = InheritanceType (COMMA InheritanceType)*; +InheritanceTypes = (* item: *) InheritanceType ((* separator: *) COMMA (* item: *) InheritanceType)*; InheritanceType = (* type_name: *) IdentifierPath (* arguments: *) ArgumentsDeclaration?; @@ -687,7 +687,7 @@ EnumDefinition = (* enum_keyword: *) ENUM_KEYWORD (* members: *) EnumMembers (* close_brace: *) CLOSE_BRACE; -EnumMembers = (IDENTIFIER (COMMA IDENTIFIER)*)?; +EnumMembers = ((* item: *) IDENTIFIER ((* separator: *) COMMA (* item: *) IDENTIFIER)*)?; (* 2.6. Constants: *) @@ -736,7 +736,7 @@ ParametersDeclaration = (* open_paren: *) OPEN_PAREN (* parameters: *) Parameters (* close_paren: *) CLOSE_PAREN; -Parameters = (Parameter (COMMA Parameter)*)?; +Parameters = ((* item: *) Parameter ((* separator: *) COMMA (* item: *) Parameter)*)?; Parameter = (* type_name: *) TypeName (* storage_location: *) StorageLocation? @@ -766,7 +766,7 @@ OverridePathsDeclaration = (* open_paren: *) OPEN_PAREN (* close_paren: *) CLOSE_PAREN; (* Introduced in 0.6.0 *) -OverridePaths = IdentifierPath (COMMA IdentifierPath)*; +OverridePaths = (* item: *) IdentifierPath ((* separator: *) COMMA (* item: *) IdentifierPath)*; ReturnsDeclaration = (* returns_keyword: *) RETURNS_KEYWORD (* variables: *) ParametersDeclaration; @@ -874,7 +874,7 @@ EventParametersDeclaration = (* open_paren: *) OPEN_PAREN (* parameters: *) EventParameters (* close_paren: *) CLOSE_PAREN; -EventParameters = (EventParameter (COMMA EventParameter)*)?; +EventParameters = ((* item: *) EventParameter ((* separator: *) COMMA (* item: *) EventParameter)*)?; EventParameter = (* type_name: *) TypeName (* indexed_keyword: *) INDEXED_KEYWORD? @@ -903,7 +903,7 @@ ErrorParametersDeclaration = (* open_paren: *) OPEN_PAREN (* close_paren: *) CLOSE_PAREN; (* Introduced in 0.8.4 *) -ErrorParameters = (ErrorParameter (COMMA ErrorParameter)*)?; +ErrorParameters = ((* item: *) ErrorParameter ((* separator: *) COMMA (* item: *) ErrorParameter)*)?; (* Introduced in 0.8.4 *) ErrorParameter = (* type_name: *) TypeName @@ -1020,7 +1020,7 @@ AssemblyFlagsDeclaration = (* open_paren: *) OPEN_PAREN (* flags: *) AssemblyFlags (* close_paren: *) CLOSE_PAREN; -AssemblyFlags = StringLiteral (COMMA StringLiteral)*; +AssemblyFlags = (* item: *) StringLiteral ((* separator: *) COMMA (* item: *) StringLiteral)*; (* 4.2. Declaration Statements: *) @@ -1032,7 +1032,7 @@ TupleDeconstructionStatement = (* var_keyword: *) VAR_KEYWORD? (* Deprecated in (* expression: *) Expression (* semicolon: *) SEMICOLON; -TupleDeconstructionElements = TupleDeconstructionElement (COMMA TupleDeconstructionElement)*; +TupleDeconstructionElements = (* item: *) TupleDeconstructionElement ((* separator: *) COMMA (* item: *) TupleDeconstructionElement)*; TupleDeconstructionElement = (* member: *) TupleMember?; @@ -1438,7 +1438,7 @@ PositionalArgumentsDeclaration = (* open_paren: *) OPEN_PAREN (* arguments: *) PositionalArguments (* close_paren: *) CLOSE_PAREN; -PositionalArguments = (Expression (COMMA Expression)*)?; +PositionalArguments = ((* item: *) Expression ((* separator: *) COMMA (* item: *) Expression)*)?; NamedArgumentsDeclaration = (* open_paren: *) OPEN_PAREN (* arguments: *) NamedArgumentGroup? @@ -1448,10 +1448,10 @@ NamedArgumentGroup = (* open_brace: *) OPEN_BRACE (* arguments: *) NamedArguments (* close_brace: *) CLOSE_BRACE; -NamedArguments = (NamedArgument (COMMA NamedArgument)*)?; +NamedArguments = ((* item: *) NamedArgument ((* separator: *) COMMA (* item: *) NamedArgument)*)?; (* Introduced in 0.6.2 *) -CallOptions = NamedArgument (COMMA NamedArgument)*; +CallOptions = (* item: *) NamedArgument ((* separator: *) COMMA (* item: *) NamedArgument)*; NamedArgument = (* name: *) IDENTIFIER (* colon: *) COLON @@ -1472,7 +1472,7 @@ TupleExpression = (* open_paren: *) OPEN_PAREN (* items: *) TupleValues (* close_paren: *) CLOSE_PAREN; -TupleValues = TupleValue (COMMA TupleValue)*; +TupleValues = (* item: *) TupleValue ((* separator: *) COMMA (* item: *) TupleValue)*; TupleValue = (* expression: *) Expression?; @@ -1480,7 +1480,7 @@ ArrayExpression = (* open_bracket: *) OPEN_BRACKET (* items: *) ArrayValues (* close_bracket: *) CLOSE_BRACKET; -ArrayValues = Expression (COMMA Expression)*; +ArrayValues = (* item: *) Expression ((* separator: *) COMMA (* item: *) Expression)*; (* 5.4. Numbers: *) @@ -1594,7 +1594,7 @@ DOUBLE_QUOTED_UNICODE_STRING_LITERAL = 'unicode"' («ESCAPE_SEQUENCE» | !('"' " (* 5.6. Identifiers: *) -IdentifierPath = IDENTIFIER (PERIOD IDENTIFIER)*; +IdentifierPath = (* item: *) IDENTIFIER ((* separator: *) PERIOD (* item: *) IDENTIFIER)*; IDENTIFIER = «IDENTIFIER_START» «IDENTIFIER_PART»*; @@ -1637,12 +1637,12 @@ YulParametersDeclaration = (* open_paren: *) OPEN_PAREN (* parameters: *) YulParameters (* close_paren: *) CLOSE_PAREN; -YulParameters = (YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*)?; +YulParameters = ((* item: *) YUL_IDENTIFIER ((* separator: *) COMMA (* item: *) YUL_IDENTIFIER)*)?; YulReturnsDeclaration = (* minus_greater_than: *) MINUS_GREATER_THAN (* variables: *) YulReturnVariables; -YulReturnVariables = YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*; +YulReturnVariables = (* item: *) YUL_IDENTIFIER ((* separator: *) COMMA (* item: *) YUL_IDENTIFIER)*; YulVariableDeclarationStatement = (* let_keyword: *) YUL_LET_KEYWORD (* names: *) YUL_IDENTIFIER @@ -1712,11 +1712,11 @@ YulFunctionCallExpression = (* operand: *) YulExpression (* arguments: *) YulArguments (* close_paren: *) CLOSE_PAREN; -YulArguments = (YulExpression (COMMA YulExpression)*)?; +YulArguments = ((* item: *) YulExpression ((* separator: *) COMMA (* item: *) YulExpression)*)?; -YulPaths = YulPath (COMMA YulPath)*; +YulPaths = (* item: *) YulPath ((* separator: *) COMMA (* item: *) YulPath)*; -YulPath = YulPathComponent (PERIOD YulPathComponent)*; +YulPath = (* item: *) YulPathComponent ((* separator: *) PERIOD (* item: *) YulPathComponent)*; YulPathComponent = (* variant: *) YUL_IDENTIFIER | (* variant: *) YUL_ADDRESS_KEYWORD; (* Introduced in 0.8.10 *) diff --git a/crates/solidity/outputs/spec/generated/public/01-file-structure/03-pragma-directives.md b/crates/solidity/outputs/spec/generated/public/01-file-structure/03-pragma-directives.md index 409ee35ab8..148a9dcb0d 100644 --- a/crates/solidity/outputs/spec/generated/public/01-file-structure/03-pragma-directives.md +++ b/crates/solidity/outputs/spec/generated/public/01-file-structure/03-pragma-directives.md @@ -44,7 +44,7 @@ ``` -
VersionExpressionSets = VersionExpressionSet (BAR_BAR VersionExpressionSet)*;
+
VersionExpressionSets = (* item: *) VersionExpressionSet ((* separator: *) BAR_BAR (* item: *) VersionExpressionSet)*;
```{ .ebnf #VersionExpressionSet } @@ -74,7 +74,7 @@ ``` -
VersionSpecifiers = VERSION_SPECIFIER (PERIOD VERSION_SPECIFIER)*;
+
VersionSpecifiers = (* item: *) VERSION_SPECIFIER ((* separator: *) PERIOD (* item: *) VERSION_SPECIFIER)*;
```{ .ebnf #VersionSpecifier } diff --git a/crates/solidity/outputs/spec/generated/public/01-file-structure/04-import-directives.md b/crates/solidity/outputs/spec/generated/public/01-file-structure/04-import-directives.md index bfe6afe1a1..40286f639c 100644 --- a/crates/solidity/outputs/spec/generated/public/01-file-structure/04-import-directives.md +++ b/crates/solidity/outputs/spec/generated/public/01-file-structure/04-import-directives.md @@ -38,7 +38,7 @@ ``` -
ImportDeconstructionSymbols = ImportDeconstructionSymbol (COMMA ImportDeconstructionSymbol)*;
+
ImportDeconstructionSymbols = (* item: *) ImportDeconstructionSymbol ((* separator: *) COMMA (* item: *) ImportDeconstructionSymbol)*;
```{ .ebnf #ImportDeconstructionSymbol } diff --git a/crates/solidity/outputs/spec/generated/public/01-file-structure/05-using-directives.md b/crates/solidity/outputs/spec/generated/public/01-file-structure/05-using-directives.md index bbcef597fe..55e9a2f582 100644 --- a/crates/solidity/outputs/spec/generated/public/01-file-structure/05-using-directives.md +++ b/crates/solidity/outputs/spec/generated/public/01-file-structure/05-using-directives.md @@ -26,7 +26,7 @@ ``` -
(* Introduced in 0.8.13 *)
UsingDeconstructionSymbols = UsingDeconstructionSymbol (COMMA UsingDeconstructionSymbol)*;
+
(* Introduced in 0.8.13 *)
UsingDeconstructionSymbols = (* item: *) UsingDeconstructionSymbol ((* separator: *) COMMA (* item: *) UsingDeconstructionSymbol)*;
```{ .ebnf #UsingDeconstructionSymbol } diff --git a/crates/solidity/outputs/spec/generated/public/02-definitions/01-contracts.md b/crates/solidity/outputs/spec/generated/public/02-definitions/01-contracts.md index 1db162c430..86bdf29238 100644 --- a/crates/solidity/outputs/spec/generated/public/02-definitions/01-contracts.md +++ b/crates/solidity/outputs/spec/generated/public/02-definitions/01-contracts.md @@ -20,7 +20,7 @@ ``` -
InheritanceTypes = InheritanceType (COMMA InheritanceType)*;
+
InheritanceTypes = (* item: *) InheritanceType ((* separator: *) COMMA (* item: *) InheritanceType)*;
```{ .ebnf #InheritanceType } diff --git a/crates/solidity/outputs/spec/generated/public/02-definitions/05-enums.md b/crates/solidity/outputs/spec/generated/public/02-definitions/05-enums.md index 3febcb4f57..f516daed7a 100644 --- a/crates/solidity/outputs/spec/generated/public/02-definitions/05-enums.md +++ b/crates/solidity/outputs/spec/generated/public/02-definitions/05-enums.md @@ -14,6 +14,6 @@ ``` -
EnumMembers = (IDENTIFIER (COMMA IDENTIFIER)*)?;
+
EnumMembers = ((* item: *) IDENTIFIER ((* separator: *) COMMA (* item: *) IDENTIFIER)*)?;
--8<-- "crates/solidity/inputs/language/docs/02-definitions/05-enums.md" diff --git a/crates/solidity/outputs/spec/generated/public/02-definitions/08-functions.md b/crates/solidity/outputs/spec/generated/public/02-definitions/08-functions.md index c83e2aa867..ec2d831b30 100644 --- a/crates/solidity/outputs/spec/generated/public/02-definitions/08-functions.md +++ b/crates/solidity/outputs/spec/generated/public/02-definitions/08-functions.md @@ -26,7 +26,7 @@ ``` -
Parameters = (Parameter (COMMA Parameter)*)?;
+
Parameters = ((* item: *) Parameter ((* separator: *) COMMA (* item: *) Parameter)*)?;
```{ .ebnf #Parameter } @@ -62,7 +62,7 @@ ``` -
(* Introduced in 0.6.0 *)
OverridePaths = IdentifierPath (COMMA IdentifierPath)*;
+
(* Introduced in 0.6.0 *)
OverridePaths = (* item: *) IdentifierPath ((* separator: *) COMMA (* item: *) IdentifierPath)*;
```{ .ebnf #ReturnsDeclaration } diff --git a/crates/solidity/outputs/spec/generated/public/02-definitions/10-events.md b/crates/solidity/outputs/spec/generated/public/02-definitions/10-events.md index a28903bec4..3b83001e24 100644 --- a/crates/solidity/outputs/spec/generated/public/02-definitions/10-events.md +++ b/crates/solidity/outputs/spec/generated/public/02-definitions/10-events.md @@ -20,7 +20,7 @@ ``` -
EventParameters = (EventParameter (COMMA EventParameter)*)?;
+
EventParameters = ((* item: *) EventParameter ((* separator: *) COMMA (* item: *) EventParameter)*)?;
```{ .ebnf #EventParameter } diff --git a/crates/solidity/outputs/spec/generated/public/02-definitions/12-errors.md b/crates/solidity/outputs/spec/generated/public/02-definitions/12-errors.md index 91f582e59d..2b73254377 100644 --- a/crates/solidity/outputs/spec/generated/public/02-definitions/12-errors.md +++ b/crates/solidity/outputs/spec/generated/public/02-definitions/12-errors.md @@ -20,7 +20,7 @@ ``` -
(* Introduced in 0.8.4 *)
ErrorParameters = (ErrorParameter (COMMA ErrorParameter)*)?;
+
(* Introduced in 0.8.4 *)
ErrorParameters = ((* item: *) ErrorParameter ((* separator: *) COMMA (* item: *) ErrorParameter)*)?;
```{ .ebnf #ErrorParameter } diff --git a/crates/solidity/outputs/spec/generated/public/04-statements/01-blocks.md b/crates/solidity/outputs/spec/generated/public/04-statements/01-blocks.md index 4996a6cf25..8ef2f28720 100644 --- a/crates/solidity/outputs/spec/generated/public/04-statements/01-blocks.md +++ b/crates/solidity/outputs/spec/generated/public/04-statements/01-blocks.md @@ -50,6 +50,6 @@ ``` -
AssemblyFlags = StringLiteral (COMMA StringLiteral)*;
+
AssemblyFlags = (* item: *) StringLiteral ((* separator: *) COMMA (* item: *) StringLiteral)*;
--8<-- "crates/solidity/inputs/language/docs/04-statements/01-blocks.md" diff --git a/crates/solidity/outputs/spec/generated/public/04-statements/02-declaration-statements.md b/crates/solidity/outputs/spec/generated/public/04-statements/02-declaration-statements.md index fe6ed27992..b3542db9de 100644 --- a/crates/solidity/outputs/spec/generated/public/04-statements/02-declaration-statements.md +++ b/crates/solidity/outputs/spec/generated/public/04-statements/02-declaration-statements.md @@ -14,7 +14,7 @@ ``` -
TupleDeconstructionElements = TupleDeconstructionElement (COMMA TupleDeconstructionElement)*;
+
TupleDeconstructionElements = (* item: *) TupleDeconstructionElement ((* separator: *) COMMA (* item: *) TupleDeconstructionElement)*;
```{ .ebnf #TupleDeconstructionElement } diff --git a/crates/solidity/outputs/spec/generated/public/05-expressions/02-function-calls.md b/crates/solidity/outputs/spec/generated/public/05-expressions/02-function-calls.md index a3d19f86c5..ef35ad10cb 100644 --- a/crates/solidity/outputs/spec/generated/public/05-expressions/02-function-calls.md +++ b/crates/solidity/outputs/spec/generated/public/05-expressions/02-function-calls.md @@ -20,7 +20,7 @@ ``` -
PositionalArguments = (Expression (COMMA Expression)*)?;
+
PositionalArguments = ((* item: *) Expression ((* separator: *) COMMA (* item: *) Expression)*)?;
```{ .ebnf #NamedArgumentsDeclaration } @@ -38,13 +38,13 @@ ``` -
NamedArguments = (NamedArgument (COMMA NamedArgument)*)?;
+
NamedArguments = ((* item: *) NamedArgument ((* separator: *) COMMA (* item: *) NamedArgument)*)?;
```{ .ebnf #CallOptions } ``` -
(* Introduced in 0.6.2 *)
CallOptions = NamedArgument (COMMA NamedArgument)*;
+
(* Introduced in 0.6.2 *)
CallOptions = (* item: *) NamedArgument ((* separator: *) COMMA (* item: *) NamedArgument)*;
```{ .ebnf #NamedArgument } diff --git a/crates/solidity/outputs/spec/generated/public/05-expressions/03-primary-expressions.md b/crates/solidity/outputs/spec/generated/public/05-expressions/03-primary-expressions.md index b0db08802e..cd692f0a38 100644 --- a/crates/solidity/outputs/spec/generated/public/05-expressions/03-primary-expressions.md +++ b/crates/solidity/outputs/spec/generated/public/05-expressions/03-primary-expressions.md @@ -26,7 +26,7 @@ ``` -
TupleValues = TupleValue (COMMA TupleValue)*;
+
TupleValues = (* item: *) TupleValue ((* separator: *) COMMA (* item: *) TupleValue)*;
```{ .ebnf #TupleValue } @@ -44,6 +44,6 @@ ``` -
ArrayValues = Expression (COMMA Expression)*;
+
ArrayValues = (* item: *) Expression ((* separator: *) COMMA (* item: *) Expression)*;
--8<-- "crates/solidity/inputs/language/docs/05-expressions/03-primary-expressions.md" diff --git a/crates/solidity/outputs/spec/generated/public/05-expressions/06-identifiers.md b/crates/solidity/outputs/spec/generated/public/05-expressions/06-identifiers.md index 50316aa50e..4fa5c5132e 100644 --- a/crates/solidity/outputs/spec/generated/public/05-expressions/06-identifiers.md +++ b/crates/solidity/outputs/spec/generated/public/05-expressions/06-identifiers.md @@ -8,7 +8,7 @@ ``` -
IdentifierPath = IDENTIFIER (PERIOD IDENTIFIER)*;
+
IdentifierPath = (* item: *) IDENTIFIER ((* separator: *) PERIOD (* item: *) IDENTIFIER)*;
```{ .ebnf #Identifier } diff --git a/crates/solidity/outputs/spec/generated/public/06-yul/01-yul-statements.md b/crates/solidity/outputs/spec/generated/public/06-yul/01-yul-statements.md index 09edf48d8a..31d9746b5f 100644 --- a/crates/solidity/outputs/spec/generated/public/06-yul/01-yul-statements.md +++ b/crates/solidity/outputs/spec/generated/public/06-yul/01-yul-statements.md @@ -38,7 +38,7 @@ ``` -
YulParameters = (YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*)?;
+
YulParameters = ((* item: *) YUL_IDENTIFIER ((* separator: *) COMMA (* item: *) YUL_IDENTIFIER)*)?;
```{ .ebnf #YulReturnsDeclaration } @@ -50,7 +50,7 @@ ``` -
YulReturnVariables = YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*;
+
YulReturnVariables = (* item: *) YUL_IDENTIFIER ((* separator: *) COMMA (* item: *) YUL_IDENTIFIER)*;
```{ .ebnf #YulVariableDeclarationStatement } diff --git a/crates/solidity/outputs/spec/generated/public/06-yul/02-yul-expressions.md b/crates/solidity/outputs/spec/generated/public/06-yul/02-yul-expressions.md index 3252375130..5f18e8cc23 100644 --- a/crates/solidity/outputs/spec/generated/public/06-yul/02-yul-expressions.md +++ b/crates/solidity/outputs/spec/generated/public/06-yul/02-yul-expressions.md @@ -20,19 +20,19 @@ ``` -
YulArguments = (YulExpression (COMMA YulExpression)*)?;
+
YulArguments = ((* item: *) YulExpression ((* separator: *) COMMA (* item: *) YulExpression)*)?;
```{ .ebnf #YulPaths } ``` -
YulPaths = YulPath (COMMA YulPath)*;
+
YulPaths = (* item: *) YulPath ((* separator: *) COMMA (* item: *) YulPath)*;
```{ .ebnf #YulPath } ``` -
YulPath = YulPathComponent (PERIOD YulPathComponent)*;
+
YulPath = (* item: *) YulPathComponent ((* separator: *) PERIOD (* item: *) YulPathComponent)*;
```{ .ebnf #YulPathComponent }