diff --git a/.changeset/plenty-chefs-report.md b/.changeset/plenty-chefs-report.md new file mode 100644 index 0000000000..17fb638210 --- /dev/null +++ b/.changeset/plenty-chefs-report.md @@ -0,0 +1,5 @@ +--- +"changelog": minor +--- + +fill in missing CST node names diff --git a/crates/codegen/schema/src/validation/mod.rs b/crates/codegen/schema/src/validation/mod.rs index aacf057bb2..a5fef70be3 100644 --- a/crates/codegen/schema/src/validation/mod.rs +++ b/crates/codegen/schema/src/validation/mod.rs @@ -8,10 +8,9 @@ use crate::types::LanguageDefinitionRef; pub fn validate_language(language: &LanguageDefinitionRef) -> CodegenResult<()> { // Validation should stop at each step if there are any errors: - rules::language_versions::run(language)?; rules::definitions::run(language)?; rules::references::run(language)?; - rules::empty_roots::run(language)?; + rules::lints::run(language)?; return Ok(()); } diff --git a/crates/codegen/schema/src/validation/rules/definitions/keywords/collector.rs b/crates/codegen/schema/src/validation/rules/definitions/keywords/collector.rs new file mode 100644 index 0000000000..51d0f86ff0 --- /dev/null +++ b/crates/codegen/schema/src/validation/rules/definitions/keywords/collector.rs @@ -0,0 +1,171 @@ +use std::collections::HashMap; + +use crate::{ + types::{LanguageDefinitionRef, ProductionRef, ScannerDefinition, ScannerRef}, + validation::visitors::{run_visitor, LocationRef, Reporter, Visitor}, +}; + +pub struct KeywordsCollector { + keywords: HashMap, + current_production: Option, +} + +impl KeywordsCollector { + pub fn collect( + language: &LanguageDefinitionRef, + reporter: &mut Reporter, + ) -> HashMap { + let mut instance = Self { + keywords: HashMap::new(), + current_production: None, + }; + + run_visitor(&mut instance, language, reporter); + + return instance.keywords; + } +} + +impl Visitor for KeywordsCollector { + fn visit_production( + &mut self, + production: &crate::types::ProductionRef, + _location: &LocationRef, + _reporter: &mut Reporter, + ) -> bool { + self.current_production = Some(production.to_owned()); + return true; + } + + fn visit_parser( + &mut self, + _parser: &crate::types::ParserRef, + _location: &LocationRef, + _reporter: &mut Reporter, + ) -> bool { + return false; + } + + fn visit_scanner( + &mut self, + scanner: &ScannerRef, + location: &LocationRef, + reporter: &mut Reporter, + ) -> bool { + let identifier = + if let ScannerDefinition::TrailingContext { expression, .. } = &scanner.definition { + expression + } else { + return true; + }; + + let variations = if let Some(variations) = Self::collect_variations(identifier) { + variations + } else { + return false; + }; + + let current_production = self.current_production.as_ref().unwrap(); + + for variation in &variations { + match self.keywords.get(variation) { + Some(existing_production) => { + reporter.report( + location, + Errors::KeywordAlreadyDefined( + variation.to_owned(), + existing_production.name.to_owned(), + ), + ); + } + None => { + self.keywords + .insert(variation.to_owned(), current_production.to_owned()); + } + }; + } + + return false; + } +} + +impl KeywordsCollector { + fn collect_variations(scanner: &ScannerRef) -> Option> { + // TODO: manually calculate variations until keywords are implemented. + // Once that is done, report error if any scanners have variations, as they should be keywords. + // https://github.com/NomicFoundation/slang/issues/505 + + match &scanner.definition { + ScannerDefinition::Choice(choices) => { + let mut variations = Vec::new(); + for choice in choices { + variations.extend(Self::collect_variations(&choice)?); + } + + return Some(variations); + } + ScannerDefinition::Difference { minuend, .. } => { + return Self::collect_variations(minuend); + } + ScannerDefinition::Optional(child) => { + let mut variations = Self::collect_variations(child)?; + variations.push("".to_owned()); + return Some(variations); + } + ScannerDefinition::Range { from, to } => { + let mut variations = Vec::new(); + for i in *from..=*to { + variations.push(i.to_string()); + } + + return Some(variations); + } + ScannerDefinition::Sequence(children) => { + let mut existing_variations = vec![]; + + for child in children { + let new_variations = Self::collect_variations(child)?; + + existing_variations = if existing_variations.is_empty() { + new_variations + } else { + let mut combined = vec![]; + + for existing in &existing_variations { + for new in &new_variations { + combined.push(format!("{existing}{new}")); + } + } + + combined + } + } + + return Some(existing_variations); + } + ScannerDefinition::TrailingContext { expression, .. } => { + return Self::collect_variations(expression); + } + ScannerDefinition::Terminal(terminal) => { + if terminal.chars().all(|c| c == '_' || c.is_alphanumeric()) { + return Some(vec![terminal.to_owned()]); + } else { + return None; + } + } + ScannerDefinition::Not(_) + | ScannerDefinition::OneOrMore(_) + | ScannerDefinition::Reference(_) + | ScannerDefinition::ZeroOrMore(_) => { + // Cannot be a keyword + return None; + } + }; + } +} + +#[derive(thiserror::Error, Debug)] +pub(crate) enum Errors { + #[error("Keyword '{0}' is already defined in production '{1}'.")] + KeywordAlreadyDefined(String, String), +} diff --git a/crates/codegen/schema/src/validation/rules/definitions/keywords/mod.rs b/crates/codegen/schema/src/validation/rules/definitions/keywords/mod.rs new file mode 100644 index 0000000000..6c7b12cdc5 --- /dev/null +++ b/crates/codegen/schema/src/validation/rules/definitions/keywords/mod.rs @@ -0,0 +1,22 @@ +mod collector; +mod validator; + +use crate::{ + types::LanguageDefinitionRef, + validation::{ + rules::definitions::keywords::{ + collector::KeywordsCollector, validator::KeywordsValidator, + }, + visitors::Reporter, + }, +}; + +pub struct Keywords; + +impl Keywords { + pub fn validate(language: &LanguageDefinitionRef, reporter: &mut Reporter) { + let keywords = KeywordsCollector::collect(language, reporter); + + KeywordsValidator::validate(language, keywords, reporter); + } +} diff --git a/crates/codegen/schema/src/validation/rules/definitions/keywords/validator.rs b/crates/codegen/schema/src/validation/rules/definitions/keywords/validator.rs new file mode 100644 index 0000000000..78b21aae2b --- /dev/null +++ b/crates/codegen/schema/src/validation/rules/definitions/keywords/validator.rs @@ -0,0 +1,87 @@ +use std::collections::HashMap; + +use crate::{ + types::{LanguageDefinitionRef, ProductionRef, ScannerDefinition, ScannerRef}, + validation::{ + rules::utils::is_a_keyword_scanner, + visitors::{run_visitor, LocationRef, Reporter, Visitor}, + }, +}; + +pub struct KeywordsValidator { + keywords: HashMap, + current_production: Option, +} + +impl KeywordsValidator { + pub fn validate( + language: &LanguageDefinitionRef, + keywords: HashMap, + reporter: &mut Reporter, + ) { + let mut instance = Self { + keywords, + current_production: None, + }; + + run_visitor(&mut instance, language, reporter); + } +} + +impl Visitor for KeywordsValidator { + fn visit_production( + &mut self, + production: &crate::types::ProductionRef, + _location: &LocationRef, + _reporter: &mut Reporter, + ) -> bool { + self.current_production = Some(production.to_owned()); + + // Skip validation if this is a keyword: + return !is_a_keyword_scanner(&production.name); + } + + fn visit_parser( + &mut self, + _parser: &crate::types::ParserRef, + _location: &LocationRef, + _reporter: &mut Reporter, + ) -> bool { + return false; + } + + fn visit_scanner( + &mut self, + scanner: &ScannerRef, + location: &LocationRef, + reporter: &mut Reporter, + ) -> bool { + if let ScannerDefinition::Terminal(terminal) = &scanner.definition { + if let Some(production) = self.keywords.get(terminal) { + if production.name != self.current_production.as_ref().unwrap().name { + reporter.report( + location, + Errors::ShouldReferenceExistingKeyword(production.name.to_owned()), + ); + } + } + } + + return true; + } + + fn visit_precedence_parser( + &mut self, + _precedence_parser: &crate::types::PrecedenceParserRef, + _location: &LocationRef, + _reporter: &mut Reporter, + ) -> bool { + return false; + } +} + +#[derive(thiserror::Error, Debug)] +pub(crate) enum Errors { + #[error("You should reference the existing keyword '{0}' instead.")] + ShouldReferenceExistingKeyword(String), +} diff --git a/crates/codegen/schema/src/validation/rules/definitions/mod.rs b/crates/codegen/schema/src/validation/rules/definitions/mod.rs index 5ae9579c10..4976080b35 100644 --- a/crates/codegen/schema/src/validation/rules/definitions/mod.rs +++ b/crates/codegen/schema/src/validation/rules/definitions/mod.rs @@ -1,86 +1,26 @@ -use codegen_utils::errors::CodegenResult; -use indexmap::IndexSet; +mod keywords; +mod parsers; +mod productions; +mod versions; use crate::{ - types::{LanguageDefinitionRef, ParserRef, ProductionRef}, - validation::visitors::{run_visitor, LocationRef, Reporter, Visitor}, + types::LanguageDefinitionRef, + validation::{ + rules::definitions::{ + keywords::Keywords, parsers::Parsers, productions::Productions, versions::Versions, + }, + visitors::Reporter, + }, }; +use codegen_utils::errors::CodegenResult; pub fn run(language: &LanguageDefinitionRef) -> CodegenResult<()> { - let mut visitor = Definitions::new(language); let mut reporter = Reporter::new(); - run_visitor(&mut visitor, language, &mut reporter); + Productions::validate(language, &mut reporter); + Versions::validate(language, &mut reporter); + Parsers::validate(language, &mut reporter); + Keywords::validate(language, &mut reporter); return reporter.to_result(); } - -struct Definitions { - language: LanguageDefinitionRef, - productions_so_far: IndexSet, -} - -impl Definitions { - fn new(language: &LanguageDefinitionRef) -> Self { - return Self { - language: language.to_owned(), - productions_so_far: IndexSet::new(), - }; - } -} - -impl Visitor for Definitions { - fn visit_manifest(&mut self, location: &LocationRef, reporter: &mut Reporter) -> bool { - let required_productions = self.language.required_productions(); - - for name in required_productions { - if !self.language.productions.contains_key(name) { - reporter.report(&location, Errors::MissingRequired(name.to_owned())); - } - } - - return true; - } - - fn visit_production( - &mut self, - production: &ProductionRef, - location: &LocationRef, - reporter: &mut Reporter, - ) -> bool { - let name = &production.name; - if !self.productions_so_far.insert(name.to_owned()) { - reporter.report(location, Errors::DuplicateProduction(name.to_owned())); - } - - return true; - } - - fn visit_parser( - &mut self, - parser: &ParserRef, - location: &LocationRef, - reporter: &mut Reporter, - ) -> bool { - if let Some(name) = &parser.name { - if self.language.productions.contains_key(name) { - reporter.report( - location, - Errors::ExpressionNamedAsProduction(name.to_owned()), - ); - } - } - - return true; - } -} - -#[derive(thiserror::Error, Debug)] -enum Errors { - #[error("Required production '{0}' is not defined.")] - MissingRequired(String), - #[error("Production '{0}' is defined more than once.")] - DuplicateProduction(String), - #[error("Expression '{0}' cannot have the same name as a top-level production.")] - ExpressionNamedAsProduction(String), -} diff --git a/crates/codegen/schema/src/validation/rules/definitions/parsers/mod.rs b/crates/codegen/schema/src/validation/rules/definitions/parsers/mod.rs new file mode 100644 index 0000000000..6efe969270 --- /dev/null +++ b/crates/codegen/schema/src/validation/rules/definitions/parsers/mod.rs @@ -0,0 +1,142 @@ +use std::collections::{HashMap, HashSet}; + +use crate::{ + types::{LanguageDefinitionRef, ParserRef, PrecedenceParserRef, ProductionRef}, + validation::visitors::{run_visitor, LocationRef, Reporter, VersionSet, Visitor}, +}; + +pub struct Parsers { + language: LanguageDefinitionRef, + + current_production: Option, + parser_to_production: HashMap, + current_version_parsers: HashSet, +} + +impl Parsers { + pub fn validate(language: &LanguageDefinitionRef, reporter: &mut Reporter) { + let mut instance = Self { + language: language.to_owned(), + + current_production: None, + parser_to_production: HashMap::new(), + current_version_parsers: HashSet::new(), + }; + + run_visitor(&mut instance, language, reporter); + } +} + +impl Visitor for Parsers { + fn visit_production( + &mut self, + production: &ProductionRef, + _location: &LocationRef, + _reporter: &mut Reporter, + ) -> bool { + self.current_production = Some(production.to_owned()); + + return true; + } + + fn visit_version( + &mut self, + _version_set: &VersionSet, + _location: &LocationRef, + _reporter: &mut Reporter, + ) -> bool { + self.current_version_parsers.clear(); + + return true; + } + + fn visit_parser( + &mut self, + parser: &ParserRef, + location: &LocationRef, + reporter: &mut Reporter, + ) -> bool { + let parser_name = match &parser.name { + Some(name) => name, + None => return true, + }; + + if !self.validate_parser(parser_name, location, reporter) { + return true; + } + + if !self.current_version_parsers.insert(parser_name.to_owned()) { + reporter.report( + location, + Errors::ParserDefinedTwiceInTheSameVersion(parser_name.to_owned()), + ); + } + + return true; + } + + fn visit_precedence_parser( + &mut self, + precedence_parser: &PrecedenceParserRef, + location: &LocationRef, + reporter: &mut Reporter, + ) -> bool { + for operator in &precedence_parser.operators { + self.validate_parser(&operator.name, location, reporter); + + // Multiple operators can have the same name if under the same production. + } + + return true; + } +} + +impl Parsers { + fn validate_parser( + &mut self, + parser_name: &str, + location: &LocationRef, + reporter: &mut Reporter, + ) -> bool { + if self.language.productions.contains_key(parser_name) { + reporter.report( + location, + Errors::ParserNamedAsProduction(parser_name.to_owned()), + ); + return false; + } + + let current_production = self.current_production.as_ref().unwrap(); + + match self.parser_to_production.get(parser_name) { + Some(existing_production) => { + if current_production.name != existing_production.name { + reporter.report( + location, + Errors::ParserDefinedInAnotherProduction( + parser_name.to_owned(), + existing_production.name.to_owned(), + ), + ); + return false; + } + } + None => { + self.parser_to_production + .insert(parser_name.to_owned(), current_production.to_owned()); + } + }; + + return true; + } +} + +#[derive(thiserror::Error, Debug)] +enum Errors { + #[error("Parser '{0}' cannot have the same name as a top-level production.")] + ParserNamedAsProduction(String), + #[error("Parser '{0}' is defined in another production '{1}'.")] + ParserDefinedInAnotherProduction(String, String), + #[error("Parser '{0}' is defined twice in the same version.")] + ParserDefinedTwiceInTheSameVersion(String), +} diff --git a/crates/codegen/schema/src/validation/rules/definitions/productions/mod.rs b/crates/codegen/schema/src/validation/rules/definitions/productions/mod.rs new file mode 100644 index 0000000000..48ad2fd3ab --- /dev/null +++ b/crates/codegen/schema/src/validation/rules/definitions/productions/mod.rs @@ -0,0 +1,64 @@ +use std::collections::HashSet; + +use crate::{ + types::{LanguageDefinitionRef, ProductionRef}, + validation::visitors::{run_visitor, LocationRef, Reporter, Visitor}, +}; + +pub struct Productions { + language: LanguageDefinitionRef, + productions_already_seen: HashSet, +} + +impl Productions { + pub fn validate(language: &LanguageDefinitionRef, reporter: &mut Reporter) { + let mut instance = Self { + language: language.to_owned(), + productions_already_seen: HashSet::new(), + }; + + run_visitor(&mut instance, language, reporter); + } +} + +impl Visitor for Productions { + fn visit_manifest(&mut self, location: &LocationRef, reporter: &mut Reporter) -> bool { + let required_productions = self.language.required_productions(); + + for name in required_productions { + if let Some(production) = self.language.productions.get(name) { + if production.inlined { + reporter.report(&location, Errors::RequiredCannotBeInlined(name.to_owned())); + } + } else { + reporter.report(&location, Errors::MissingRequired(name.to_owned())); + } + } + + return true; + } + + fn visit_production( + &mut self, + production: &ProductionRef, + location: &LocationRef, + reporter: &mut Reporter, + ) -> bool { + let name = &production.name; + if !self.productions_already_seen.insert(name.to_owned()) { + reporter.report(location, Errors::DuplicateProduction(name.to_owned())); + } + + return false; + } +} + +#[derive(thiserror::Error, Debug)] +enum Errors { + #[error("Required production '{0}' is not defined.")] + MissingRequired(String), + #[error("Required production '{0}' cannot be inlined.")] + RequiredCannotBeInlined(String), + #[error("Production '{0}' is defined more than once.")] + DuplicateProduction(String), +} diff --git a/crates/codegen/schema/src/validation/rules/language_versions/mod.rs b/crates/codegen/schema/src/validation/rules/definitions/versions/mod.rs similarity index 81% rename from crates/codegen/schema/src/validation/rules/language_versions/mod.rs rename to crates/codegen/schema/src/validation/rules/definitions/versions/mod.rs index 9e5a75c445..548eff9ddb 100644 --- a/crates/codegen/schema/src/validation/rules/language_versions/mod.rs +++ b/crates/codegen/schema/src/validation/rules/definitions/versions/mod.rs @@ -1,4 +1,3 @@ -use codegen_utils::errors::CodegenResult; use semver::Version; use crate::{ @@ -6,28 +5,21 @@ use crate::{ validation::visitors::{run_visitor, LocationRef, Reporter, Visitor}, }; -pub fn run(language: &LanguageDefinitionRef) -> CodegenResult<()> { - let mut visitor = LanguageVersions::new(language); - let mut reporter = Reporter::new(); - - run_visitor(&mut visitor, language, &mut reporter); - - return reporter.to_result(); -} - -struct LanguageVersions { +pub struct Versions { language: LanguageDefinitionRef, } -impl LanguageVersions { - fn new(language: &LanguageDefinitionRef) -> Self { - return Self { +impl Versions { + pub fn validate(language: &LanguageDefinitionRef, reporter: &mut Reporter) { + let mut instance = Self { language: language.to_owned(), }; + + run_visitor(&mut instance, language, reporter); } } -impl Visitor for LanguageVersions { +impl Visitor for Versions { fn visit_manifest(&mut self, location: &LocationRef, reporter: &mut Reporter) -> bool { if self.language.versions.is_empty() { reporter.report(&location, Errors::Empty); diff --git a/crates/codegen/schema/src/validation/rules/empty_roots/mod.rs b/crates/codegen/schema/src/validation/rules/empty_roots/mod.rs deleted file mode 100644 index e8e991ffdb..0000000000 --- a/crates/codegen/schema/src/validation/rules/empty_roots/mod.rs +++ /dev/null @@ -1,143 +0,0 @@ -use codegen_utils::errors::CodegenResult; - -use crate::{ - types::{ - LanguageDefinitionRef, ParserDefinition, ParserRef, ProductionRef, ScannerDefinition, - ScannerRef, - }, - validation::visitors::{run_visitor, LocationRef, Reporter, Visitor}, -}; - -pub fn run(language: &LanguageDefinitionRef) -> CodegenResult<()> { - let mut visitor = EmptyRoots::new(language); - let mut reporter = Reporter::new(); - - run_visitor(&mut visitor, language, &mut reporter); - - return reporter.to_result(); -} - -struct EmptyRoots { - language: LanguageDefinitionRef, -} - -impl EmptyRoots { - fn new(language: &LanguageDefinitionRef) -> Self { - return Self { - language: language.to_owned(), - }; - } -} - -impl Visitor for EmptyRoots { - fn visit_production( - &mut self, - production: &ProductionRef, - _location: &LocationRef, - _reporter: &mut Reporter, - ) -> bool { - if production.name == self.language.root_production { - // Skip, as it is allowed to be empty. - return false; - } - - return true; - } - - fn visit_scanner( - &mut self, - scanner: &ScannerRef, - location: &LocationRef, - reporter: &mut Reporter, - ) -> bool { - if possible_empty_scanner(scanner) { - reporter.report(location, Errors::EmptyRoot); - } - - // Only check the top-most expression. Ignore nested ones. - return false; - } - - fn visit_parser( - &mut self, - parser: &ParserRef, - location: &LocationRef, - reporter: &mut Reporter, - ) -> bool { - if possible_empty_parser(parser) { - reporter.report(location, Errors::EmptyRoot); - } - - // Only check the top-most expression. Ignore nested ones. - return false; - } -} - -fn possible_empty_scanner(scanner: &ScannerRef) -> bool { - match &scanner.definition { - ScannerDefinition::Choice(choices) => { - return choices.iter().any(possible_empty_scanner); - } - - ScannerDefinition::Difference { - minuend, - subtrahend, - } => { - return possible_empty_scanner(minuend) || possible_empty_scanner(subtrahend); - } - - ScannerDefinition::OneOrMore(expression) - | ScannerDefinition::TrailingContext { expression, .. } => { - return possible_empty_scanner(expression); - } - - ScannerDefinition::Optional(_) | ScannerDefinition::ZeroOrMore(_) => { - return true; - } - - ScannerDefinition::Sequence(sequence) => { - return sequence.iter().all(possible_empty_scanner); - } - - ScannerDefinition::Not { .. } - | ScannerDefinition::Range { .. } - | ScannerDefinition::Reference(_) - | ScannerDefinition::Terminal(_) => { - return false; - } - }; -} - -fn possible_empty_parser(parser: &ParserRef) -> bool { - match &parser.definition { - ParserDefinition::Choice(choices) => { - return choices.iter().any(possible_empty_parser); - } - - ParserDefinition::OneOrMore(expression) - | ParserDefinition::SeparatedBy { expression, .. } - | ParserDefinition::TerminatedBy { expression, .. } => { - return possible_empty_parser(expression); - } - - ParserDefinition::Optional(_) | ParserDefinition::ZeroOrMore(_) => { - return true; - } - - ParserDefinition::Sequence(sequence) => { - return sequence.iter().all(possible_empty_parser); - } - - ParserDefinition::DelimitedBy { .. } | ParserDefinition::Reference(_) => { - return false; - } - }; -} - -#[derive(thiserror::Error, Debug)] -enum Errors { - #[error( - "Root expression cannot be optionally empty. Refactor usages to specify the arity instead." - )] - EmptyRoot, -} diff --git a/crates/codegen/schema/src/validation/rules/lints/children_count.rs b/crates/codegen/schema/src/validation/rules/lints/children_count.rs new file mode 100644 index 0000000000..d7f4ae127a --- /dev/null +++ b/crates/codegen/schema/src/validation/rules/lints/children_count.rs @@ -0,0 +1,92 @@ +use crate::{ + types::{ + LanguageDefinitionRef, ParserDefinition, ParserRef, PrecedenceParserRef, ScannerDefinition, + ScannerRef, + }, + validation::visitors::{run_visitor, LocationRef, Reporter, Visitor}, +}; + +pub struct ChildrenCount; + +impl ChildrenCount { + pub fn validate(language: &LanguageDefinitionRef, reporter: &mut Reporter) { + run_visitor(&mut Self, language, reporter); + } +} + +impl Visitor for ChildrenCount { + fn visit_scanner( + &mut self, + scanner: &ScannerRef, + location: &LocationRef, + reporter: &mut Reporter, + ) -> bool { + match &scanner.definition { + ScannerDefinition::Choice(children) | ScannerDefinition::Sequence(children) => { + if children.len() < 2 { + reporter.report(location, Errors::MinChildrenCount(2)); + } + } + ScannerDefinition::Terminal(terminal) => { + if terminal.is_empty() { + reporter.report(location, Errors::EmptyTerminal); + } + } + ScannerDefinition::Difference { .. } + | ScannerDefinition::Not(_) + | ScannerDefinition::OneOrMore(_) + | ScannerDefinition::Optional(_) + | ScannerDefinition::Range { .. } + | ScannerDefinition::Reference(_) + | ScannerDefinition::TrailingContext { .. } + | ScannerDefinition::ZeroOrMore(_) => {} + }; + + return true; + } + + fn visit_parser( + &mut self, + parser: &ParserRef, + location: &LocationRef, + reporter: &mut Reporter, + ) -> bool { + match &parser.definition { + ParserDefinition::Choice(children) | ParserDefinition::Sequence(children) => { + if parser.name.is_none() && children.len() < 2 { + reporter.report(location, Errors::MinChildrenCount(2)); + } + } + ParserDefinition::DelimitedBy { .. } + | ParserDefinition::OneOrMore(_) + | ParserDefinition::Optional(_) + | ParserDefinition::Reference(_) + | ParserDefinition::SeparatedBy { .. } + | ParserDefinition::TerminatedBy { .. } + | ParserDefinition::ZeroOrMore(_) => {} + }; + + return true; + } + + fn visit_precedence_parser( + &mut self, + precedence_parser: &PrecedenceParserRef, + location: &LocationRef, + reporter: &mut Reporter, + ) -> bool { + if precedence_parser.operators.is_empty() { + reporter.report(location, Errors::MinChildrenCount(1)); + } + + return true; + } +} + +#[derive(thiserror::Error, Debug)] +enum Errors { + #[error("Must have at least {0} children.")] + MinChildrenCount(usize), + #[error("A terminal cannot be empty.")] + EmptyTerminal, +} diff --git a/crates/codegen/schema/src/validation/rules/lints/consistent_shape.rs b/crates/codegen/schema/src/validation/rules/lints/consistent_shape.rs new file mode 100644 index 0000000000..d5c5b56382 --- /dev/null +++ b/crates/codegen/schema/src/validation/rules/lints/consistent_shape.rs @@ -0,0 +1,162 @@ +use crate::{ + types::{ + LanguageDefinitionRef, ParserDefinition, ParserRef, ProductionDefinition, ProductionRef, + ScannerRef, VersionMap, + }, + validation::visitors::{run_visitor, LocationRef, Reporter, Visitor}, +}; + +pub struct ConsistentShape { + language: LanguageDefinitionRef, + + current_production: Option, + is_root_parser: bool, +} + +impl ConsistentShape { + pub fn validate(language: &LanguageDefinitionRef, reporter: &mut Reporter) { + let mut instance = Self { + language: language.to_owned(), + + current_production: None, + is_root_parser: false, + }; + + run_visitor(&mut instance, language, reporter); + } +} + +impl Visitor for ConsistentShape { + fn visit_production( + &mut self, + production: &ProductionRef, + _location: &LocationRef, + _reporter: &mut Reporter, + ) -> bool { + self.current_production = Some(production.to_owned()); + return true; + } + + fn visit_version( + &mut self, + _version_set: &crate::validation::visitors::VersionSet, + _location: &LocationRef, + _reporter: &mut Reporter, + ) -> bool { + self.is_root_parser = true; + return true; + } + + fn visit_parser( + &mut self, + parser: &ParserRef, + location: &LocationRef, + reporter: &mut Reporter, + ) -> bool { + let must_be_single_named = if self.is_root_parser { + self.current_production.as_ref().unwrap().inlined + } else { + true + }; + + self.is_root_parser = false; + + if must_be_single_named && !self.is_single_named(parser) { + reporter.report(location, Errors::MustProduceSingleNamed); + } + + return true; + } + + fn visit_scanner( + &mut self, + _scanner: &ScannerRef, + _location: &LocationRef, + _reporter: &mut Reporter, + ) -> bool { + return false; + } +} + +impl ConsistentShape { + fn is_single_named(&self, parser: &ParserRef) -> bool { + if parser.name.is_some() { + return true; + } + + match &parser.definition { + ParserDefinition::Choice(_) + | ParserDefinition::DelimitedBy { .. } + | ParserDefinition::Sequence(_) + | ParserDefinition::TerminatedBy { .. } => { + // Constant number of children. Doesn't have to be named: + return true; + } + + ParserDefinition::OneOrMore(_) + | ParserDefinition::SeparatedBy { .. } + | ParserDefinition::ZeroOrMore(_) => { + // Variable number of children. Must be named: + return false; + } + + ParserDefinition::Optional(optional) => { + // Optional doesn't have to be named, but its child must be. + // Otherwise, it will be indistinguishable from the parent's other children. + return self.is_single_named(optional); + } + + ParserDefinition::Reference(reference) => { + let production = &self.language.productions[reference]; + if !production.inlined { + // will always produce a named node: + return true; + } + + match &production.definition { + ProductionDefinition::Scanner { .. } => { + // If not inlined, it will always produce a named node: + return !production.inlined; + } + + ProductionDefinition::Parser { version_map } + | ProductionDefinition::TriviaParser { version_map } => { + match &version_map { + VersionMap::Unversioned(parser) => { + return self.is_single_named(parser); + } + VersionMap::Versioned(versioned) => { + return versioned.values().all(|parser| match &parser { + Some(parser) => self.is_single_named(parser), + None => true, + }); + } + }; + } + + ProductionDefinition::PrecedenceParser { version_map } => { + match &version_map { + VersionMap::Unversioned(parser) => { + return self.is_single_named(&parser.primary_expression); + } + VersionMap::Versioned(versioned) => { + return versioned.values().all(|parser| match &parser { + Some(parser) => { + self.is_single_named(&parser.primary_expression) + } + None => true, + }); + } + }; + } + }; + } + }; + } +} + +#[derive(thiserror::Error, Debug)] +enum Errors { + #[error("This parser should always produce a single named node. Otherwise, it affects its parent children count.")] + MustProduceSingleNamed, +} diff --git a/crates/codegen/schema/src/validation/rules/lints/mod.rs b/crates/codegen/schema/src/validation/rules/lints/mod.rs new file mode 100644 index 0000000000..32715cbf8d --- /dev/null +++ b/crates/codegen/schema/src/validation/rules/lints/mod.rs @@ -0,0 +1,21 @@ +mod children_count; +mod consistent_shape; + +use codegen_utils::errors::CodegenResult; + +use crate::{ + types::LanguageDefinitionRef, + validation::{ + rules::lints::{children_count::ChildrenCount, consistent_shape::ConsistentShape}, + visitors::Reporter, + }, +}; + +pub fn run(language: &LanguageDefinitionRef) -> CodegenResult<()> { + let mut reporter = Reporter::new(); + + ChildrenCount::validate(language, &mut reporter); + ConsistentShape::validate(language, &mut reporter); + + return reporter.to_result(); +} diff --git a/crates/codegen/schema/src/validation/rules/mod.rs b/crates/codegen/schema/src/validation/rules/mod.rs index af2ec6f892..e5d3d869ff 100644 --- a/crates/codegen/schema/src/validation/rules/mod.rs +++ b/crates/codegen/schema/src/validation/rules/mod.rs @@ -1,4 +1,5 @@ +mod utils; + pub mod definitions; -pub mod empty_roots; -pub mod language_versions; +pub mod lints; pub mod references; diff --git a/crates/codegen/schema/src/validation/rules/references/collector.rs b/crates/codegen/schema/src/validation/rules/references/collector.rs index 4fb44b7bfd..8a75696068 100644 --- a/crates/codegen/schema/src/validation/rules/references/collector.rs +++ b/crates/codegen/schema/src/validation/rules/references/collector.rs @@ -1,30 +1,32 @@ use crate::{ - types::ProductionRef, + types::{LanguageDefinitionRef, ProductionRef}, validation::{ rules::references::metadata::Metadata, - visitors::{LocationRef, Reporter, VersionSet, Visitor}, + visitors::{run_visitor, LocationRef, Reporter, VersionSet, Visitor}, }, }; -pub struct Collector { - metadata: Metadata, +pub struct Collector<'collector> { + metadata: &'collector mut Metadata, current_production: Option, } -impl Collector { - pub fn new() -> Self { - return Self { - metadata: Metadata::new(), +impl<'collector> Collector<'collector> { + pub fn collect<'call: 'collector>( + language: &'call LanguageDefinitionRef, + metadata: &'call mut Metadata, + reporter: &'call mut Reporter, + ) { + let mut instance = Self { + metadata, current_production: None, }; - } - pub fn metadata(self) -> Metadata { - return self.metadata; + run_visitor(&mut instance, language, reporter); } } -impl Visitor for Collector { +impl Visitor for Collector<'_> { fn visit_production( &mut self, production: &ProductionRef, diff --git a/crates/codegen/schema/src/validation/rules/references/metadata.rs b/crates/codegen/schema/src/validation/rules/references/metadata.rs index 79753e7b66..b75d730f4d 100644 --- a/crates/codegen/schema/src/validation/rules/references/metadata.rs +++ b/crates/codegen/schema/src/validation/rules/references/metadata.rs @@ -42,22 +42,25 @@ impl Metadata { production.defined_in = production.defined_in.union(version_set); } + pub fn is_defined_over(&self, production: &str, version_set: &VersionSet) -> bool { + let production = self.productions.get(production).unwrap(); + return version_set.difference(&production.defined_in).is_empty(); + } + pub fn add_reference( &mut self, - production: &str, + production_name: &str, version_set: &VersionSet, - reference: &str, - ) -> bool { - let production = self.productions.get_mut(production).unwrap(); - production.references.insert(reference.to_owned()); - - let reference = self.productions.get_mut(reference).unwrap(); + reference_name: &str, + ) { + let reference = self.productions.get_mut(reference_name).unwrap(); reference.used_in = reference.used_in.union(version_set); - return version_set.difference(&reference.defined_in).is_empty(); + let production = self.productions.get_mut(production_name).unwrap(); + production.references.insert(reference_name.to_owned()); } - pub fn check_not_used(&self, language: &LanguageDefinitionRef, reporter: &mut Reporter) { + pub fn validate_not_used(&self, language: &LanguageDefinitionRef, reporter: &mut Reporter) { let required_productions = language.required_productions(); for production_name in language.productions.keys() { @@ -77,7 +80,11 @@ impl Metadata { } } - pub fn check_not_reachable(&self, language: &LanguageDefinitionRef, reporter: &mut Reporter) { + pub fn validate_not_reachable( + &self, + language: &LanguageDefinitionRef, + reporter: &mut Reporter, + ) { let mut visited = IndexSet::new(); let mut queue = language diff --git a/crates/codegen/schema/src/validation/rules/references/mod.rs b/crates/codegen/schema/src/validation/rules/references/mod.rs index 318b3a7533..1a60368d46 100644 --- a/crates/codegen/schema/src/validation/rules/references/mod.rs +++ b/crates/codegen/schema/src/validation/rules/references/mod.rs @@ -7,30 +7,20 @@ use codegen_utils::errors::CodegenResult; use crate::{ types::LanguageDefinitionRef, validation::{ - rules::references::{collector::Collector, validator::Validator}, - visitors::{run_visitor, Reporter}, + rules::references::{collector::Collector, metadata::Metadata, validator::Validator}, + visitors::Reporter, }, }; pub fn run(language: &LanguageDefinitionRef) -> CodegenResult<()> { + let mut metadata = Metadata::new(); let mut reporter = Reporter::new(); - let metadata = { - let mut collector = Collector::new(); - run_visitor(&mut collector, language, &mut reporter); + Collector::collect(language, &mut metadata, &mut reporter); + Validator::validate(language, &mut metadata, &mut reporter); - collector.metadata() - }; - - let metadata = { - let mut validator = Validator::new(language, metadata); - run_visitor(&mut validator, language, &mut reporter); - - validator.metadata() - }; - - metadata.check_not_used(language, &mut reporter); - metadata.check_not_reachable(language, &mut reporter); + metadata.validate_not_used(language, &mut reporter); + metadata.validate_not_reachable(language, &mut reporter); return reporter.to_result(); } diff --git a/crates/codegen/schema/src/validation/rules/references/validator.rs b/crates/codegen/schema/src/validation/rules/references/validator.rs index 40877dfde3..9e5cbc0b0b 100644 --- a/crates/codegen/schema/src/validation/rules/references/validator.rs +++ b/crates/codegen/schema/src/validation/rules/references/validator.rs @@ -4,34 +4,36 @@ use crate::{ ScannerDefinition, ScannerRef, }, validation::{ - rules::references::metadata::Metadata, - visitors::{LocationRef, Reporter, VersionSet, Visitor}, + rules::{references::metadata::Metadata, utils::is_a_keyword_scanner}, + visitors::{run_visitor, LocationRef, Reporter, VersionSet, Visitor}, }, }; -pub struct Validator { +pub struct Validator<'validator> { language: LanguageDefinitionRef, - metadata: Metadata, + metadata: &'validator mut Metadata, current_production: Option, current_version_set: Option, } -impl Validator { - pub fn new(language: &LanguageDefinitionRef, metadata: Metadata) -> Self { - return Self { +impl<'validator> Validator<'validator> { + pub fn validate<'call: 'validator>( + language: &'call LanguageDefinitionRef, + metadata: &'call mut Metadata, + reporter: &'call mut Reporter, + ) { + let mut instance = Self { language: language.to_owned(), metadata, current_production: None, current_version_set: None, }; - } - pub fn metadata(self) -> Metadata { - return self.metadata; + run_visitor(&mut instance, language, reporter); } } -impl Visitor for Validator { +impl Visitor for Validator<'_> { fn visit_production( &mut self, production: &ProductionRef, @@ -59,7 +61,12 @@ impl Visitor for Validator { reporter: &mut Reporter, ) -> bool { if let ScannerDefinition::Reference(reference) = &scanner.definition { - self.check_scanner_reference(&reference, location, reporter); + self.validate_reference( + &reference, + ReferenceKind::ScannerToScanner, + location, + reporter, + ); } return true; @@ -73,17 +80,42 @@ impl Visitor for Validator { ) -> bool { match &parser.definition { ParserDefinition::Reference(reference) => { - self.check_any_reference(reference, location, reporter); + self.validate_reference( + reference, + ReferenceKind::ParserToAnything, + location, + reporter, + ); } ParserDefinition::DelimitedBy { open, close, .. } => { - self.check_scanner_reference(&open.reference, location, reporter); - self.check_scanner_reference(&close.reference, location, reporter); + self.validate_reference( + &open.reference, + ReferenceKind::ParserToScanner, + location, + reporter, + ); + self.validate_reference( + &close.reference, + ReferenceKind::ParserToScanner, + location, + reporter, + ); } ParserDefinition::SeparatedBy { separator, .. } => { - self.check_scanner_reference(&separator.reference, location, reporter); + self.validate_reference( + &separator.reference, + ReferenceKind::ParserToScanner, + location, + reporter, + ); } ParserDefinition::TerminatedBy { terminator, .. } => { - self.check_scanner_reference(&terminator.reference, location, reporter); + self.validate_reference( + &terminator.reference, + ReferenceKind::ParserToScanner, + location, + reporter, + ); } _ => {} }; @@ -92,63 +124,82 @@ impl Visitor for Validator { } } -impl Validator { - fn check_any_reference( +enum ReferenceKind { + ParserToAnything, + ParserToScanner, + ScannerToScanner, +} + +impl Validator<'_> { + fn validate_reference( &mut self, - reference: &str, + reference_name: &str, + validation_kind: ReferenceKind, location: &LocationRef, reporter: &mut Reporter, ) { - match self.language.productions.get(reference) { - Some(_) => { - self.insert_reference(reference, location, reporter); - } + let production = self.current_production.as_ref().unwrap(); + let version_set = self.current_version_set.as_ref().unwrap(); + + if production.name == reference_name + && !matches!( + production.definition, + ProductionDefinition::PrecedenceParser { .. } + ) + { + reporter.report(location, Errors::SelfReference(reference_name.to_owned())); + return; + } + + let reference = match self.language.productions.get(reference_name) { + Some(reference) => reference, None => { - reporter.report(location, Errors::NotDefined(reference.to_owned())); + reporter.report(location, Errors::NotDefined(reference_name.to_owned())); + return; } }; - } - fn check_scanner_reference( - &mut self, - reference: &str, - location: &LocationRef, - reporter: &mut Reporter, - ) { - match self.language.productions.get(reference) { - Some(production) => match production.definition { - ProductionDefinition::Scanner { .. } => { - self.insert_reference(reference, location, reporter); + if !self.metadata.is_defined_over(reference_name, version_set) { + reporter.report( + &location, + Errors::ReferenceVersionNotDefined( + reference_name.to_owned(), + version_set.to_owned(), + ), + ); + return; + } + + match validation_kind { + ReferenceKind::ParserToAnything => { + if matches!(reference.definition, ProductionDefinition::Scanner { .. }) { + if reference.inlined { + reporter + .report(location, Errors::CannotBeInlined(reference_name.to_owned())); + } } - _ => { + } + ReferenceKind::ParserToScanner => { + if !matches!(reference.definition, ProductionDefinition::Scanner { .. }) { reporter.report(location, Errors::MustBeScanner); + } else if reference.inlined { + reporter.report(location, Errors::CannotBeInlined(reference_name.to_owned())); + } + } + ReferenceKind::ScannerToScanner => { + if !matches!(reference.definition, ProductionDefinition::Scanner { .. }) { + reporter.report(location, Errors::MustBeScanner); + } else if !reference.inlined { + // Skip validation if this is a keyword + if !is_a_keyword_scanner(reference_name) { + reporter.report(location, Errors::MustBeInlined(reference_name.to_owned())); + } } - }, - None => { - reporter.report(location, Errors::NotDefined(reference.to_owned())); } }; - } - fn insert_reference( - &mut self, - reference: &str, - location: &LocationRef, - reporter: &mut Reporter, - ) { - let production = self.current_production.as_ref().unwrap(); - let version_set = self.current_version_set.as_ref().unwrap(); - - let can_be_added = self - .metadata - .add_reference(&production.name, &version_set, reference); - - if !can_be_added { - reporter.report( - &location, - Errors::ReferenceVersionNotDefined(reference.to_owned(), version_set.to_owned()), - ); - } + self.metadata + .add_reference(&production.name, &version_set, reference_name); } } @@ -156,8 +207,14 @@ impl Validator { enum Errors { #[error("Production '{0}' is not defined anywhere in the grammar.")] NotDefined(String), + #[error("Production '{0}' cannot reference itself.")] + SelfReference(String), #[error("A scanner may only reference other scanners.")] MustBeScanner, #[error("Production '{0}' is not fully defined in versions: {1}")] ReferenceVersionNotDefined(String, VersionSet), + #[error("Production '{0}' cannot be inlined to be valid here.")] + CannotBeInlined(String), + #[error("Production '{0}' must be inlined to be valid here.")] + MustBeInlined(String), } diff --git a/crates/codegen/schema/src/validation/rules/utils.rs b/crates/codegen/schema/src/validation/rules/utils.rs new file mode 100644 index 0000000000..415fa6f60a --- /dev/null +++ b/crates/codegen/schema/src/validation/rules/utils.rs @@ -0,0 +1,15 @@ +pub fn is_a_keyword_scanner(reference_name: &str) -> bool { + // TODO: when Keywords are implemented, we can allow referencing them from scanners. + // In the meantime, let's just skip them from this validation. + // https://github.com/NomicFoundation/slang/issues/505 + + return match reference_name { + "FixedBytesType" + | "SignedFixedType" + | "UnsignedFixedType" + | "SignedIntegerType" + | "UnsignedIntegerType" => true, + keyword if keyword.contains("Keyword") || keyword.contains("ReservedWord") => true, + _ => false, + }; +} diff --git a/crates/codegen/schema/src/validation/visitors/receivers.rs b/crates/codegen/schema/src/validation/visitors/receivers.rs index 78e1539b8a..910472abfa 100644 --- a/crates/codegen/schema/src/validation/visitors/receivers.rs +++ b/crates/codegen/schema/src/validation/visitors/receivers.rs @@ -268,7 +268,7 @@ impl Receiver for PrecedenceParserRef { } { - let location = location.field("definitions"); + let location = location.field("operators"); for (i, definition) in self.operators.iter().enumerate() { let location = location.index(i).field("operator"); definition diff --git a/crates/solidity/inputs/language/definition/01-file-structure/02-source-unit/productions.yml b/crates/solidity/inputs/language/definition/01-file-structure/02-source-unit/productions.yml index f9bfb65196..455f1e2d2e 100644 --- a/crates/solidity/inputs/language/definition/01-file-structure/02-source-unit/productions.yml +++ b/crates/solidity/inputs/language/definition/01-file-structure/02-source-unit/productions.yml @@ -4,43 +4,46 @@ kind: "Parser" unversioned: sequence: - - zeroOrMore: - choice: - - reference: "Directive" - - reference: "Definition" + - optional: + reference: "SourceUnitMembersList" - optional: reference: "EndOfFileTrivia" -- name: "Directive" +- name: "SourceUnitMembersList" kind: "Parser" unversioned: - choice: - - reference: "PragmaDirective" - - reference: "ImportDirective" - - reference: "UsingDirective" + oneOrMore: + reference: "SourceUnitMember" -- name: "Definition" +- name: "SourceUnitMember" kind: "Parser" + inlined: true versioned: 0.4.11: choice: - - reference: "ConstantDefinition" - reference: "ContractDefinition" - - reference: "EnumDefinition" - - reference: "ErrorDefinition" - - reference: "FunctionDefinition" - - reference: "InterfaceDefinition" - reference: "LibraryDefinition" + - reference: "InterfaceDefinition" - reference: "StructDefinition" + - reference: "EnumDefinition" + - reference: "ConstantDefinition" + - reference: "FunctionDefinition" + - reference: "ErrorDefinition" + - reference: "ImportDirective" + - reference: "PragmaDirective" + - reference: "UsingDirective" 0.8.8: - # added: UserDefinedValueTypeDefinition choice: - - reference: "ConstantDefinition" - reference: "ContractDefinition" - - reference: "EnumDefinition" - - reference: "ErrorDefinition" - - reference: "FunctionDefinition" - - reference: "InterfaceDefinition" - reference: "LibraryDefinition" + - reference: "InterfaceDefinition" - reference: "StructDefinition" + - reference: "EnumDefinition" + - reference: "ConstantDefinition" + - reference: "FunctionDefinition" + - reference: "ErrorDefinition" + - reference: "ImportDirective" + - reference: "PragmaDirective" + - reference: "UsingDirective" + # added: - reference: "UserDefinedValueTypeDefinition" diff --git a/crates/solidity/inputs/language/definition/01-file-structure/03-pragmas/productions.yml b/crates/solidity/inputs/language/definition/01-file-structure/03-pragmas/productions.yml index b96873e2c3..fb1cd85133 100644 --- a/crates/solidity/inputs/language/definition/01-file-structure/03-pragmas/productions.yml +++ b/crates/solidity/inputs/language/definition/01-file-structure/03-pragmas/productions.yml @@ -8,49 +8,86 @@ sequence: - reference: "PragmaKeyword" - choice: - - reference: "VersionPragma" - reference: "ABICoderPragma" - reference: "ExperimentalPragma" + - reference: "VersionPragma" terminator: reference: "Semicolon" +- name: "ABICoderPragma" + kind: "Parser" + unversioned: + sequence: + - reference: "AbicoderKeyword" + - reference: "Identifier" + +- name: "ExperimentalPragma" + kind: "Parser" + unversioned: + sequence: + - reference: "ExperimentalKeyword" + - reference: "Identifier" + - name: "VersionPragma" kind: "Parser" unversioned: sequence: - reference: "SolidityKeyword" - - name: "VersionPragmaExpressionList" - oneOrMore: - reference: "VersionPragmaExpression" + - reference: "VersionPragmaExpressionsList" + +- name: "VersionPragmaExpressionsList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "VersionPragmaExpression" - name: "VersionPragmaExpression" kind: "PrecedenceParser" - inlined: true unversioned: operators: - - name: "VersionPragmaAlternatives" + - name: "VersionPragmaBinaryExpression" model: "BinaryLeftAssociative" operator: - reference: "BarBar" - - name: "VersionPragmaRange" + reference: "VersionPragmaOrOperator" + + - name: "VersionPragmaBinaryExpression" model: "BinaryLeftAssociative" operator: - reference: "Minus" - - name: "VersionPragmaComparator" + reference: "VersionPragmaRangeOperator" + + - name: "VersionPragmaUnaryExpression" model: "UnaryPrefix" operator: - choice: - - reference: "Caret" - - reference: "Tilde" - - reference: "Equal" - - reference: "LessThan" - - reference: "GreaterThan" - - reference: "LessThanEqual" - - reference: "GreaterThanEqual" + reference: "VersionPragmaUnaryOperator" primaryExpression: reference: "VersionPragmaSpecifier" +- name: "VersionPragmaOrOperator" + kind: "Parser" + inlined: true + unversioned: + reference: "BarBar" + +- name: "VersionPragmaRangeOperator" + kind: "Parser" + inlined: true + unversioned: + reference: "Minus" + +- name: "VersionPragmaUnaryOperator" + kind: "Parser" + inlined: true + unversioned: + choice: + - reference: "Caret" + - reference: "Tilde" + - reference: "Equal" + - reference: "LessThan" + - reference: "GreaterThan" + - reference: "LessThanEqual" + - reference: "GreaterThanEqual" + - name: "VersionPragmaSpecifier" kind: "Parser" unversioned: @@ -71,17 +108,3 @@ - terminal: "x" - terminal: "X" - terminal: "*" - -- name: "ABICoderPragma" - kind: "Parser" - unversioned: - sequence: - - reference: "AbicoderKeyword" - - reference: "Identifier" - -- name: "ExperimentalPragma" - kind: "Parser" - unversioned: - sequence: - - reference: "ExperimentalKeyword" - - reference: "Identifier" diff --git a/crates/solidity/inputs/language/definition/01-file-structure/04-imports/productions.yml b/crates/solidity/inputs/language/definition/01-file-structure/04-imports/productions.yml index 51dc30987c..8621891ae5 100644 --- a/crates/solidity/inputs/language/definition/01-file-structure/04-imports/productions.yml +++ b/crates/solidity/inputs/language/definition/01-file-structure/04-imports/productions.yml @@ -8,30 +8,33 @@ sequence: - reference: "ImportKeyword" - choice: - - reference: "SimpleImport" - - reference: "AsteriskImport" - - reference: "SelectiveImport" + - reference: "PathImport" + - reference: "NamedImport" + - reference: "DeconstructionImport" terminator: reference: "Semicolon" -- name: "SimpleImport" +- name: "PathImport" kind: "Parser" unversioned: sequence: - - reference: "ImportPath" + - reference: "AsciiStringLiteral" - optional: - reference: "ImportAlias" + sequence: + - reference: "AsKeyword" + - reference: "Identifier" -- name: "AsteriskImport" +- name: "NamedImport" kind: "Parser" unversioned: sequence: - reference: "Asterisk" - - reference: "ImportAlias" + - reference: "AsKeyword" + - reference: "Identifier" - reference: "FromKeyword" - - reference: "ImportPath" + - reference: "AsciiStringLiteral" -- name: "SelectiveImport" +- name: "DeconstructionImport" kind: "Parser" unversioned: sequence: @@ -39,99 +42,96 @@ open: reference: "OpenBrace" expression: - separatedBy: - separator: - reference: "Comma" - expression: - sequence: - - reference: "Identifier" - - optional: - reference: "ImportAlias" + reference: "DeconstructionImportSymbolsList" close: reference: "CloseBrace" - reference: "FromKeyword" - - reference: "ImportPath" + - reference: "AsciiStringLiteral" -- name: "ImportAlias" +- name: "DeconstructionImportSymbolsList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "DeconstructionImportSymbol" + +- name: "DeconstructionImportSymbol" kind: "Parser" unversioned: sequence: - - reference: "AsKeyword" - reference: "Identifier" + - optional: + sequence: + - reference: "AsKeyword" + - reference: "Identifier" + +- name: "UsingDirective" + kind: "Parser" + unversioned: + terminatedBy: + expression: + sequence: + - reference: "UsingKeyword" + - choice: + - reference: "UsingDirectivePath" + - reference: "UsingDirectiveDeconstruction" + - reference: "ForKeyword" + - choice: + - reference: "Asterisk" + - reference: "TypeName" + - optional: + reference: "GlobalKeyword" + terminator: + reference: "Semicolon" -- name: "ImportPath" +- name: "UsingDirectivePath" kind: "Parser" unversioned: - reference: "AsciiStringLiteral" + reference: "IdentifierPath" -- name: "UsingDirective" +- name: "UsingDirectiveDeconstruction" + kind: "Parser" + unversioned: + delimitedBy: + open: + reference: "OpenBrace" + expression: + reference: "UsingDirectiveSymbolsList" + close: + reference: "CloseBrace" + +- name: "UsingDirectiveSymbolsList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "UsingDirectiveSymbol" + +- name: "UsingDirectiveSymbol" kind: "Parser" versioned: 0.4.11: - terminatedBy: - expression: - sequence: - - reference: "UsingKeyword" - - choice: - - reference: "IdentifierPath" - - delimitedBy: - open: - reference: "OpenBrace" - expression: - separatedBy: - separator: - reference: "Comma" - expression: - reference: "IdentifierPath" - close: - reference: "CloseBrace" - - reference: "ForKeyword" - - choice: - - reference: "Asterisk" - - reference: "TypeName" - - optional: - reference: "GlobalKeyword" - terminator: - reference: "Semicolon" + reference: "IdentifierPath" 0.8.19: - # Added "UserDefinedOperator" - terminatedBy: - expression: - sequence: - - reference: "UsingKeyword" - - choice: - - reference: "IdentifierPath" - - delimitedBy: - open: - reference: "OpenBrace" - expression: - separatedBy: - separator: - reference: "Comma" - expression: - sequence: - - reference: "IdentifierPath" - - optional: - sequence: - - reference: "AsKeyword" - - reference: "UserDefinedOperator" - close: - reference: "CloseBrace" - - reference: "ForKeyword" - - choice: - - reference: "Asterisk" - - reference: "TypeName" - - optional: - reference: "GlobalKeyword" - terminator: - reference: "Semicolon" + sequence: + - reference: "IdentifierPath" + - optional: + sequence: + - reference: "AsKeyword" + - reference: "UsingDirectiveOperator" -- name: "UserDefinedOperator" +- name: "UsingDirectiveOperator" kind: "Parser" + inlined: true versioned: 0.8.19: choice: - reference: "Ampersand" + - reference: "Asterisk" - reference: "BangEqual" - reference: "Bar" - reference: "Caret" @@ -144,5 +144,4 @@ - reference: "Percent" - reference: "Plus" - reference: "Slash" - - reference: "Asterisk" - reference: "Tilde" diff --git a/crates/solidity/inputs/language/definition/01-file-structure/07-keywords/productions.yml b/crates/solidity/inputs/language/definition/01-file-structure/07-keywords/productions.yml index 2eb8e46399..03c73c7864 100644 --- a/crates/solidity/inputs/language/definition/01-file-structure/07-keywords/productions.yml +++ b/crates/solidity/inputs/language/definition/01-file-structure/07-keywords/productions.yml @@ -71,6 +71,17 @@ notFollowedBy: reference: "IdentifierPart" +- name: "ByteKeyword" + kind: "Scanner" + versioned: + 0.4.11: + trailingContext: + expression: + terminal: "byte" + notFollowedBy: + reference: "IdentifierPart" + 0.8.0: null + - name: "CalldataKeyword" kind: "Scanner" versioned: diff --git a/crates/solidity/inputs/language/definition/02-definitions/01-contracts/productions.yml b/crates/solidity/inputs/language/definition/02-definitions/01-contracts/productions.yml index 55b3f498ea..3e0c87b1d8 100644 --- a/crates/solidity/inputs/language/definition/02-definitions/01-contracts/productions.yml +++ b/crates/solidity/inputs/language/definition/02-definitions/01-contracts/productions.yml @@ -8,14 +8,13 @@ - reference: "ContractKeyword" - reference: "Identifier" - optional: - reference: "InheritanceSpecifierList" + reference: "InheritanceSpecifier" - delimitedBy: open: reference: "OpenBrace" expression: - name: "ContractBodyElements" - zeroOrMore: - reference: "ContractBodyElement" + optional: + reference: "ContractMembersList" close: reference: "CloseBrace" 0.6.0: @@ -26,37 +25,47 @@ - reference: "ContractKeyword" - reference: "Identifier" - optional: - reference: "InheritanceSpecifierList" + reference: "InheritanceSpecifier" - delimitedBy: open: reference: "OpenBrace" expression: - name: "ContractBodyElements" - zeroOrMore: - reference: "ContractBodyElement" + optional: + reference: "ContractMembersList" close: reference: "CloseBrace" -- name: "InheritanceSpecifierList" +- name: "InheritanceSpecifier" kind: "Parser" unversioned: sequence: - reference: "IsKeyword" - - separatedBy: - separator: - reference: "Comma" - expression: - reference: "InheritanceSpecifier" + - reference: "InheritanceTypesList" -- name: "InheritanceSpecifier" +- name: "InheritanceTypesList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "InheritanceType" + +- name: "InheritanceType" kind: "Parser" unversioned: sequence: - reference: "IdentifierPath" - optional: - reference: "ArgumentList" + reference: "ArgumentsDeclaration" + +- name: "ContractMembersList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "ContractMember" -- name: "ContractBodyElement" +- name: "ContractMember" kind: "Parser" inlined: true versioned: @@ -70,9 +79,9 @@ - reference: "EnumDefinition" - reference: "EventDefinition" - reference: "ErrorDefinition" - - reference: "StateVariableDeclaration" + - reference: "StateVariableDefinition" 0.4.22: - # added: ConstructorDefinition + # added: "ConstructorDefinition" choice: - reference: "UsingDirective" - reference: "ConstructorDefinition" @@ -83,11 +92,11 @@ - reference: "EnumDefinition" - reference: "EventDefinition" - reference: "ErrorDefinition" - - reference: "StateVariableDeclaration" + - reference: "StateVariableDefinition" 0.6.0: - # added: ReceiveFunctionDefinition - # added: FallbackFunctionDefinition added - # removed: UnnamedFunctionDefinition + # added: "ReceiveFunctionDefinition" + # added: "FallbackFunctionDefinition" + # removed: "UnnamedFunctionDefinition" choice: - reference: "UsingDirective" - reference: "ConstructorDefinition" @@ -99,9 +108,9 @@ - reference: "EnumDefinition" - reference: "EventDefinition" - reference: "ErrorDefinition" - - reference: "StateVariableDeclaration" + - reference: "StateVariableDefinition" 0.8.8: - # added: UserDefinedValueTypeDefinition + # added: "UserDefinedValueTypeDefinition" choice: - reference: "UsingDirective" - reference: "ConstructorDefinition" @@ -111,7 +120,7 @@ - reference: "ModifierDefinition" - reference: "StructDefinition" - reference: "EnumDefinition" - - reference: "UserDefinedValueTypeDefinition" - reference: "EventDefinition" - reference: "ErrorDefinition" - - reference: "StateVariableDeclaration" + - reference: "StateVariableDefinition" + - reference: "UserDefinedValueTypeDefinition" diff --git a/crates/solidity/inputs/language/definition/02-definitions/02-interfaces/productions.yml b/crates/solidity/inputs/language/definition/02-definitions/02-interfaces/productions.yml index 13b2c56d95..0a5f782073 100644 --- a/crates/solidity/inputs/language/definition/02-definitions/02-interfaces/productions.yml +++ b/crates/solidity/inputs/language/definition/02-definitions/02-interfaces/productions.yml @@ -7,12 +7,18 @@ - reference: "InterfaceKeyword" - reference: "Identifier" - optional: - reference: "InheritanceSpecifierList" + reference: "InheritanceSpecifier" - delimitedBy: open: reference: "OpenBrace" expression: - zeroOrMore: - reference: "ContractBodyElement" + optional: + reference: "InterfaceMembersList" close: reference: "CloseBrace" + +- name: "InterfaceMembersList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "ContractMember" diff --git a/crates/solidity/inputs/language/definition/02-definitions/03-libraries/productions.yml b/crates/solidity/inputs/language/definition/02-definitions/03-libraries/productions.yml index 187dcb732d..0a92aded39 100644 --- a/crates/solidity/inputs/language/definition/02-definitions/03-libraries/productions.yml +++ b/crates/solidity/inputs/language/definition/02-definitions/03-libraries/productions.yml @@ -10,7 +10,13 @@ open: reference: "OpenBrace" expression: - zeroOrMore: - reference: "ContractBodyElement" + optional: + reference: "LibraryMembersList" close: reference: "CloseBrace" + +- name: "LibraryMembersList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "ContractMember" diff --git a/crates/solidity/inputs/language/definition/02-definitions/04-structs/productions.yml b/crates/solidity/inputs/language/definition/02-definitions/04-structs/productions.yml index bde122cc7e..bd38344670 100644 --- a/crates/solidity/inputs/language/definition/02-definitions/04-structs/productions.yml +++ b/crates/solidity/inputs/language/definition/02-definitions/04-structs/productions.yml @@ -10,11 +10,17 @@ open: reference: "OpenBrace" expression: - oneOrMore: - reference: "StructMember" + optional: + reference: "StructMembersList" close: reference: "CloseBrace" +- name: "StructMembersList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "StructMember" + - name: "StructMember" kind: "Parser" unversioned: diff --git a/crates/solidity/inputs/language/definition/02-definitions/05-enums/productions.yml b/crates/solidity/inputs/language/definition/02-definitions/05-enums/productions.yml index 11ee73b486..3680db1b98 100644 --- a/crates/solidity/inputs/language/definition/02-definitions/05-enums/productions.yml +++ b/crates/solidity/inputs/language/definition/02-definitions/05-enums/productions.yml @@ -11,10 +11,6 @@ reference: "OpenBrace" expression: optional: - separatedBy: - separator: - reference: "Comma" - expression: - reference: "Identifier" + reference: "IdentifiersList" close: reference: "CloseBrace" diff --git a/crates/solidity/inputs/language/definition/02-definitions/07-state-variables/productions.yml b/crates/solidity/inputs/language/definition/02-definitions/07-state-variables/productions.yml index 3962b12db1..61c8dade84 100644 --- a/crates/solidity/inputs/language/definition/02-definitions/07-state-variables/productions.yml +++ b/crates/solidity/inputs/language/definition/02-definitions/07-state-variables/productions.yml @@ -1,14 +1,14 @@ # yaml-language-server: $schema=../../../generated/productions.schema.json -- name: "StateVariableDeclaration" +- name: "StateVariableDefinition" kind: "Parser" unversioned: terminatedBy: expression: sequence: - reference: "TypeName" - - zeroOrMore: - reference: "StateVariableAttribute" + - optional: + reference: "StateVariableAttributesList" - reference: "Identifier" - optional: sequence: @@ -17,8 +17,15 @@ terminator: reference: "Semicolon" +- name: "StateVariableAttributesList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "StateVariableAttribute" + - name: "StateVariableAttribute" kind: "Parser" + inlined: true versioned: 0.4.11: choice: diff --git a/crates/solidity/inputs/language/definition/02-definitions/08-functions/productions.yml b/crates/solidity/inputs/language/definition/02-definitions/08-functions/productions.yml index fb5ea7c321..12f75640bc 100644 --- a/crates/solidity/inputs/language/definition/02-definitions/08-functions/productions.yml +++ b/crates/solidity/inputs/language/definition/02-definitions/08-functions/productions.yml @@ -9,27 +9,39 @@ - reference: "Identifier" - reference: "FallbackKeyword" - reference: "ReceiveKeyword" - - reference: "ParameterList" - - zeroOrMore: - reference: "FunctionAttribute" + - reference: "ParametersDeclaration" - optional: - sequence: - - reference: "ReturnsKeyword" - - reference: "ParameterList" + reference: "FunctionAttributesList" + - optional: + reference: "ReturnsDeclaration" - choice: - reference: "Semicolon" - reference: "Block" +- name: "ReturnsDeclaration" + kind: "Parser" + unversioned: + sequence: + - reference: "ReturnsKeyword" + - reference: "ParametersDeclaration" + +- name: "FunctionAttributesList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "FunctionAttribute" + - name: "FunctionAttribute" kind: "Parser" + inlined: true versioned: 0.4.11: choice: + - reference: "ModifierInvocation" + - reference: "OverrideSpecifier" - reference: "ConstantKeyword" - reference: "ExternalKeyword" - reference: "InternalKeyword" - - reference: "ModifierInvocation" - - reference: "OverrideSpecifier" - reference: "PayableKeyword" - reference: "PrivateKeyword" - reference: "PublicKeyword" @@ -38,10 +50,10 @@ 0.5.0: # removed: ConstantKeyword choice: - - reference: "ExternalKeyword" - - reference: "InternalKeyword" - reference: "ModifierInvocation" - reference: "OverrideSpecifier" + - reference: "ExternalKeyword" + - reference: "InternalKeyword" - reference: "PayableKeyword" - reference: "PrivateKeyword" - reference: "PublicKeyword" @@ -50,10 +62,10 @@ 0.6.0: # added: VirtualKeyword choice: - - reference: "ExternalKeyword" - - reference: "InternalKeyword" - reference: "ModifierInvocation" - reference: "OverrideSpecifier" + - reference: "ExternalKeyword" + - reference: "InternalKeyword" - reference: "PayableKeyword" - reference: "PrivateKeyword" - reference: "PublicKeyword" @@ -71,41 +83,12 @@ open: reference: "OpenParen" expression: - separatedBy: - separator: - reference: "Comma" - expression: - reference: "IdentifierPath" + optional: + reference: "IdentifierPathsList" close: reference: "CloseParen" -- name: "ParameterList" - kind: "Parser" - unversioned: - delimitedBy: - open: - reference: "OpenParen" - expression: - optional: - separatedBy: - separator: - reference: "Comma" - expression: - reference: "ParameterDeclaration" - close: - reference: "CloseParen" - -- name: "ParameterDeclaration" - kind: "Parser" - unversioned: - sequence: - - reference: "TypeName" - - optional: - reference: "DataLocation" - - optional: - reference: "Identifier" - -- name: "ArgumentList" +- name: "ParametersDeclaration" kind: "Parser" unversioned: delimitedBy: @@ -113,61 +96,28 @@ reference: "OpenParen" expression: optional: - choice: - - reference: "PositionalArgumentList" - - reference: "NamedArgumentList" + reference: "ParametersList" close: reference: "CloseParen" -- name: "PositionalArgumentList" +- name: "ParametersList" kind: "Parser" unversioned: separatedBy: separator: reference: "Comma" expression: - reference: "Expression" - -- name: "NamedArgumentList" - kind: "Parser" - unversioned: - delimitedBy: - open: - reference: "OpenBrace" - expression: - optional: - separatedBy: - separator: - reference: "Comma" - expression: - reference: "NamedArgument" - close: - reference: "CloseBrace" + reference: "Parameter" -- name: "FunctionCallOptions" - kind: "Parser" - versioned: - 0.6.2: - delimitedBy: - open: - reference: "OpenBrace" - expression: - optional: - separatedBy: - separator: - reference: "Comma" - expression: - reference: "NamedArgument" - close: - reference: "CloseBrace" - -- name: "NamedArgument" +- name: "Parameter" kind: "Parser" unversioned: sequence: - - reference: "Identifier" - - reference: "Colon" - - reference: "Expression" + - reference: "TypeName" + - optional: + reference: "DataLocation" + - optional: + reference: "Identifier" - name: "ConstructorDefinition" kind: "Parser" @@ -175,13 +125,21 @@ 0.4.22: sequence: - reference: "ConstructorKeyword" - - reference: "ParameterList" - - zeroOrMore: - reference: "ConstructorAttribute" + - reference: "ParametersDeclaration" + - optional: + reference: "ConstructorAttributesList" - reference: "Block" +- name: "ConstructorAttributesList" + kind: "Parser" + versioned: + 0.4.22: + oneOrMore: + reference: "ConstructorAttribute" + - name: "ConstructorAttribute" kind: "Parser" + inlined: true versioned: 0.4.22: choice: @@ -196,16 +154,25 @@ 0.4.11: sequence: - reference: "FunctionKeyword" - - reference: "ParameterList" - - zeroOrMore: - reference: "UnnamedFunctionAttribute" + - reference: "ParametersDeclaration" + - optional: + reference: "UnnamedFunctionAttributesList" - choice: - reference: "Semicolon" - reference: "Block" 0.6.0: null +- name: "UnnamedFunctionAttributesList" + kind: "Parser" + versioned: + 0.4.11: + oneOrMore: + reference: "UnnamedFunctionAttribute" + 0.6.0: null + - name: "UnnamedFunctionAttribute" kind: "Parser" + inlined: true versioned: 0.4.11: choice: @@ -223,19 +190,25 @@ 0.6.0: sequence: - reference: "FallbackKeyword" - - reference: "ParameterList" - - zeroOrMore: - reference: "FallbackFunctionAttribute" + - reference: "ParametersDeclaration" + - optional: + reference: "FallbackFunctionAttributesList" - optional: - sequence: - - reference: "ReturnsKeyword" - - reference: "ParameterList" + reference: "ReturnsDeclaration" - choice: - reference: "Semicolon" - reference: "Block" +- name: "FallbackFunctionAttributesList" + kind: "Parser" + versioned: + 0.6.0: + oneOrMore: + reference: "FallbackFunctionAttribute" + - name: "FallbackFunctionAttribute" kind: "Parser" + inlined: true versioned: 0.6.0: choice: @@ -253,15 +226,23 @@ 0.6.0: sequence: - reference: "ReceiveKeyword" - - reference: "ParameterList" - - zeroOrMore: - reference: "ReceiveFunctionAttribute" + - reference: "ParametersDeclaration" + - optional: + reference: "ReceiveFunctionAttributesList" - choice: - reference: "Semicolon" - reference: "Block" +- name: "ReceiveFunctionAttributesList" + kind: "Parser" + versioned: + 0.6.0: + oneOrMore: + reference: "ReceiveFunctionAttribute" + - name: "ReceiveFunctionAttribute" kind: "Parser" + inlined: true versioned: 0.6.0: choice: diff --git a/crates/solidity/inputs/language/definition/02-definitions/09-modifiers/productions.yml b/crates/solidity/inputs/language/definition/02-definitions/09-modifiers/productions.yml index 2d82f0b5b2..a7d982b904 100644 --- a/crates/solidity/inputs/language/definition/02-definitions/09-modifiers/productions.yml +++ b/crates/solidity/inputs/language/definition/02-definitions/09-modifiers/productions.yml @@ -7,15 +7,22 @@ - reference: "ModifierKeyword" - reference: "Identifier" - optional: - reference: "ParameterList" - - zeroOrMore: - reference: "ModifierAttribute" + reference: "ParametersDeclaration" + - optional: + reference: "ModifierAttributesList" - choice: - reference: "Semicolon" - reference: "Block" +- name: "ModifierAttributesList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "ModifierAttribute" + - name: "ModifierAttribute" kind: "Parser" + inlined: true versioned: 0.4.11: reference: "OverrideSpecifier" @@ -30,4 +37,4 @@ sequence: - reference: "IdentifierPath" - optional: - reference: "ArgumentList" + reference: "ArgumentsDeclaration" diff --git a/crates/solidity/inputs/language/definition/02-definitions/10-events/productions.yml b/crates/solidity/inputs/language/definition/02-definitions/10-events/productions.yml index 6408741441..6413a0b3a0 100644 --- a/crates/solidity/inputs/language/definition/02-definitions/10-events/productions.yml +++ b/crates/solidity/inputs/language/definition/02-definitions/10-events/productions.yml @@ -13,11 +13,7 @@ reference: "OpenParen" expression: optional: - separatedBy: - separator: - reference: "Comma" - expression: - reference: "EventParameter" + reference: "EventParametersList" close: reference: "CloseParen" - optional: @@ -25,6 +21,15 @@ terminator: reference: "Semicolon" +- name: "EventParametersList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "EventParameter" + - name: "EventParameter" kind: "Parser" unversioned: diff --git a/crates/solidity/inputs/language/definition/02-definitions/12-errors/productions.yml b/crates/solidity/inputs/language/definition/02-definitions/12-errors/productions.yml index 2bad16cb35..0a0e4a2fd2 100644 --- a/crates/solidity/inputs/language/definition/02-definitions/12-errors/productions.yml +++ b/crates/solidity/inputs/language/definition/02-definitions/12-errors/productions.yml @@ -13,16 +13,21 @@ reference: "OpenParen" expression: optional: - separatedBy: - separator: - reference: "Comma" - expression: - reference: "ErrorParameter" + reference: "ErrorParametersList" close: reference: "CloseParen" terminator: reference: "Semicolon" +- name: "ErrorParametersList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "ErrorParameter" + - name: "ErrorParameter" kind: "Parser" unversioned: diff --git a/crates/solidity/inputs/language/definition/03-types/01-advanced-types/productions.yml b/crates/solidity/inputs/language/definition/03-types/01-advanced-types/productions.yml index e9df80b66c..8d175cf36b 100644 --- a/crates/solidity/inputs/language/definition/03-types/01-advanced-types/productions.yml +++ b/crates/solidity/inputs/language/definition/03-types/01-advanced-types/productions.yml @@ -7,14 +7,7 @@ - name: "ArrayTypeName" model: "UnaryPostfix" operator: - delimitedBy: - open: - reference: "OpenBracket" - expression: - optional: - reference: "Expression" - close: - reference: "CloseBracket" + reference: "ArrayTypeNameOperator" primaryExpression: choice: @@ -23,25 +16,48 @@ - reference: "ElementaryType" - reference: "IdentifierPath" +- name: "ArrayTypeNameOperator" + kind: "Parser" + inlined: true + unversioned: + delimitedBy: + open: + reference: "OpenBracket" + expression: + optional: + reference: "Expression" + close: + reference: "CloseBracket" + - name: "FunctionType" kind: "Parser" unversioned: sequence: - reference: "FunctionKeyword" - - reference: "ParameterList" - - zeroOrMore: - choice: - - reference: "InternalKeyword" - - reference: "ExternalKeyword" - - reference: "PrivateKeyword" - - reference: "PublicKeyword" - - reference: "PureKeyword" - - reference: "ViewKeyword" - - reference: "PayableKeyword" + - reference: "ParametersDeclaration" - optional: - sequence: - - reference: "ReturnsKeyword" - - reference: "ParameterList" + reference: "FunctionTypeAttributesList" + - optional: + reference: "ReturnsDeclaration" + +- name: "FunctionTypeAttributesList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "FunctionTypeAttribute" + +- name: "FunctionTypeAttribute" + kind: "Parser" + inlined: true + unversioned: + choice: + - reference: "InternalKeyword" + - reference: "ExternalKeyword" + - reference: "PrivateKeyword" + - reference: "PublicKeyword" + - reference: "PureKeyword" + - reference: "ViewKeyword" + - reference: "PayableKeyword" - name: "MappingType" kind: "Parser" @@ -63,10 +79,9 @@ kind: "Parser" versioned: 0.4.11: - sequence: - - choice: - - reference: "ElementaryType" - - reference: "IdentifierPath" + choice: + - reference: "ElementaryType" + - reference: "IdentifierPath" 0.8.18: sequence: - choice: @@ -79,8 +94,7 @@ kind: "Parser" versioned: 0.4.11: - sequence: - - reference: "TypeName" + reference: "TypeName" 0.8.18: sequence: - reference: "TypeName" diff --git a/crates/solidity/inputs/language/definition/03-types/02-elementary-types/productions.yml b/crates/solidity/inputs/language/definition/03-types/02-elementary-types/productions.yml index bacc3e8ff4..52d82e9293 100644 --- a/crates/solidity/inputs/language/definition/03-types/02-elementary-types/productions.yml +++ b/crates/solidity/inputs/language/definition/03-types/02-elementary-types/productions.yml @@ -2,26 +2,25 @@ - name: "ElementaryType" kind: "Parser" + inlined: true versioned: 0.4.11: choice: - reference: "BoolKeyword" + - reference: "ByteKeyword" - reference: "StringKeyword" - reference: "AddressType" - - reference: "PayableType" - - reference: "ByteType" - reference: "FixedBytesType" - reference: "SignedIntegerType" - reference: "UnsignedIntegerType" - reference: "SignedFixedType" - reference: "UnsignedFixedType" 0.8.0: - # removed: ByteType + # removed: ByteKeyword choice: - reference: "BoolKeyword" - reference: "StringKeyword" - reference: "AddressType" - - reference: "PayableType" - reference: "FixedBytesType" - reference: "SignedIntegerType" - reference: "UnsignedIntegerType" @@ -31,26 +30,12 @@ - name: "AddressType" kind: "Parser" unversioned: - sequence: - - reference: "AddressKeyword" - - optional: - reference: "PayableKeyword" - -- name: "PayableType" - kind: "Parser" - unversioned: - reference: "PayableKeyword" - -- name: "ByteType" - kind: "Scanner" - versioned: - 0.4.11: - trailingContext: - expression: - terminal: "byte" - notFollowedBy: - reference: "IdentifierPart" - 0.8.0: null + choice: + - sequence: + - reference: "AddressKeyword" + - optional: + reference: "PayableKeyword" + - reference: "PayableKeyword" - name: "FixedBytesType" kind: "Scanner" @@ -59,42 +44,48 @@ expression: sequence: - terminal: "bytes" - - choice: - - terminal: "1" - - terminal: "2" - - terminal: "3" - - terminal: "4" - - terminal: "5" - - terminal: "6" - - terminal: "7" - - terminal: "8" - - terminal: "9" - - terminal: "10" - - terminal: "11" - - terminal: "12" - - terminal: "13" - - terminal: "14" - - terminal: "15" - - terminal: "16" - - terminal: "17" - - terminal: "18" - - terminal: "19" - - terminal: "20" - - terminal: "21" - - terminal: "22" - - terminal: "23" - - terminal: "24" - - terminal: "25" - - terminal: "26" - - terminal: "27" - - terminal: "28" - - terminal: "29" - - terminal: "30" - - terminal: "31" - - terminal: "32" + - reference: "FixedBytesTypeSize" notFollowedBy: reference: "IdentifierPart" +- name: "FixedBytesTypeSize" + kind: "Scanner" + inlined: true + unversioned: + choice: + - terminal: "1" + - terminal: "2" + - terminal: "3" + - terminal: "4" + - terminal: "5" + - terminal: "6" + - terminal: "7" + - terminal: "8" + - terminal: "9" + - terminal: "10" + - terminal: "11" + - terminal: "12" + - terminal: "13" + - terminal: "14" + - terminal: "15" + - terminal: "16" + - terminal: "17" + - terminal: "18" + - terminal: "19" + - terminal: "20" + - terminal: "21" + - terminal: "22" + - terminal: "23" + - terminal: "24" + - terminal: "25" + - terminal: "26" + - terminal: "27" + - terminal: "28" + - terminal: "29" + - terminal: "30" + - terminal: "31" + - terminal: "32" + - name: "SignedIntegerType" kind: "Scanner" unversioned: @@ -103,48 +94,59 @@ sequence: - terminal: "int" - optional: - choice: - - terminal: "8" - - terminal: "16" - - terminal: "24" - - terminal: "32" - - terminal: "40" - - terminal: "48" - - terminal: "56" - - terminal: "64" - - terminal: "72" - - terminal: "80" - - terminal: "88" - - terminal: "96" - - terminal: "104" - - terminal: "112" - - terminal: "120" - - terminal: "128" - - terminal: "136" - - terminal: "144" - - terminal: "152" - - terminal: "160" - - terminal: "168" - - terminal: "176" - - terminal: "184" - - terminal: "192" - - terminal: "200" - - terminal: "208" - - terminal: "216" - - terminal: "224" - - terminal: "232" - - terminal: "240" - - terminal: "248" - - terminal: "256" + reference: "IntegerTypeSize" notFollowedBy: reference: "IdentifierPart" - name: "UnsignedIntegerType" kind: "Scanner" unversioned: - sequence: - - terminal: "u" - - reference: "SignedIntegerType" + trailingContext: + expression: + sequence: + - terminal: "uint" + - optional: + reference: "IntegerTypeSize" + notFollowedBy: + reference: "IdentifierPart" + +- name: "IntegerTypeSize" + kind: "Scanner" + inlined: true + unversioned: + choice: + - terminal: "8" + - terminal: "16" + - terminal: "24" + - terminal: "32" + - terminal: "40" + - terminal: "48" + - terminal: "56" + - terminal: "64" + - terminal: "72" + - terminal: "80" + - terminal: "88" + - terminal: "96" + - terminal: "104" + - terminal: "112" + - terminal: "120" + - terminal: "128" + - terminal: "136" + - terminal: "144" + - terminal: "152" + - terminal: "160" + - terminal: "168" + - terminal: "176" + - terminal: "184" + - terminal: "192" + - terminal: "200" + - terminal: "208" + - terminal: "216" + - terminal: "224" + - terminal: "232" + - terminal: "240" + - terminal: "248" + - terminal: "256" - name: "SignedFixedType" kind: "Scanner" @@ -154,22 +156,33 @@ sequence: - terminal: "fixed" - optional: - sequence: - - oneOrMore: - range: - from: "0" - to: "9" - - terminal: "x" - - oneOrMore: - range: - from: "0" - to: "9" + reference: "FixedTypeSize" notFollowedBy: reference: "IdentifierPart" - name: "UnsignedFixedType" kind: "Scanner" + unversioned: + trailingContext: + expression: + sequence: + - terminal: "ufixed" + - optional: + reference: "FixedTypeSize" + notFollowedBy: + reference: "IdentifierPart" + +- name: "FixedTypeSize" + kind: "Scanner" + inlined: true unversioned: sequence: - - terminal: "u" - - reference: "SignedFixedType" + - oneOrMore: + range: + from: "0" + to: "9" + - terminal: "x" + - oneOrMore: + range: + from: "0" + to: "9" diff --git a/crates/solidity/inputs/language/definition/04-statements/01-blocks/productions.yml b/crates/solidity/inputs/language/definition/04-statements/01-blocks/productions.yml index ab9f5d4b7a..66ab4aedd8 100644 --- a/crates/solidity/inputs/language/definition/04-statements/01-blocks/productions.yml +++ b/crates/solidity/inputs/language/definition/04-statements/01-blocks/productions.yml @@ -2,112 +2,106 @@ - name: "Block" kind: "Parser" - versioned: - 0.4.11: - delimitedBy: - open: - reference: "OpenBrace" - expression: - zeroOrMore: - reference: "Statement" - close: - reference: "CloseBrace" - 0.8.0: - delimitedBy: - open: - reference: "OpenBrace" - expression: - zeroOrMore: - choice: - - reference: "Statement" - - reference: "UncheckedBlock" - close: - reference: "CloseBrace" + unversioned: + delimitedBy: + open: + reference: "OpenBrace" + expression: + optional: + reference: "StatementsList" + close: + reference: "CloseBrace" -- name: "UncheckedBlock" +- name: "StatementsList" kind: "Parser" - versioned: - 0.8.0: - sequence: - - reference: "UncheckedKeyword" - - reference: "Block" + unversioned: + oneOrMore: + reference: "Statement" - name: "Statement" kind: "Parser" versioned: 0.4.11: choice: + - reference: "SimpleStatement" + - reference: "ControlStatement" + - reference: "AssemblyStatement" - reference: "Block" + 0.8.0: + choice: + # added "UncheckedBlock" - reference: "SimpleStatement" + - reference: "ControlStatement" + - reference: "AssemblyStatement" + - reference: "Block" + - reference: "UncheckedBlock" + +- name: "ControlStatement" + kind: "Parser" + inlined: true + versioned: + 0.4.11: + choice: - reference: "IfStatement" - reference: "ForStatement" - reference: "WhileStatement" - reference: "DoWhileStatement" - reference: "ContinueStatement" - reference: "BreakStatement" + - reference: "DeleteStatement" - reference: "ReturnStatement" - - reference: "ThrowStatement" - reference: "RevertStatement" - - reference: "DeleteStatement" - - reference: "AssemblyStatement" + - reference: "ThrowStatement" 0.4.21: - # added "EmitStatement" choice: - - reference: "Block" - - reference: "SimpleStatement" + # added: "EmitStatement" - reference: "IfStatement" - reference: "ForStatement" - reference: "WhileStatement" - reference: "DoWhileStatement" - reference: "ContinueStatement" - reference: "BreakStatement" + - reference: "DeleteStatement" - reference: "ReturnStatement" - - reference: "EmitStatement" - - reference: "ThrowStatement" - reference: "RevertStatement" - - reference: "DeleteStatement" - - reference: "AssemblyStatement" + - reference: "ThrowStatement" + - reference: "EmitStatement" 0.5.0: - # removed: "ThrowStatement" choice: - - reference: "Block" - - reference: "SimpleStatement" + # removed: "ThrowStatement" - reference: "IfStatement" - reference: "ForStatement" - reference: "WhileStatement" - reference: "DoWhileStatement" - reference: "ContinueStatement" - reference: "BreakStatement" + - reference: "DeleteStatement" - reference: "ReturnStatement" - - reference: "EmitStatement" - reference: "RevertStatement" - - reference: "DeleteStatement" - - reference: "AssemblyStatement" + - reference: "EmitStatement" 0.6.0: - # added: "TryStatement" choice: - - reference: "Block" - - reference: "SimpleStatement" + # added: "TryStatement" - reference: "IfStatement" - reference: "ForStatement" - reference: "WhileStatement" - reference: "DoWhileStatement" - reference: "ContinueStatement" - reference: "BreakStatement" - - reference: "TryStatement" + - reference: "DeleteStatement" - reference: "ReturnStatement" - - reference: "EmitStatement" - reference: "RevertStatement" - - reference: "DeleteStatement" - - reference: "AssemblyStatement" + - reference: "EmitStatement" + - reference: "TryStatement" - name: "SimpleStatement" kind: "Parser" + inlined: true unversioned: choice: - - reference: "TupleDeconstructionStatement" - - reference: "VariableDeclarationStatement" - reference: "ExpressionStatement" + - reference: "VariableDeclarationStatement" + - reference: "TupleDeconstructionStatement" - name: "ExpressionStatement" kind: "Parser" @@ -117,3 +111,11 @@ reference: "Expression" terminator: reference: "Semicolon" + +- name: "UncheckedBlock" + kind: "Parser" + versioned: + 0.8.0: + sequence: + - reference: "UncheckedKeyword" + - reference: "Block" diff --git a/crates/solidity/inputs/language/definition/04-statements/02-declaration-statements/productions.yml b/crates/solidity/inputs/language/definition/04-statements/02-declaration-statements/productions.yml index 977294e9ab..bf9a87744b 100644 --- a/crates/solidity/inputs/language/definition/04-statements/02-declaration-statements/productions.yml +++ b/crates/solidity/inputs/language/definition/04-statements/02-declaration-statements/productions.yml @@ -11,21 +11,7 @@ reference: "OpenParen" expression: optional: - separatedBy: - separator: - reference: "Comma" - expression: - optional: - choice: - - sequence: - - reference: "TypeName" - - optional: - reference: "DataLocation" - - reference: "Identifier" - - sequence: - - optional: - reference: "DataLocation" - - reference: "Identifier" + reference: "TupleMembersList" close: reference: "CloseParen" - reference: "Equal" @@ -33,43 +19,66 @@ terminator: reference: "Semicolon" -- name: "VariableDeclarationStatement" +- name: "TupleMembersList" kind: "Parser" - versioned: - 0.4.11: - terminatedBy: - expression: - sequence: - - choice: - - sequence: - - reference: "TypeName" - - optional: - reference: "DataLocation" - - reference: "VarKeyword" - - reference: "Identifier" - - optional: - sequence: - - reference: "Equal" - - reference: "Expression" - terminator: - reference: "Semicolon" - 0.5.0: # removed "VarKeyword" - terminatedBy: - expression: - sequence: + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "TupleMember" + +- name: "TupleMember" + kind: "Parser" + unversioned: + optional: + choice: + - sequence: - reference: "TypeName" - optional: reference: "DataLocation" - reference: "Identifier" + - sequence: - optional: - sequence: - - reference: "Equal" - - reference: "Expression" - terminator: - reference: "Semicolon" + reference: "DataLocation" + - reference: "Identifier" + +- name: "VariableDeclarationStatement" + kind: "Parser" + unversioned: + terminatedBy: + expression: + sequence: + - reference: "VariableDeclaration" + - optional: + sequence: + - reference: "Equal" + - reference: "Expression" + terminator: + reference: "Semicolon" + +- name: "VariableDeclaration" + kind: "Parser" + versioned: + 0.4.11: + sequence: + - choice: + - reference: "VarKeyword" + - reference: "TypeName" + - optional: + reference: "DataLocation" + - reference: "Identifier" + 0.5.0: + # removed "VarKeyword" + sequence: + - reference: "TypeName" + - optional: + reference: "DataLocation" + - reference: "Identifier" - name: "DataLocation" kind: "Parser" + inlined: true versioned: 0.4.11: choice: diff --git a/crates/solidity/inputs/language/definition/04-statements/03-control-statements/productions.yml b/crates/solidity/inputs/language/definition/04-statements/03-control-statements/productions.yml index fa16448a10..0a06230424 100644 --- a/crates/solidity/inputs/language/definition/04-statements/03-control-statements/productions.yml +++ b/crates/solidity/inputs/language/definition/04-statements/03-control-statements/productions.yml @@ -112,7 +112,7 @@ sequence: - reference: "EmitKeyword" - reference: "IdentifierPath" - - reference: "ArgumentList" + - reference: "ArgumentsDeclaration" terminator: reference: "Semicolon" diff --git a/crates/solidity/inputs/language/definition/04-statements/04-error-handling/productions.yml b/crates/solidity/inputs/language/definition/04-statements/04-error-handling/productions.yml index 60f7f178c1..2ca876b2c6 100644 --- a/crates/solidity/inputs/language/definition/04-statements/04-error-handling/productions.yml +++ b/crates/solidity/inputs/language/definition/04-statements/04-error-handling/productions.yml @@ -8,12 +8,16 @@ - reference: "TryKeyword" - reference: "Expression" - optional: - sequence: - - reference: "ReturnsKeyword" - - reference: "ParameterList" + reference: "ReturnsDeclaration" - reference: "Block" - - oneOrMore: - reference: "CatchClause" + - reference: "CatchClausesList" + +- name: "CatchClausesList" + kind: "Parser" + versioned: + 0.6.0: + oneOrMore: + reference: "CatchClause" - name: "CatchClause" kind: "Parser" @@ -22,12 +26,18 @@ sequence: - reference: "CatchKeyword" - optional: - sequence: - - optional: - reference: "Identifier" - - reference: "ParameterList" + reference: "CatchClauseError" - reference: "Block" +- name: "CatchClauseError" + kind: "Parser" + versioned: + 0.6.0: + sequence: + - optional: + reference: "Identifier" + - reference: "ParametersDeclaration" + - name: "RevertStatement" kind: "Parser" unversioned: @@ -37,7 +47,7 @@ - reference: "RevertKeyword" - optional: reference: "IdentifierPath" - - reference: "ArgumentList" + - reference: "ArgumentsDeclaration" terminator: reference: "Semicolon" diff --git a/crates/solidity/inputs/language/definition/05-expressions/01-base-expressions/productions.yml b/crates/solidity/inputs/language/definition/05-expressions/01-base-expressions/productions.yml index 4698a15e5a..0b3a1c123c 100644 --- a/crates/solidity/inputs/language/definition/05-expressions/01-base-expressions/productions.yml +++ b/crates/solidity/inputs/language/definition/05-expressions/01-base-expressions/productions.yml @@ -5,7 +5,7 @@ versioned: 0.4.11: operators: - - name: "AssignmentExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "AssignmentOperator" @@ -15,57 +15,57 @@ operator: reference: "ConditionalOperator" - - name: "OrExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "OrOperator" - - name: "AndExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "AndOperator" - - name: "EqualityComparisonExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "EqualityComparisonOperator" - - name: "OrderComparisonExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "OrderComparisonOperator" - - name: "BitOrExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: - reference: "BitOrOperator" + reference: "BitwiseOrOperator" - - name: "BitXOrExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: - reference: "BitXOrOperator" + reference: "BitwiseXOrOperator" - - name: "BitAndExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: - reference: "BitAndOperator" + reference: "BitwiseAndOperator" - - name: "ShiftExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "ShiftOperator" - - name: "AddSubExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "AddSubOperator" - - name: "MulDivModExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "MulDivModOperator" - - name: "ExponentiationExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "ExponentiationOperator" @@ -101,7 +101,7 @@ 0.6.0: # ExponentiationExpression is now BinaryRightAssociative operators: - - name: "AssignmentExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "AssignmentOperator" @@ -111,57 +111,57 @@ operator: reference: "ConditionalOperator" - - name: "OrExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "OrOperator" - - name: "AndExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "AndOperator" - - name: "EqualityComparisonExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "EqualityComparisonOperator" - - name: "OrderComparisonExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "OrderComparisonOperator" - - name: "BitOrExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: - reference: "BitOrOperator" + reference: "BitwiseOrOperator" - - name: "BitXOrExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: - reference: "BitXOrOperator" + reference: "BitwiseXOrOperator" - - name: "BitAndExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: - reference: "BitAndOperator" + reference: "BitwiseAndOperator" - - name: "ShiftExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "ShiftOperator" - - name: "AddSubExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "AddSubOperator" - - name: "MulDivModExpression" + - name: "BinaryExpression" model: "BinaryLeftAssociative" operator: reference: "MulDivModOperator" - - name: "ExponentiationExpression" + - name: "BinaryExpression" model: "BinaryRightAssociative" operator: reference: "ExponentiationOperator" @@ -196,23 +196,25 @@ - name: "AssignmentOperator" kind: "Parser" + inlined: true unversioned: choice: - reference: "Equal" - reference: "BarEqual" + - reference: "PlusEqual" + - reference: "MinusEqual" - reference: "CaretEqual" + - reference: "SlashEqual" + - reference: "PercentEqual" + - reference: "AsteriskEqual" - reference: "AmpersandEqual" - reference: "LessThanLessThanEqual" - reference: "GreaterThanGreaterThanEqual" - reference: "GreaterThanGreaterThanGreaterThanEqual" - - reference: "PlusEqual" - - reference: "MinusEqual" - - reference: "AsteriskEqual" - - reference: "SlashEqual" - - reference: "PercentEqual" - name: "ConditionalOperator" kind: "Parser" + inlined: true unversioned: sequence: - reference: "QuestionMark" @@ -222,16 +224,19 @@ - name: "OrOperator" kind: "Parser" + inlined: true unversioned: reference: "BarBar" - name: "AndOperator" kind: "Parser" + inlined: true unversioned: reference: "AmpersandAmpersand" - name: "EqualityComparisonOperator" kind: "Parser" + inlined: true unversioned: choice: - reference: "EqualEqual" @@ -239,6 +244,7 @@ - name: "OrderComparisonOperator" kind: "Parser" + inlined: true unversioned: choice: - reference: "LessThan" @@ -246,23 +252,27 @@ - reference: "LessThanEqual" - reference: "GreaterThanEqual" -- name: "BitOrOperator" +- name: "BitwiseOrOperator" kind: "Parser" + inlined: true unversioned: reference: "Bar" -- name: "BitXOrOperator" +- name: "BitwiseXOrOperator" kind: "Parser" + inlined: true unversioned: reference: "Caret" -- name: "BitAndOperator" +- name: "BitwiseAndOperator" kind: "Parser" + inlined: true unversioned: reference: "Ampersand" - name: "ShiftOperator" kind: "Parser" + inlined: true unversioned: choice: - reference: "LessThanLessThan" @@ -271,6 +281,7 @@ - name: "AddSubOperator" kind: "Parser" + inlined: true unversioned: choice: - reference: "Plus" @@ -278,6 +289,7 @@ - name: "MulDivModOperator" kind: "Parser" + inlined: true unversioned: choice: - reference: "Asterisk" @@ -286,11 +298,13 @@ - name: "ExponentiationOperator" kind: "Parser" + inlined: true unversioned: reference: "AsteriskAsterisk" - name: "UnaryPostfixOperator" kind: "Parser" + inlined: true unversioned: choice: - reference: "PlusPlus" @@ -298,6 +312,7 @@ - name: "UnaryPrefixOperator" kind: "Parser" + inlined: true versioned: 0.4.11: choice: @@ -318,23 +333,19 @@ - name: "FunctionCallOperator" kind: "Parser" + inlined: true versioned: 0.4.11: - sequence: - - reference: "ArgumentList" + reference: "ArgumentsDeclaration" 0.6.2: - sequence: - - zeroOrMore: - reference: "FunctionCallOptions" - - reference: "ArgumentList" - 0.8.0: sequence: - optional: reference: "FunctionCallOptions" - - reference: "ArgumentList" + - reference: "ArgumentsDeclaration" - name: "MemberAccessOperator" kind: "Parser" + inlined: true unversioned: sequence: - reference: "Period" @@ -344,6 +355,7 @@ - name: "IndexAccessOperator" kind: "Parser" + inlined: true unversioned: delimitedBy: open: diff --git a/crates/solidity/inputs/language/definition/05-expressions/05-identifiers/notes.md b/crates/solidity/inputs/language/definition/05-expressions/02-function-calls/notes.md similarity index 100% rename from crates/solidity/inputs/language/definition/05-expressions/05-identifiers/notes.md rename to crates/solidity/inputs/language/definition/05-expressions/02-function-calls/notes.md diff --git a/crates/solidity/inputs/language/definition/05-expressions/02-function-calls/productions.yml b/crates/solidity/inputs/language/definition/05-expressions/02-function-calls/productions.yml new file mode 100644 index 0000000000..9134b2ae6c --- /dev/null +++ b/crates/solidity/inputs/language/definition/05-expressions/02-function-calls/productions.yml @@ -0,0 +1,62 @@ +# yaml-language-server: $schema=../../../generated/productions.schema.json + +- name: "ArgumentsDeclaration" + kind: "Parser" + unversioned: + delimitedBy: + open: + reference: "OpenParen" + expression: + optional: + choice: + - reference: "PositionalArgumentsList" + - reference: "NamedArgumentsDeclaration" + close: + reference: "CloseParen" + +- name: "PositionalArgumentsList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "Expression" + +- name: "FunctionCallOptions" + kind: "Parser" + versioned: + 0.6.2: + oneOrMore: + reference: "NamedArgumentsDeclaration" + 0.8.0: + reference: "NamedArgumentsDeclaration" + +- name: "NamedArgumentsDeclaration" + kind: "Parser" + unversioned: + delimitedBy: + open: + reference: "OpenBrace" + expression: + optional: + reference: "NamedArgumentsList" + close: + reference: "CloseBrace" + +- name: "NamedArgumentsList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "NamedArgument" + +- name: "NamedArgument" + kind: "Parser" + unversioned: + sequence: + - reference: "Identifier" + - reference: "Colon" + - reference: "Expression" diff --git a/crates/solidity/inputs/language/definition/05-expressions/02-primary-expressions/notes.md b/crates/solidity/inputs/language/definition/05-expressions/03-primary-expressions/notes.md similarity index 100% rename from crates/solidity/inputs/language/definition/05-expressions/02-primary-expressions/notes.md rename to crates/solidity/inputs/language/definition/05-expressions/03-primary-expressions/notes.md diff --git a/crates/solidity/inputs/language/definition/05-expressions/02-primary-expressions/productions.yml b/crates/solidity/inputs/language/definition/05-expressions/03-primary-expressions/productions.yml similarity index 70% rename from crates/solidity/inputs/language/definition/05-expressions/02-primary-expressions/productions.yml rename to crates/solidity/inputs/language/definition/05-expressions/03-primary-expressions/productions.yml index 2a8d205983..b793e982e5 100644 --- a/crates/solidity/inputs/language/definition/05-expressions/02-primary-expressions/productions.yml +++ b/crates/solidity/inputs/language/definition/05-expressions/03-primary-expressions/productions.yml @@ -2,13 +2,14 @@ - name: "PrimaryExpression" kind: "Parser" + inlined: true versioned: 0.4.11: choice: - reference: "NewExpression" - reference: "TupleExpression" - - reference: "ArrayLiteral" - - reference: "BooleanLiteral" + - reference: "ArrayExpression" + - reference: "BooleanExpression" - reference: "NumericExpression" - reference: "StringExpression" - reference: "ElementaryType" @@ -19,8 +20,8 @@ - reference: "NewExpression" - reference: "TupleExpression" - reference: "TypeExpression" - - reference: "ArrayLiteral" - - reference: "BooleanLiteral" + - reference: "ArrayExpression" + - reference: "BooleanExpression" - reference: "NumericExpression" - reference: "StringExpression" - reference: "ElementaryType" @@ -54,32 +55,43 @@ open: reference: "OpenParen" expression: - separatedBy: - separator: - reference: "Comma" - expression: - optional: - reference: "Expression" + reference: "TupleValuesList" close: reference: "CloseParen" -- name: "ArrayLiteral" +- name: "TupleValuesList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + optional: + reference: "Expression" + +- name: "ArrayExpression" kind: "Parser" unversioned: delimitedBy: open: reference: "OpenBracket" expression: - separatedBy: - separator: - reference: "Comma" - expression: - reference: "Expression" + reference: "ArrayValuesList" close: reference: "CloseBracket" -- name: "BooleanLiteral" +- name: "ArrayValuesList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "Expression" + +- name: "BooleanExpression" kind: "Parser" + inlined: true unversioned: choice: - reference: "TrueKeyword" diff --git a/crates/solidity/inputs/language/definition/05-expressions/03-numbers/notes.md b/crates/solidity/inputs/language/definition/05-expressions/04-numbers/notes.md similarity index 100% rename from crates/solidity/inputs/language/definition/05-expressions/03-numbers/notes.md rename to crates/solidity/inputs/language/definition/05-expressions/04-numbers/notes.md diff --git a/crates/solidity/inputs/language/definition/05-expressions/03-numbers/productions.yml b/crates/solidity/inputs/language/definition/05-expressions/04-numbers/productions.yml similarity index 54% rename from crates/solidity/inputs/language/definition/05-expressions/03-numbers/productions.yml rename to crates/solidity/inputs/language/definition/05-expressions/04-numbers/productions.yml index 500d0e0271..e82f5c2dbc 100644 --- a/crates/solidity/inputs/language/definition/05-expressions/03-numbers/productions.yml +++ b/crates/solidity/inputs/language/definition/05-expressions/04-numbers/productions.yml @@ -10,7 +10,8 @@ - reference: "DecimalLiteral" - optional: reference: "NumberUnit" - 0.5.0: # "HexLiteral" no longer allows a "NumberUnit" + 0.5.0: + # "HexLiteral" no longer allows a "NumberUnit" choice: - reference: "HexLiteral" - sequence: @@ -22,64 +23,82 @@ kind: "Scanner" versioned: 0.4.11: - sequence: - - terminal: "0" - - choice: - - terminal: "x" - - terminal: "X" - - oneOrMore: - reference: "HexCharacter" - - zeroOrMore: - sequence: - - terminal: "_" - - oneOrMore: - reference: "HexCharacter" + trailingContext: + expression: + sequence: + - choice: + - terminal: "0x" # lowercase + - terminal: "0X" # uppercase + - oneOrMore: + reference: "HexCharacter" + - zeroOrMore: + sequence: + - terminal: "_" + - oneOrMore: + reference: "HexCharacter" + notFollowedBy: + reference: "IdentifierPart" 0.5.0: - sequence: - - terminal: "0x" - - oneOrMore: - reference: "HexCharacter" - - zeroOrMore: - sequence: - - terminal: "_" - - oneOrMore: - reference: "HexCharacter" + # removed uppercase "0X" + trailingContext: + expression: + sequence: + - terminal: "0x" # lowercase + - oneOrMore: + reference: "HexCharacter" + - zeroOrMore: + sequence: + - terminal: "_" + - oneOrMore: + reference: "HexCharacter" + notFollowedBy: + reference: "IdentifierPart" - name: "DecimalLiteral" kind: "Scanner" versioned: 0.4.11: - sequence: - - choice: - - sequence: - - reference: "DecimalNumber" - - optional: - sequence: - - terminal: "." - - optional: - reference: "DecimalNumber" - - sequence: - - terminal: "." - - reference: "DecimalNumber" - - optional: - reference: "DecimalExponent" + trailingContext: + expression: + sequence: + - choice: + - sequence: + - reference: "DecimalDigits" + - optional: + sequence: + - terminal: "." + - optional: + reference: "DecimalDigits" + - sequence: + - terminal: "." + - reference: "DecimalDigits" + - optional: + reference: "DecimalExponent" + notFollowedBy: + reference: "IdentifierPart" 0.5.0: - sequence: - - choice: - - sequence: - - reference: "DecimalNumber" - - optional: - sequence: - - terminal: "." - - reference: "DecimalNumber" - - sequence: - - terminal: "." - - reference: "DecimalNumber" - - optional: - reference: "DecimalExponent" + # Second "DecimalDigits" is no longer "optional" + trailingContext: + expression: + sequence: + - choice: + - sequence: + - reference: "DecimalDigits" + - optional: + sequence: + - terminal: "." + - reference: "DecimalDigits" + - sequence: + - terminal: "." + - reference: "DecimalDigits" + - optional: + reference: "DecimalExponent" + notFollowedBy: + reference: "IdentifierPart" -- name: "DecimalNumber" +- name: "DecimalDigits" kind: "Scanner" + inlined: true unversioned: sequence: - oneOrMore: @@ -96,6 +115,7 @@ - name: "DecimalExponent" kind: "Scanner" + inlined: true unversioned: sequence: - choice: @@ -103,10 +123,11 @@ - terminal: "E" - optional: terminal: "-" - - reference: "DecimalNumber" + - reference: "DecimalDigits" - name: "NumberUnit" kind: "Parser" + inlined: true versioned: 0.4.11: choice: diff --git a/crates/solidity/inputs/language/definition/05-expressions/05-identifiers/productions.yml b/crates/solidity/inputs/language/definition/05-expressions/05-identifiers/productions.yml deleted file mode 100644 index 9354eba3ad..0000000000 --- a/crates/solidity/inputs/language/definition/05-expressions/05-identifiers/productions.yml +++ /dev/null @@ -1,227 +0,0 @@ -# yaml-language-server: $schema=../../../generated/productions.schema.json - -- name: "IdentifierPath" - kind: "Parser" - unversioned: - separatedBy: - expression: - reference: "Identifier" - separator: - reference: "Period" - -- name: "Identifier" - kind: "Scanner" - unversioned: - difference: - minuend: - reference: "RawIdentifier" - subtrahend: - choice: - - reference: "NotAnIdentifierInAnyVersion" - - reference: "NotAnIdentifierInSomeVersions" - - reference: "FixedBytesType" - - reference: "SignedFixedType" - - reference: "UnsignedFixedType" - - reference: "SignedIntegerType" - - reference: "UnsignedIntegerType" - -- name: "NotAnIdentifierInAnyVersion" - kind: "Scanner" - unversioned: - choice: - - terminal: "abstract" - - terminal: "address" - - terminal: "after" - - terminal: "anonymous" - - terminal: "as" - - terminal: "assembly" - - terminal: "bool" - - terminal: "break" - - terminal: "byte" - - terminal: "case" - - terminal: "catch" - - terminal: "constant" - - terminal: "continue" - - terminal: "contract" - - terminal: "days" - - terminal: "default" - - terminal: "delete" - - terminal: "do" - - terminal: "else" - - terminal: "enum" - - terminal: "ether" - - terminal: "event" - - terminal: "external" - - terminal: "false" - - terminal: "final" - - terminal: "for" - - terminal: "function" - - terminal: "hex" - - terminal: "hours" - - terminal: "if" - - terminal: "import" - - terminal: "in" - - terminal: "indexed" - - terminal: "inline" - - terminal: "interface" - - terminal: "internal" - - terminal: "is" - - terminal: "let" - - terminal: "library" - - terminal: "mapping" - - terminal: "match" - - terminal: "memory" - - terminal: "minutes" - - terminal: "modifier" - - terminal: "new" - - terminal: "null" - - terminal: "of" - - terminal: "payable" - - terminal: "pragma" - - terminal: "private" - - terminal: "public" - - terminal: "pure" - - terminal: "relocatable" - - terminal: "return" - - terminal: "returns" - - terminal: "seconds" - - terminal: "static" - - terminal: "storage" - - terminal: "string" - - terminal: "struct" - - terminal: "switch" - - terminal: "throw" - - terminal: "true" - - terminal: "try" - - terminal: "type" - - terminal: "typeof" - - terminal: "using" - - terminal: "var" - - terminal: "view" - - terminal: "weeks" - - terminal: "wei" - - terminal: "while" - - terminal: "years" - -- name: "NotAnIdentifierInSomeVersions" - kind: "Scanner" - versioned: - 0.4.11: - choice: - - terminal: "finney" - - terminal: "szabo" - 0.5.0: - choice: - - terminal: "finney" - - terminal: "szabo" - # added - - terminal: "alias" - - terminal: "apply" - - terminal: "auto" - - terminal: "calldata" - - terminal: "constructor" - - terminal: "copyof" - - terminal: "define" - - terminal: "emit" - - terminal: "immutable" - - terminal: "implements" - - terminal: "macro" - - terminal: "mutable" - - terminal: "override" - - terminal: "partial" - - terminal: "promise" - - terminal: "reference" - - terminal: "sealed" - - terminal: "sizeof" - - terminal: "supports" - - terminal: "typedef" - - terminal: "unchecked" - 0.6.0: - choice: - - terminal: "finney" - - terminal: "szabo" - - terminal: "alias" - - terminal: "apply" - - terminal: "auto" - - terminal: "calldata" - - terminal: "constructor" - - terminal: "copyof" - - terminal: "define" - - terminal: "emit" - - terminal: "immutable" - - terminal: "implements" - - terminal: "macro" - - terminal: "mutable" - - terminal: "override" - - terminal: "partial" - - terminal: "promise" - - terminal: "reference" - - terminal: "sealed" - - terminal: "sizeof" - - terminal: "supports" - - terminal: "typedef" - - terminal: "unchecked" - # added - - terminal: "fallback" - - terminal: "receive" - - terminal: "virtual" - 0.7.0: - choice: - # - terminal: "finney" - # - terminal: "szabo" - - terminal: "alias" - - terminal: "apply" - - terminal: "auto" - - terminal: "calldata" - - terminal: "constructor" - - terminal: "copyof" - - terminal: "define" - - terminal: "emit" - - terminal: "immutable" - - terminal: "implements" - - terminal: "macro" - - terminal: "mutable" - - terminal: "override" - - terminal: "partial" - - terminal: "promise" - - terminal: "reference" - - terminal: "sealed" - - terminal: "sizeof" - - terminal: "supports" - - terminal: "typedef" - - terminal: "unchecked" - - terminal: "fallback" - - terminal: "receive" - - terminal: "virtual" - # added - - terminal: "gwei" - -- name: "RawIdentifier" - kind: "Scanner" - unversioned: - sequence: - - reference: "IdentifierStart" - - zeroOrMore: - reference: "IdentifierPart" - -- name: "IdentifierStart" - kind: "Scanner" - unversioned: - choice: - - terminal: "_" - - terminal: "$" - - range: - from: "a" - to: "z" - - range: - from: "A" - to: "Z" - -- name: "IdentifierPart" - kind: "Scanner" - unversioned: - choice: - - reference: "IdentifierStart" - - range: - from: "0" - to: "9" diff --git a/crates/solidity/inputs/language/definition/05-expressions/04-strings/notes.md b/crates/solidity/inputs/language/definition/05-expressions/05-strings/notes.md similarity index 100% rename from crates/solidity/inputs/language/definition/05-expressions/04-strings/notes.md rename to crates/solidity/inputs/language/definition/05-expressions/05-strings/notes.md diff --git a/crates/solidity/inputs/language/definition/05-expressions/04-strings/productions.yml b/crates/solidity/inputs/language/definition/05-expressions/05-strings/productions.yml similarity index 65% rename from crates/solidity/inputs/language/definition/05-expressions/04-strings/productions.yml rename to crates/solidity/inputs/language/definition/05-expressions/05-strings/productions.yml index 140ed88a5c..a40a741dd2 100644 --- a/crates/solidity/inputs/language/definition/05-expressions/04-strings/productions.yml +++ b/crates/solidity/inputs/language/definition/05-expressions/05-strings/productions.yml @@ -2,42 +2,61 @@ - name: "StringExpression" kind: "Parser" + inlined: true versioned: 0.4.11: choice: - - oneOrMore: - reference: "HexStringLiteral" - - oneOrMore: - reference: "AsciiStringLiteral" + - reference: "HexStringLiteralsList" + - reference: "AsciiStringLiteralsList" 0.7.0: - # added "UnicodeStringLiteral" + # added "UnicodeStringLiteralsList" choice: - - oneOrMore: - reference: "HexStringLiteral" - - oneOrMore: - reference: "AsciiStringLiteral" - - oneOrMore: - reference: "UnicodeStringLiteral" + - reference: "HexStringLiteralsList" + - reference: "AsciiStringLiteralsList" + - reference: "UnicodeStringLiteralsList" + +- name: "HexStringLiteralsList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "HexStringLiteral" - name: "HexStringLiteral" kind: "Scanner" + unversioned: + trailingContext: + expression: + choice: + - reference: "SingleQuotedHexStringLiteral" + - reference: "DoubleQuotedHexStringLiteral" + notFollowedBy: + reference: "IdentifierPart" + +- name: "SingleQuotedHexStringLiteral" + kind: "Scanner" + inlined: true unversioned: sequence: - terminal: "hex" - - choice: - - sequence: - - terminal: '"' - - optional: - reference: "PossiblySeparatedPairsOfHexDigits" - - terminal: '"' - - sequence: - - terminal: "'" - - optional: - reference: "PossiblySeparatedPairsOfHexDigits" - - terminal: "'" - -- name: "PossiblySeparatedPairsOfHexDigits" + - terminal: "'" + - optional: + reference: "HexStringContents" + - terminal: "'" + +- name: "DoubleQuotedHexStringLiteral" kind: "Scanner" + inlined: true + unversioned: + sequence: + - terminal: "hex" + - terminal: '"' + - optional: + reference: "HexStringContents" + - terminal: '"' + +- name: "HexStringContents" + kind: "Scanner" + inlined: true unversioned: sequence: - reference: "HexCharacter" @@ -64,15 +83,26 @@ from: "A" to: "F" +- name: "AsciiStringLiteralsList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "AsciiStringLiteral" + - name: "AsciiStringLiteral" kind: "Scanner" unversioned: - choice: - - reference: "SingleQuotedAsciiStringLiteral" - - reference: "DoubleQuotedAsciiStringLiteral" + trailingContext: + expression: + choice: + - reference: "SingleQuotedAsciiStringLiteral" + - reference: "DoubleQuotedAsciiStringLiteral" + notFollowedBy: + reference: "IdentifierPart" - name: "SingleQuotedAsciiStringLiteral" kind: "Scanner" + inlined: true unversioned: sequence: - terminal: "'" @@ -92,6 +122,7 @@ - name: "DoubleQuotedAsciiStringLiteral" kind: "Scanner" + inlined: true unversioned: sequence: - terminal: '"' @@ -109,16 +140,28 @@ - terminal: "\\" - terminal: '"' +- name: "UnicodeStringLiteralsList" + kind: "Parser" + versioned: + 0.7.0: + oneOrMore: + reference: "UnicodeStringLiteral" + - name: "UnicodeStringLiteral" kind: "Scanner" versioned: 0.7.0: - choice: - - reference: "SingleQuotedUnicodeStringLiteral" - - reference: "DoubleQuotedUnicodeStringLiteral" + trailingContext: + expression: + choice: + - reference: "SingleQuotedUnicodeStringLiteral" + - reference: "DoubleQuotedUnicodeStringLiteral" + notFollowedBy: + reference: "IdentifierPart" - name: "SingleQuotedUnicodeStringLiteral" kind: "Scanner" + inlined: true versioned: 0.7.0: sequence: @@ -136,6 +179,7 @@ - name: "DoubleQuotedUnicodeStringLiteral" kind: "Scanner" + inlined: true versioned: 0.7.0: sequence: @@ -153,6 +197,7 @@ - name: "EscapeSequence" kind: "Scanner" + inlined: true unversioned: sequence: - terminal: "\\" @@ -163,6 +208,7 @@ - name: "AsciiEscape" kind: "Scanner" + inlined: true unversioned: choice: - terminal: "n" @@ -176,6 +222,7 @@ - name: "HexByteEscape" kind: "Scanner" + inlined: true unversioned: sequence: - terminal: "x" @@ -184,6 +231,7 @@ - name: "UnicodeEscape" kind: "Scanner" + inlined: true unversioned: sequence: - terminal: "u" diff --git a/crates/solidity/inputs/language/definition/05-expressions/06-identifiers/notes.md b/crates/solidity/inputs/language/definition/05-expressions/06-identifiers/notes.md new file mode 100644 index 0000000000..9b53853ede --- /dev/null +++ b/crates/solidity/inputs/language/definition/05-expressions/06-identifiers/notes.md @@ -0,0 +1 @@ +--8<-- "crates/solidity/inputs/language/snippets/under-construction.md" diff --git a/crates/solidity/inputs/language/definition/05-expressions/06-identifiers/productions.yml b/crates/solidity/inputs/language/definition/05-expressions/06-identifiers/productions.yml new file mode 100644 index 0000000000..a8efd94802 --- /dev/null +++ b/crates/solidity/inputs/language/definition/05-expressions/06-identifiers/productions.yml @@ -0,0 +1,323 @@ +# yaml-language-server: $schema=../../../generated/productions.schema.json + +- name: "IdentifierPathsList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "IdentifierPath" + +- name: "IdentifierPath" + kind: "Parser" + unversioned: + separatedBy: + expression: + reference: "Identifier" + separator: + reference: "Period" + +- name: "IdentifiersList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "Identifier" + +- name: "Identifier" + kind: "Scanner" + versioned: + 0.4.11: + difference: + minuend: + reference: "RawIdentifier" + subtrahend: + choice: + - reference: "KeywordInAnyVersion" + - reference: "KeywordInSomeVersion" + - reference: "ReservedWordInAnyVersion" + 0.5.0: + # Added "ReservedWordInSomeVersion" + difference: + minuend: + reference: "RawIdentifier" + subtrahend: + choice: + - reference: "KeywordInAnyVersion" + - reference: "KeywordInSomeVersion" + - reference: "ReservedWordInAnyVersion" + - reference: "ReservedWordInSomeVersion" + +# TODO: will be removed in https://github.com/NomicFoundation/slang/issues/505 +- name: "KeywordInAnyVersion" + kind: "Scanner" + inlined: true + unversioned: + choice: + # Types + - reference: "FixedBytesType" + - reference: "SignedFixedType" + - reference: "UnsignedFixedType" + - reference: "SignedIntegerType" + - reference: "UnsignedIntegerType" + # Keywords + - reference: "AddressKeyword" + - reference: "AnonymousKeyword" + - reference: "AsKeyword" + - reference: "AssemblyKeyword" + - reference: "BoolKeyword" + - reference: "BreakKeyword" + - reference: "CaseKeyword" + - reference: "ConstantKeyword" + - reference: "ContinueKeyword" + - reference: "ContractKeyword" + - reference: "DaysKeyword" + - reference: "DefaultKeyword" + - reference: "DeleteKeyword" + - reference: "DoKeyword" + - reference: "ElseKeyword" + - reference: "EnumKeyword" + - reference: "EtherKeyword" + - reference: "EventKeyword" + - reference: "ExternalKeyword" + - reference: "FalseKeyword" + - reference: "ForKeyword" + - reference: "FunctionKeyword" + - reference: "HoursKeyword" + - reference: "IfKeyword" + - reference: "ImportKeyword" + - reference: "IndexedKeyword" + - reference: "InterfaceKeyword" + - reference: "InternalKeyword" + - reference: "IsKeyword" + - reference: "LetKeyword" + - reference: "LibraryKeyword" + - reference: "MappingKeyword" + - reference: "MemoryKeyword" + - reference: "MinutesKeyword" + - reference: "ModifierKeyword" + - reference: "NewKeyword" + - reference: "PayableKeyword" + - reference: "PragmaKeyword" + - reference: "PrivateKeyword" + - reference: "PublicKeyword" + - reference: "PureKeyword" + - reference: "ReturnKeyword" + - reference: "ReturnsKeyword" + - reference: "SecondsKeyword" + - reference: "StorageKeyword" + - reference: "StringKeyword" + - reference: "StructKeyword" + - reference: "SwitchKeyword" + - reference: "TrueKeyword" + - reference: "UsingKeyword" + - reference: "ViewKeyword" + - reference: "WeeksKeyword" + - reference: "WeiKeyword" + - reference: "WhileKeyword" + +# TODO: will be removed in https://github.com/NomicFoundation/slang/issues/505 +- name: "KeywordInSomeVersion" + kind: "Scanner" + inlined: true + versioned: + 0.4.11: + choice: + - reference: "ByteKeyword" + - reference: "FinneyKeyword" + - reference: "SzaboKeyword" + - reference: "ThrowKeyword" + - reference: "VarKeyword" + - reference: "YearsKeyword" + 0.5.0: + choice: + # removed: + # reference: "ThrowKeyword" + # reference: "VarKeyword" + # reference: "YearsKeyword" + # unchanged: + - reference: "ByteKeyword" + - reference: "FinneyKeyword" + - reference: "SzaboKeyword" + # added: + - reference: "CalldataKeyword" + - reference: "ConstructorKeyword" + - reference: "EmitKeyword" + - reference: "OverrideKeyword" + 0.5.3: + choice: + # unchanged: + - reference: "ByteKeyword" + - reference: "FinneyKeyword" + - reference: "SzaboKeyword" + - reference: "CalldataKeyword" + - reference: "ConstructorKeyword" + - reference: "EmitKeyword" + - reference: "OverrideKeyword" + # added: + - reference: "TypeKeyword" + 0.6.0: + choice: + # unchanged: + - reference: "ByteKeyword" + - reference: "FinneyKeyword" + - reference: "SzaboKeyword" + - reference: "CalldataKeyword" + - reference: "ConstructorKeyword" + - reference: "EmitKeyword" + - reference: "OverrideKeyword" + - reference: "TypeKeyword" + # added: + - reference: "AbstractKeyword" + - reference: "CatchKeyword" + - reference: "FallbackKeyword" + - reference: "ReceiveKeyword" + - reference: "TryKeyword" + - reference: "VirtualKeyword" + 0.6.5: + choice: + # unchanged: + - reference: "ByteKeyword" + - reference: "FinneyKeyword" + - reference: "SzaboKeyword" + - reference: "CalldataKeyword" + - reference: "ConstructorKeyword" + - reference: "EmitKeyword" + - reference: "OverrideKeyword" + - reference: "TypeKeyword" + - reference: "AbstractKeyword" + - reference: "CatchKeyword" + - reference: "FallbackKeyword" + - reference: "ReceiveKeyword" + - reference: "TryKeyword" + - reference: "VirtualKeyword" + # added: + - reference: "ImmutableKeyword" + 0.7.0: + choice: + # removed: + # reference: "FinneyKeyword" + # reference: "SzaboKeyword" + # unchanged: + - reference: "ByteKeyword" + - reference: "CalldataKeyword" + - reference: "ConstructorKeyword" + - reference: "EmitKeyword" + - reference: "OverrideKeyword" + - reference: "TypeKeyword" + - reference: "AbstractKeyword" + - reference: "CatchKeyword" + - reference: "FallbackKeyword" + - reference: "ReceiveKeyword" + - reference: "TryKeyword" + - reference: "VirtualKeyword" + - reference: "ImmutableKeyword" + # added: + - reference: "GweiKeyword" + 0.8.0: + choice: + # removed: + # reference: "ByteKeyword" + # unchanged: + - reference: "CalldataKeyword" + - reference: "ConstructorKeyword" + - reference: "EmitKeyword" + - reference: "OverrideKeyword" + - reference: "TypeKeyword" + - reference: "AbstractKeyword" + - reference: "CatchKeyword" + - reference: "FallbackKeyword" + - reference: "ReceiveKeyword" + - reference: "TryKeyword" + - reference: "VirtualKeyword" + - reference: "ImmutableKeyword" + - reference: "GweiKeyword" + # added: + - reference: "UncheckedKeyword" + +# TODO: will be removed in https://github.com/NomicFoundation/slang/issues/505 +- name: "ReservedWordInAnyVersion" + kind: "Scanner" + inlined: true + unversioned: + choice: + - terminal: "abstract" + - terminal: "after" + - terminal: "byte" + - terminal: "catch" + - terminal: "final" + - terminal: "finney" + - terminal: "hex" + - terminal: "in" + - terminal: "inline" + - terminal: "match" + - terminal: "null" + - terminal: "of" + - terminal: "relocatable" + - terminal: "static" + - terminal: "szabo" + - terminal: "throw" + - terminal: "try" + - terminal: "type" + - terminal: "typeof" + - terminal: "var" + - terminal: "years" + +# TODO: will be removed in https://github.com/NomicFoundation/slang/issues/505 +- name: "ReservedWordInSomeVersion" + kind: "Scanner" + inlined: true + versioned: + 0.5.0: + choice: + - terminal: "alias" + - terminal: "apply" + - terminal: "auto" + - terminal: "copyof" + - terminal: "define" + - terminal: "implements" + - terminal: "macro" + - terminal: "mutable" + - terminal: "partial" + - terminal: "promise" + - terminal: "reference" + - terminal: "sealed" + - terminal: "sizeof" + - terminal: "supports" + - terminal: "typedef" + +- name: "RawIdentifier" + kind: "Scanner" + inlined: true + unversioned: + sequence: + - reference: "IdentifierStart" + - zeroOrMore: + reference: "IdentifierPart" + +- name: "IdentifierStart" + kind: "Scanner" + inlined: true + unversioned: + choice: + - terminal: "_" + - terminal: "$" + - range: + from: "a" + to: "z" + - range: + from: "A" + to: "Z" + +- name: "IdentifierPart" + kind: "Scanner" + inlined: true + unversioned: + choice: + - reference: "IdentifierStart" + - range: + from: "0" + to: "9" diff --git a/crates/solidity/inputs/language/definition/06-yul/01-assembly-block/productions.yml b/crates/solidity/inputs/language/definition/06-yul/01-assembly-block/productions.yml index 8a19feb320..3d3f8769d6 100644 --- a/crates/solidity/inputs/language/definition/06-yul/01-assembly-block/productions.yml +++ b/crates/solidity/inputs/language/definition/06-yul/01-assembly-block/productions.yml @@ -6,28 +6,22 @@ sequence: - reference: "AssemblyKeyword" - optional: - reference: "Evmasm" + reference: "AsciiStringLiteral" # label: "evmasm" - optional: - reference: "AssemblyFlags" + delimitedBy: + open: + reference: "OpenParen" + expression: + reference: "AssemblyFlagsList" + close: + reference: "CloseParen" - reference: "YulBlock" -- name: "Evmasm" - kind: "Scanner" - unversioned: - terminal: '"evmasm"' - -- name: "AssemblyFlags" +- name: "AssemblyFlagsList" kind: "Parser" unversioned: - delimitedBy: - open: - reference: "OpenParen" + separatedBy: expression: - sequence: - - reference: "DoubleQuotedAsciiStringLiteral" - - zeroOrMore: - sequence: - - reference: "Comma" - - reference: "DoubleQuotedAsciiStringLiteral" - close: - reference: "CloseParen" + reference: "AsciiStringLiteral" + separator: + reference: "Comma" diff --git a/crates/solidity/inputs/language/definition/06-yul/02-yul-statements/productions.yml b/crates/solidity/inputs/language/definition/06-yul/02-yul-statements/productions.yml index 2150ba9bd3..ab351ca22d 100644 --- a/crates/solidity/inputs/language/definition/06-yul/02-yul-statements/productions.yml +++ b/crates/solidity/inputs/language/definition/06-yul/02-yul-statements/productions.yml @@ -7,11 +7,17 @@ open: reference: "OpenBrace" expression: - zeroOrMore: - reference: "YulStatement" + optional: + reference: "YulStatementsList" close: reference: "CloseBrace" +- name: "YulStatementsList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "YulStatement" + - name: "YulStatement" kind: "Parser" versioned: @@ -28,7 +34,7 @@ - reference: "YulContinueStatement" - reference: "YulExpression" 0.6.0: - # added "YuiLeaveStatement" + # added "YulLeaveStatement" choice: - reference: "YulBlock" - reference: "YulFunctionDefinition" @@ -47,11 +53,7 @@ unversioned: sequence: - reference: "LetKeyword" - - separatedBy: - separator: - reference: "Comma" - expression: - reference: "YulIdentifierPath" + - reference: "YulIdentifierPathsList" - optional: sequence: - reference: "ColonEqual" @@ -63,39 +65,35 @@ sequence: - reference: "FunctionKeyword" - reference: "YulIdentifier" - - delimitedBy: - open: - reference: "OpenParen" - expression: - optional: - name: "Arguments" - separatedBy: - separator: - reference: "Comma" - expression: - reference: "YulIdentifier" - close: - reference: "CloseParen" + - reference: "YulParametersDeclaration" - optional: - sequence: - - reference: "MinusGreaterThan" - - name: "Results" - separatedBy: - separator: - reference: "Comma" - expression: - reference: "YulIdentifier" + reference: "YulReturnsDeclaration" - reference: "YulBlock" +- name: "YulParametersDeclaration" + kind: "Parser" + unversioned: + delimitedBy: + open: + reference: "OpenParen" + expression: + optional: + reference: "YulIdentifiersList" + close: + reference: "CloseParen" + +- name: "YulReturnsDeclaration" + kind: "Parser" + unversioned: + sequence: + - reference: "MinusGreaterThan" + - reference: "YulIdentifiersList" + - name: "YulAssignmentStatement" kind: "Parser" unversioned: sequence: - - separatedBy: - separator: - reference: "Comma" - expression: - reference: "YulIdentifierPath" + - reference: "YulIdentifierPathsList" - reference: "ColonEqual" - reference: "YulExpression" @@ -139,11 +137,21 @@ sequence: - reference: "SwitchKeyword" - reference: "YulExpression" - - oneOrMore: - sequence: - - choice: - - sequence: - - reference: "CaseKeyword" - - reference: "YulLiteral" - - reference: "DefaultKeyword" - - reference: "YulBlock" + - reference: "YulSwitchCasesList" + +- name: "YulSwitchCasesList" + kind: "Parser" + unversioned: + oneOrMore: + reference: "YulSwitchCase" + +- name: "YulSwitchCase" + kind: "Parser" + unversioned: + sequence: + - choice: + - reference: "DefaultKeyword" + - sequence: + - reference: "CaseKeyword" + - reference: "YulLiteral" + - reference: "YulBlock" diff --git a/crates/solidity/inputs/language/definition/06-yul/03-yul-expressions/productions.yml b/crates/solidity/inputs/language/definition/06-yul/03-yul-expressions/productions.yml index 4489b4a238..89ef07dde2 100644 --- a/crates/solidity/inputs/language/definition/06-yul/03-yul-expressions/productions.yml +++ b/crates/solidity/inputs/language/definition/06-yul/03-yul-expressions/productions.yml @@ -1,5 +1,14 @@ # yaml-language-server: $schema=../../../generated/productions.schema.json +- name: "YulExpressionsList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "YulExpression" + - name: "YulExpression" kind: "PrecedenceParser" unversioned: @@ -7,24 +16,35 @@ - name: "YulFunctionCallExpression" model: "UnaryPostfix" operator: - delimitedBy: - open: - reference: "OpenParen" - expression: - optional: - separatedBy: - separator: - reference: "Comma" - expression: - reference: "YulExpression" - close: - reference: "CloseParen" + reference: "YulFunctionCallOperator" primaryExpression: choice: - reference: "YulLiteral" - reference: "YulIdentifierPath" +- name: "YulFunctionCallOperator" + kind: "Parser" + inlined: true + unversioned: + delimitedBy: + open: + reference: "OpenParen" + expression: + optional: + reference: "YulExpressionsList" + close: + reference: "CloseParen" + +- name: "YulIdentifierPathsList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "YulIdentifierPath" + - name: "YulIdentifierPath" kind: "Parser" unversioned: @@ -34,6 +54,15 @@ expression: reference: "YulIdentifier" +- name: "YulIdentifiersList" + kind: "Parser" + unversioned: + separatedBy: + separator: + reference: "Comma" + expression: + reference: "YulIdentifier" + - name: "YulIdentifier" kind: "Scanner" unversioned: @@ -43,10 +72,11 @@ subtrahend: choice: - reference: "YulKeyword" - - reference: "YulReservedKeyword" + - reference: "YulReservedWord" - name: "YulKeyword" kind: "Scanner" + inlined: true versioned: 0.4.11: choice: @@ -77,17 +107,19 @@ - reference: "SwitchKeyword" - reference: "TrueKeyword" -- name: "YulReservedKeyword" +- name: "YulReservedWord" kind: "Scanner" + inlined: true unversioned: - choice: - - terminal: "hex" + terminal: "hex" - name: "YulLiteral" kind: "Parser" + inlined: true unversioned: choice: - - reference: "BooleanLiteral" + - reference: "TrueKeyword" + - reference: "FalseKeyword" - reference: "YulHexLiteral" - reference: "YulDecimalLiteral" - reference: "HexStringLiteral" @@ -96,21 +128,29 @@ - name: "YulHexLiteral" kind: "Scanner" unversioned: - sequence: - - terminal: "0x" - - oneOrMore: - reference: "HexCharacter" + trailingContext: + expression: + sequence: + - terminal: "0x" + - oneOrMore: + reference: "HexCharacter" + notFollowedBy: + reference: "IdentifierPart" - name: "YulDecimalLiteral" kind: "Scanner" unversioned: - choice: - - terminal: "0" - - sequence: - - range: - from: "1" - to: "9" - - zeroOrMore: - range: - from: "0" - to: "9" + trailingContext: + expression: + choice: + - terminal: "0" + - sequence: + - range: + from: "1" + to: "9" + - zeroOrMore: + range: + from: "0" + to: "9" + notFollowedBy: + reference: "IdentifierPart" diff --git a/crates/solidity/inputs/language/definition/manifest.yml b/crates/solidity/inputs/language/definition/manifest.yml index 3972fc659a..8b5449c436 100644 --- a/crates/solidity/inputs/language/definition/manifest.yml +++ b/crates/solidity/inputs/language/definition/manifest.yml @@ -74,14 +74,16 @@ sections: topics: - title: "5.1. Base Expressions" path: "01-base-expressions" - - title: "5.2. Primary Expressions" - path: "02-primary-expressions" - - title: "5.3. Numbers" - path: "03-numbers" - - title: "5.4. Strings" - path: "04-strings" - - title: "5.5. Identifiers" - path: "05-identifiers" + - title: "5.2. Function Calls" + path: "02-function-calls" + - title: "5.3. Primary Expressions" + path: "03-primary-expressions" + - title: "5.4. Numbers" + path: "04-numbers" + - title: "5.5. Strings" + path: "05-strings" + - title: "5.6. Identifiers" + path: "06-identifiers" - title: "6. Yul" path: "06-yul" topics: diff --git a/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs b/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs index 3142fd6949..a2ab8f7bc6 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs @@ -24,7 +24,6 @@ pub enum TokenKind { AmpersandEqual, AnonymousKeyword, AsKeyword, - AsciiEscape, AsciiStringLiteral, AssemblyKeyword, Asterisk, @@ -37,7 +36,7 @@ pub enum TokenKind { BarEqual, BoolKeyword, BreakKeyword, - ByteType, + ByteKeyword, CalldataKeyword, Caret, CaretEqual, @@ -54,14 +53,10 @@ pub enum TokenKind { ContinueKeyword, ContractKeyword, DaysKeyword, - DecimalExponent, DecimalLiteral, - DecimalNumber, DefaultKeyword, DeleteKeyword, DoKeyword, - DoubleQuotedAsciiStringLiteral, - DoubleQuotedUnicodeStringLiteral, ElseKeyword, EmitKeyword, EndOfLine, @@ -70,10 +65,8 @@ pub enum TokenKind { EqualEqual, EqualGreaterThan, ErrorKeyword, - EscapeSequence, EtherKeyword, EventKeyword, - Evmasm, ExperimentalKeyword, ExternalKeyword, FallbackKeyword, @@ -91,13 +84,10 @@ pub enum TokenKind { GreaterThanGreaterThanGreaterThan, GreaterThanGreaterThanGreaterThanEqual, GweiKeyword, - HexByteEscape, HexLiteral, HexStringLiteral, HoursKeyword, Identifier, - IdentifierPart, - IdentifierStart, IfKeyword, ImmutableKeyword, ImportKeyword, @@ -122,8 +112,6 @@ pub enum TokenKind { ModifierKeyword, MultilineComment, NewKeyword, - NotAnIdentifierInAnyVersion, - NotAnIdentifierInSomeVersions, OpenBrace, OpenBracket, OpenParen, @@ -135,13 +123,11 @@ pub enum TokenKind { Plus, PlusEqual, PlusPlus, - PossiblySeparatedPairsOfHexDigits, PragmaKeyword, PrivateKeyword, PublicKeyword, PureKeyword, QuestionMark, - RawIdentifier, ReceiveKeyword, ReturnKeyword, ReturnsKeyword, @@ -151,8 +137,6 @@ pub enum TokenKind { SignedFixedType, SignedIntegerType, SingleLineComment, - SingleQuotedAsciiStringLiteral, - SingleQuotedUnicodeStringLiteral, Slash, SlashEqual, SolidityKeyword, @@ -167,7 +151,6 @@ pub enum TokenKind { TryKeyword, TypeKeyword, UncheckedKeyword, - UnicodeEscape, UnicodeStringLiteral, UnsignedFixedType, UnsignedIntegerType, @@ -184,8 +167,6 @@ pub enum TokenKind { YulDecimalLiteral, YulHexLiteral, YulIdentifier, - YulKeyword, - YulReservedKeyword, } #[derive( Clone, @@ -202,146 +183,132 @@ pub enum TokenKind { )] pub enum RuleKind { ABICoderPragma, - AddSubExpression, - AddSubOperator, AddressType, - AndExpression, - AndOperator, - ArgumentList, - Arguments, - ArrayLiteral, + ArgumentsDeclaration, + ArrayExpression, ArrayTypeName, - AssemblyFlags, + ArrayValuesList, + AsciiStringLiteralsList, + AssemblyFlagsList, AssemblyStatement, - AssignmentExpression, - AssignmentOperator, - AsteriskImport, - BitAndExpression, - BitAndOperator, - BitOrExpression, - BitOrOperator, - BitXOrExpression, - BitXOrOperator, + BinaryExpression, Block, - BooleanLiteral, BreakStatement, CatchClause, + CatchClauseError, + CatchClausesList, ConditionalExpression, - ConditionalOperator, ConstantDefinition, - ConstructorAttribute, + ConstructorAttributesList, ConstructorDefinition, ContinueStatement, - ContractBodyElements, ContractDefinition, - DataLocation, - Definition, + ContractMembersList, + DeconstructionImport, + DeconstructionImportSymbol, + DeconstructionImportSymbolsList, DeleteStatement, - Directive, DoWhileStatement, - ElementaryType, EmitStatement, EndOfFileTrivia, EnumDefinition, - EqualityComparisonExpression, - EqualityComparisonOperator, ErrorDefinition, ErrorParameter, + ErrorParametersList, EventDefinition, EventParameter, + EventParametersList, ExperimentalPragma, - ExponentiationExpression, - ExponentiationOperator, Expression, ExpressionStatement, - FallbackFunctionAttribute, + FallbackFunctionAttributesList, FallbackFunctionDefinition, ForStatement, - FunctionAttribute, + FunctionAttributesList, FunctionCallExpression, - FunctionCallOperator, FunctionCallOptions, FunctionDefinition, FunctionType, + FunctionTypeAttributesList, + HexStringLiteralsList, IdentifierPath, + IdentifierPathsList, + IdentifiersList, IfStatement, - ImportAlias, ImportDirective, - ImportPath, IndexAccessExpression, - IndexAccessOperator, InheritanceSpecifier, - InheritanceSpecifierList, + InheritanceType, + InheritanceTypesList, InterfaceDefinition, + InterfaceMembersList, LeadingTrivia, LibraryDefinition, + LibraryMembersList, MappingKeyType, MappingType, MappingValueType, MemberAccessExpression, - MemberAccessOperator, - ModifierAttribute, + ModifierAttributesList, ModifierDefinition, ModifierInvocation, - MulDivModExpression, - MulDivModOperator, NamedArgument, - NamedArgumentList, + NamedArgumentsDeclaration, + NamedArgumentsList, + NamedImport, NewExpression, - NumberUnit, NumericExpression, - OrExpression, - OrOperator, - OrderComparisonExpression, - OrderComparisonOperator, OverrideSpecifier, - ParameterDeclaration, - ParameterList, - PayableType, - PositionalArgumentList, + Parameter, + ParametersDeclaration, + ParametersList, + PathImport, + PositionalArgumentsList, PragmaDirective, - PrimaryExpression, - ReceiveFunctionAttribute, + ReceiveFunctionAttributesList, ReceiveFunctionDefinition, - Results, ReturnStatement, + ReturnsDeclaration, RevertStatement, - SelectiveImport, - ShiftExpression, - ShiftOperator, - SimpleImport, - SimpleStatement, SourceUnit, - StateVariableAttribute, - StateVariableDeclaration, + SourceUnitMembersList, + StateVariableAttributesList, + StateVariableDefinition, Statement, - StringExpression, + StatementsList, StructDefinition, StructMember, + StructMembersList, ThrowStatement, TrailingTrivia, TryStatement, TupleDeconstructionStatement, TupleExpression, + TupleMember, + TupleMembersList, + TupleValuesList, TypeExpression, TypeName, UnaryPostfixExpression, - UnaryPostfixOperator, UnaryPrefixExpression, - UnaryPrefixOperator, UncheckedBlock, - UnnamedFunctionAttribute, + UnicodeStringLiteralsList, + UnnamedFunctionAttributesList, UnnamedFunctionDefinition, - UserDefinedOperator, UserDefinedValueTypeDefinition, UsingDirective, + UsingDirectiveDeconstruction, + UsingDirectivePath, + UsingDirectiveSymbol, + UsingDirectiveSymbolsList, + VariableDeclaration, VariableDeclarationStatement, VersionPragma, - VersionPragmaAlternatives, - VersionPragmaComparator, - VersionPragmaExpressionList, - VersionPragmaRange, + VersionPragmaBinaryExpression, + VersionPragmaExpression, + VersionPragmaExpressionsList, VersionPragmaSpecifier, + VersionPragmaUnaryExpression, WhileStatement, YulAssignmentStatement, YulBlock, @@ -349,14 +316,21 @@ pub enum RuleKind { YulContinueStatement, YulDeclarationStatement, YulExpression, + YulExpressionsList, YulForStatement, YulFunctionCallExpression, YulFunctionDefinition, YulIdentifierPath, + YulIdentifierPathsList, + YulIdentifiersList, YulIfStatement, YulLeaveStatement, - YulLiteral, + YulParametersDeclaration, + YulReturnsDeclaration, YulStatement, + YulStatementsList, + YulSwitchCase, + YulSwitchCasesList, YulSwitchStatement, } #[derive( @@ -376,46 +350,41 @@ pub enum ProductionKind { ABICoderPragma, AbicoderKeyword, AbstractKeyword, - AddSubOperator, AddressKeyword, AddressType, Ampersand, AmpersandAmpersand, AmpersandEqual, - AndOperator, AnonymousKeyword, - ArgumentList, - ArrayLiteral, + ArgumentsDeclaration, + ArrayExpression, + ArrayValuesList, AsKeyword, - AsciiEscape, AsciiStringLiteral, - AssemblyFlags, + AsciiStringLiteralsList, + AssemblyFlagsList, AssemblyKeyword, AssemblyStatement, - AssignmentOperator, Asterisk, AsteriskAsterisk, AsteriskEqual, - AsteriskImport, Bang, BangEqual, Bar, BarBar, BarEqual, - BitAndOperator, - BitOrOperator, - BitXOrOperator, Block, BoolKeyword, - BooleanLiteral, BreakKeyword, BreakStatement, - ByteType, + ByteKeyword, CalldataKeyword, Caret, CaretEqual, CaseKeyword, CatchClause, + CatchClauseError, + CatchClausesList, CatchKeyword, CloseBrace, CloseBracket, @@ -423,31 +392,26 @@ pub enum ProductionKind { Colon, ColonEqual, Comma, - ConditionalOperator, ConstantDefinition, ConstantKeyword, - ConstructorAttribute, + ConstructorAttributesList, ConstructorDefinition, ConstructorKeyword, ContinueKeyword, ContinueStatement, ContractDefinition, ContractKeyword, - DataLocation, + ContractMembersList, DaysKeyword, - DecimalExponent, DecimalLiteral, - DecimalNumber, + DeconstructionImport, + DeconstructionImportSymbol, + DeconstructionImportSymbolsList, DefaultKeyword, - Definition, DeleteKeyword, DeleteStatement, - Directive, DoKeyword, DoWhileStatement, - DoubleQuotedAsciiStringLiteral, - DoubleQuotedUnicodeStringLiteral, - ElementaryType, ElseKeyword, EmitKeyword, EmitStatement, @@ -458,23 +422,21 @@ pub enum ProductionKind { Equal, EqualEqual, EqualGreaterThan, - EqualityComparisonOperator, ErrorDefinition, ErrorKeyword, ErrorParameter, - EscapeSequence, + ErrorParametersList, EtherKeyword, EventDefinition, EventKeyword, EventParameter, - Evmasm, + EventParametersList, ExperimentalKeyword, ExperimentalPragma, - ExponentiationOperator, Expression, ExpressionStatement, ExternalKeyword, - FallbackFunctionAttribute, + FallbackFunctionAttributesList, FallbackFunctionDefinition, FallbackKeyword, FalseKeyword, @@ -483,12 +445,12 @@ pub enum ProductionKind { ForKeyword, ForStatement, FromKeyword, - FunctionAttribute, - FunctionCallOperator, + FunctionAttributesList, FunctionCallOptions, FunctionDefinition, FunctionKeyword, FunctionType, + FunctionTypeAttributesList, GlobalKeyword, GreaterThan, GreaterThanEqual, @@ -497,27 +459,26 @@ pub enum ProductionKind { GreaterThanGreaterThanGreaterThan, GreaterThanGreaterThanGreaterThanEqual, GweiKeyword, - HexByteEscape, HexLiteral, HexStringLiteral, + HexStringLiteralsList, HoursKeyword, Identifier, - IdentifierPart, IdentifierPath, - IdentifierStart, + IdentifierPathsList, + IdentifiersList, IfKeyword, IfStatement, ImmutableKeyword, - ImportAlias, ImportDirective, ImportKeyword, - ImportPath, - IndexAccessOperator, IndexedKeyword, InheritanceSpecifier, - InheritanceSpecifierList, + InheritanceType, + InheritanceTypesList, InterfaceDefinition, InterfaceKeyword, + InterfaceMembersList, InternalKeyword, IsKeyword, LeadingTrivia, @@ -529,90 +490,81 @@ pub enum ProductionKind { LetKeyword, LibraryDefinition, LibraryKeyword, + LibraryMembersList, MappingKeyType, MappingKeyword, MappingType, MappingValueType, - MemberAccessOperator, MemoryKeyword, Minus, MinusEqual, MinusGreaterThan, MinusMinus, MinutesKeyword, - ModifierAttribute, + ModifierAttributesList, ModifierDefinition, ModifierInvocation, ModifierKeyword, - MulDivModOperator, MultilineComment, NamedArgument, - NamedArgumentList, + NamedArgumentsDeclaration, + NamedArgumentsList, + NamedImport, NewExpression, NewKeyword, - NotAnIdentifierInAnyVersion, - NotAnIdentifierInSomeVersions, - NumberUnit, NumericExpression, OpenBrace, OpenBracket, OpenParen, - OrOperator, - OrderComparisonOperator, OverrideKeyword, OverrideSpecifier, - ParameterDeclaration, - ParameterList, + Parameter, + ParametersDeclaration, + ParametersList, + PathImport, PayableKeyword, - PayableType, Percent, PercentEqual, Period, Plus, PlusEqual, PlusPlus, - PositionalArgumentList, - PossiblySeparatedPairsOfHexDigits, + PositionalArgumentsList, PragmaDirective, PragmaKeyword, - PrimaryExpression, PrivateKeyword, PublicKeyword, PureKeyword, QuestionMark, - RawIdentifier, - ReceiveFunctionAttribute, + ReceiveFunctionAttributesList, ReceiveFunctionDefinition, ReceiveKeyword, ReturnKeyword, ReturnStatement, + ReturnsDeclaration, ReturnsKeyword, RevertKeyword, RevertStatement, SecondsKeyword, - SelectiveImport, Semicolon, - ShiftOperator, SignedFixedType, SignedIntegerType, - SimpleImport, - SimpleStatement, SingleLineComment, - SingleQuotedAsciiStringLiteral, - SingleQuotedUnicodeStringLiteral, Slash, SlashEqual, SolidityKeyword, SourceUnit, - StateVariableAttribute, - StateVariableDeclaration, + SourceUnitMembersList, + StateVariableAttributesList, + StateVariableDefinition, Statement, + StatementsList, StorageKeyword, - StringExpression, StringKeyword, StructDefinition, StructKeyword, StructMember, + StructMembersList, SwitchKeyword, SzaboKeyword, ThrowKeyword, @@ -624,26 +576,33 @@ pub enum ProductionKind { TryStatement, TupleDeconstructionStatement, TupleExpression, + TupleMember, + TupleMembersList, + TupleValuesList, TypeExpression, TypeKeyword, TypeName, - UnaryPostfixOperator, - UnaryPrefixOperator, UncheckedBlock, UncheckedKeyword, - UnicodeEscape, UnicodeStringLiteral, - UnnamedFunctionAttribute, + UnicodeStringLiteralsList, + UnnamedFunctionAttributesList, UnnamedFunctionDefinition, UnsignedFixedType, UnsignedIntegerType, - UserDefinedOperator, UserDefinedValueTypeDefinition, UsingDirective, + UsingDirectiveDeconstruction, + UsingDirectivePath, + UsingDirectiveSymbol, + UsingDirectiveSymbolsList, UsingKeyword, VarKeyword, + VariableDeclaration, VariableDeclarationStatement, VersionPragma, + VersionPragmaExpression, + VersionPragmaExpressionsList, VersionPragmaSpecifier, VersionPragmaValue, ViewKeyword, @@ -661,16 +620,21 @@ pub enum ProductionKind { YulDecimalLiteral, YulDeclarationStatement, YulExpression, + YulExpressionsList, YulForStatement, YulFunctionDefinition, YulHexLiteral, YulIdentifier, YulIdentifierPath, + YulIdentifierPathsList, + YulIdentifiersList, YulIfStatement, - YulKeyword, YulLeaveStatement, - YulLiteral, - YulReservedKeyword, + YulParametersDeclaration, + YulReturnsDeclaration, YulStatement, + YulStatementsList, + YulSwitchCase, + YulSwitchCasesList, YulSwitchStatement, } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/language.rs b/crates/solidity/outputs/cargo/crate/src/generated/language.rs index 5b55dd18bc..f616aadd6a 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/language.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/language.rs @@ -123,9 +123,6 @@ impl Language { ProductionKind::AsKeyword => { Language::as_keyword.scan(self, input, TokenKind::AsKeyword) } - ProductionKind::AsciiEscape => { - Language::ascii_escape.scan(self, input, TokenKind::AsciiEscape) - } ProductionKind::AsciiStringLiteral => { Language::ascii_string_literal.scan(self, input, TokenKind::AsciiStringLiteral) } @@ -152,8 +149,8 @@ impl Language { ProductionKind::BreakKeyword => { Language::break_keyword.scan(self, input, TokenKind::BreakKeyword) } - ProductionKind::ByteType => { - Language::byte_type__sparse_dispatch.scan(self, input, TokenKind::ByteType) + ProductionKind::ByteKeyword => { + Language::byte_keyword__sparse_dispatch.scan(self, input, TokenKind::ByteKeyword) } ProductionKind::CalldataKeyword => Language::calldata_keyword__sparse_dispatch.scan( self, @@ -198,15 +195,9 @@ impl Language { ProductionKind::DaysKeyword => { Language::days_keyword.scan(self, input, TokenKind::DaysKeyword) } - ProductionKind::DecimalExponent => { - Language::decimal_exponent.scan(self, input, TokenKind::DecimalExponent) - } ProductionKind::DecimalLiteral => { Language::decimal_literal.scan(self, input, TokenKind::DecimalLiteral) } - ProductionKind::DecimalNumber => { - Language::decimal_number.scan(self, input, TokenKind::DecimalNumber) - } ProductionKind::DefaultKeyword => { Language::default_keyword.scan(self, input, TokenKind::DefaultKeyword) } @@ -216,20 +207,6 @@ impl Language { ProductionKind::DoKeyword => { Language::do_keyword.scan(self, input, TokenKind::DoKeyword) } - ProductionKind::DoubleQuotedAsciiStringLiteral => { - Language::double_quoted_ascii_string_literal.scan( - self, - input, - TokenKind::DoubleQuotedAsciiStringLiteral, - ) - } - ProductionKind::DoubleQuotedUnicodeStringLiteral => { - Language::double_quoted_unicode_string_literal__sparse_dispatch.scan( - self, - input, - TokenKind::DoubleQuotedUnicodeStringLiteral, - ) - } ProductionKind::ElseKeyword => { Language::else_keyword.scan(self, input, TokenKind::ElseKeyword) } @@ -252,16 +229,12 @@ impl Language { ProductionKind::ErrorKeyword => { Language::error_keyword.scan(self, input, TokenKind::ErrorKeyword) } - ProductionKind::EscapeSequence => { - Language::escape_sequence.scan(self, input, TokenKind::EscapeSequence) - } ProductionKind::EtherKeyword => { Language::ether_keyword.scan(self, input, TokenKind::EtherKeyword) } ProductionKind::EventKeyword => { Language::event_keyword.scan(self, input, TokenKind::EventKeyword) } - ProductionKind::Evmasm => Language::evmasm.scan(self, input, TokenKind::Evmasm), ProductionKind::ExperimentalKeyword => { Language::experimental_keyword.scan(self, input, TokenKind::ExperimentalKeyword) } @@ -329,9 +302,6 @@ impl Language { ProductionKind::GweiKeyword => { Language::gwei_keyword__sparse_dispatch.scan(self, input, TokenKind::GweiKeyword) } - ProductionKind::HexByteEscape => { - Language::hex_byte_escape.scan(self, input, TokenKind::HexByteEscape) - } ProductionKind::HexLiteral => { Language::hex_literal.scan(self, input, TokenKind::HexLiteral) } @@ -344,12 +314,6 @@ impl Language { ProductionKind::Identifier => { Language::identifier.scan(self, input, TokenKind::Identifier) } - ProductionKind::IdentifierPart => { - Language::identifier_part.scan(self, input, TokenKind::IdentifierPart) - } - ProductionKind::IdentifierStart => { - Language::identifier_start.scan(self, input, TokenKind::IdentifierStart) - } ProductionKind::IfKeyword => { Language::if_keyword.scan(self, input, TokenKind::IfKeyword) } @@ -422,20 +386,6 @@ impl Language { ProductionKind::NewKeyword => { Language::new_keyword.scan(self, input, TokenKind::NewKeyword) } - ProductionKind::NotAnIdentifierInAnyVersion => { - Language::not_an_identifier_in_any_version.scan( - self, - input, - TokenKind::NotAnIdentifierInAnyVersion, - ) - } - ProductionKind::NotAnIdentifierInSomeVersions => { - Language::not_an_identifier_in_some_versions.scan( - self, - input, - TokenKind::NotAnIdentifierInSomeVersions, - ) - } ProductionKind::OpenBrace => { Language::open_brace.scan(self, input, TokenKind::OpenBrace) } @@ -461,13 +411,6 @@ impl Language { Language::plus_equal.scan(self, input, TokenKind::PlusEqual) } ProductionKind::PlusPlus => Language::plus_plus.scan(self, input, TokenKind::PlusPlus), - ProductionKind::PossiblySeparatedPairsOfHexDigits => { - Language::possibly_separated_pairs_of_hex_digits.scan( - self, - input, - TokenKind::PossiblySeparatedPairsOfHexDigits, - ) - } ProductionKind::PragmaKeyword => { Language::pragma_keyword.scan(self, input, TokenKind::PragmaKeyword) } @@ -483,9 +426,6 @@ impl Language { ProductionKind::QuestionMark => { Language::question_mark.scan(self, input, TokenKind::QuestionMark) } - ProductionKind::RawIdentifier => { - Language::raw_identifier.scan(self, input, TokenKind::RawIdentifier) - } ProductionKind::ReceiveKeyword => { Language::receive_keyword.scan(self, input, TokenKind::ReceiveKeyword) } @@ -513,20 +453,6 @@ impl Language { ProductionKind::SingleLineComment => { Language::single_line_comment.scan(self, input, TokenKind::SingleLineComment) } - ProductionKind::SingleQuotedAsciiStringLiteral => { - Language::single_quoted_ascii_string_literal.scan( - self, - input, - TokenKind::SingleQuotedAsciiStringLiteral, - ) - } - ProductionKind::SingleQuotedUnicodeStringLiteral => { - Language::single_quoted_unicode_string_literal__sparse_dispatch.scan( - self, - input, - TokenKind::SingleQuotedUnicodeStringLiteral, - ) - } ProductionKind::Slash => Language::slash.scan(self, input, TokenKind::Slash), ProductionKind::SlashEqual => { Language::slash_equal.scan(self, input, TokenKind::SlashEqual) @@ -567,9 +493,6 @@ impl Language { input, TokenKind::UncheckedKeyword, ), - ProductionKind::UnicodeEscape => { - Language::unicode_escape.scan(self, input, TokenKind::UnicodeEscape) - } ProductionKind::UnicodeStringLiteral => { Language::unicode_string_literal__sparse_dispatch.scan( self, @@ -624,157 +547,167 @@ impl Language { ProductionKind::YulIdentifier => { Language::yul_identifier.scan(self, input, TokenKind::YulIdentifier) } - ProductionKind::YulKeyword => { - Language::yul_keyword.scan(self, input, TokenKind::YulKeyword) - } - ProductionKind::YulReservedKeyword => { - Language::yul_reserved_keyword.scan(self, input, TokenKind::YulReservedKeyword) - } ProductionKind::ABICoderPragma => Language::abi_coder_pragma.parse(self, input), - ProductionKind::AddSubOperator => Language::add_sub_operator.parse(self, input), ProductionKind::AddressType => Language::address_type.parse(self, input), - ProductionKind::AndOperator => Language::and_operator.parse(self, input), - ProductionKind::ArgumentList => Language::argument_list.parse(self, input), - ProductionKind::ArrayLiteral => Language::array_literal.parse(self, input), - ProductionKind::AssemblyFlags => Language::assembly_flags.parse(self, input), + ProductionKind::ArgumentsDeclaration => { + Language::arguments_declaration.parse(self, input) + } + ProductionKind::ArrayExpression => Language::array_expression.parse(self, input), + ProductionKind::ArrayValuesList => Language::array_values_list.parse(self, input), + ProductionKind::AsciiStringLiteralsList => { + Language::ascii_string_literals_list.parse(self, input) + } + ProductionKind::AssemblyFlagsList => Language::assembly_flags_list.parse(self, input), ProductionKind::AssemblyStatement => Language::assembly_statement.parse(self, input), - ProductionKind::AssignmentOperator => Language::assignment_operator.parse(self, input), - ProductionKind::AsteriskImport => Language::asterisk_import.parse(self, input), - ProductionKind::BitAndOperator => Language::bit_and_operator.parse(self, input), - ProductionKind::BitOrOperator => Language::bit_or_operator.parse(self, input), - ProductionKind::BitXOrOperator => Language::bit_x_or_operator.parse(self, input), ProductionKind::Block => Language::block.parse(self, input), - ProductionKind::BooleanLiteral => Language::boolean_literal.parse(self, input), ProductionKind::BreakStatement => Language::break_statement.parse(self, input), ProductionKind::CatchClause => { Language::catch_clause__sparse_dispatch.parse(self, input) } - ProductionKind::ConditionalOperator => { - Language::conditional_operator.parse(self, input) + ProductionKind::CatchClauseError => { + Language::catch_clause_error__sparse_dispatch.parse(self, input) + } + ProductionKind::CatchClausesList => { + Language::catch_clauses_list__sparse_dispatch.parse(self, input) } ProductionKind::ConstantDefinition => Language::constant_definition.parse(self, input), - ProductionKind::ConstructorAttribute => { - Language::constructor_attribute__sparse_dispatch.parse(self, input) + ProductionKind::ConstructorAttributesList => { + Language::constructor_attributes_list__sparse_dispatch.parse(self, input) } ProductionKind::ConstructorDefinition => { Language::constructor_definition__sparse_dispatch.parse(self, input) } ProductionKind::ContinueStatement => Language::continue_statement.parse(self, input), ProductionKind::ContractDefinition => Language::contract_definition.parse(self, input), - ProductionKind::DataLocation => Language::data_location.parse(self, input), - ProductionKind::Definition => Language::definition.parse(self, input), + ProductionKind::ContractMembersList => { + Language::contract_members_list.parse(self, input) + } + ProductionKind::DeconstructionImport => { + Language::deconstruction_import.parse(self, input) + } + ProductionKind::DeconstructionImportSymbol => { + Language::deconstruction_import_symbol.parse(self, input) + } + ProductionKind::DeconstructionImportSymbolsList => { + Language::deconstruction_import_symbols_list.parse(self, input) + } ProductionKind::DeleteStatement => Language::delete_statement.parse(self, input), - ProductionKind::Directive => Language::directive.parse(self, input), ProductionKind::DoWhileStatement => Language::do_while_statement.parse(self, input), - ProductionKind::ElementaryType => Language::elementary_type.parse(self, input), ProductionKind::EmitStatement => { Language::emit_statement__sparse_dispatch.parse(self, input) } ProductionKind::EndOfFileTrivia => Language::end_of_file_trivia.parse(self, input), ProductionKind::EnumDefinition => Language::enum_definition.parse(self, input), - ProductionKind::EqualityComparisonOperator => { - Language::equality_comparison_operator.parse(self, input) - } ProductionKind::ErrorDefinition => Language::error_definition.parse(self, input), ProductionKind::ErrorParameter => Language::error_parameter.parse(self, input), + ProductionKind::ErrorParametersList => { + Language::error_parameters_list.parse(self, input) + } ProductionKind::EventDefinition => Language::event_definition.parse(self, input), ProductionKind::EventParameter => Language::event_parameter.parse(self, input), - ProductionKind::ExperimentalPragma => Language::experimental_pragma.parse(self, input), - ProductionKind::ExponentiationOperator => { - Language::exponentiation_operator.parse(self, input) + ProductionKind::EventParametersList => { + Language::event_parameters_list.parse(self, input) } + ProductionKind::ExperimentalPragma => Language::experimental_pragma.parse(self, input), ProductionKind::Expression => Language::expression.parse(self, input), ProductionKind::ExpressionStatement => { Language::expression_statement.parse(self, input) } - ProductionKind::FallbackFunctionAttribute => { - Language::fallback_function_attribute__sparse_dispatch.parse(self, input) + ProductionKind::FallbackFunctionAttributesList => { + Language::fallback_function_attributes_list__sparse_dispatch.parse(self, input) } ProductionKind::FallbackFunctionDefinition => { Language::fallback_function_definition__sparse_dispatch.parse(self, input) } ProductionKind::ForStatement => Language::for_statement.parse(self, input), - ProductionKind::FunctionAttribute => Language::function_attribute.parse(self, input), - ProductionKind::FunctionCallOperator => { - Language::function_call_operator.parse(self, input) + ProductionKind::FunctionAttributesList => { + Language::function_attributes_list.parse(self, input) } ProductionKind::FunctionCallOptions => { Language::function_call_options__sparse_dispatch.parse(self, input) } ProductionKind::FunctionDefinition => Language::function_definition.parse(self, input), ProductionKind::FunctionType => Language::function_type.parse(self, input), + ProductionKind::FunctionTypeAttributesList => { + Language::function_type_attributes_list.parse(self, input) + } + ProductionKind::HexStringLiteralsList => { + Language::hex_string_literals_list.parse(self, input) + } ProductionKind::IdentifierPath => Language::identifier_path.parse(self, input), + ProductionKind::IdentifierPathsList => { + Language::identifier_paths_list.parse(self, input) + } + ProductionKind::IdentifiersList => Language::identifiers_list.parse(self, input), ProductionKind::IfStatement => Language::if_statement.parse(self, input), - ProductionKind::ImportAlias => Language::import_alias.parse(self, input), ProductionKind::ImportDirective => Language::import_directive.parse(self, input), - ProductionKind::ImportPath => Language::import_path.parse(self, input), - ProductionKind::IndexAccessOperator => { - Language::index_access_operator.parse(self, input) - } ProductionKind::InheritanceSpecifier => { Language::inheritance_specifier.parse(self, input) } - ProductionKind::InheritanceSpecifierList => { - Language::inheritance_specifier_list.parse(self, input) + ProductionKind::InheritanceType => Language::inheritance_type.parse(self, input), + ProductionKind::InheritanceTypesList => { + Language::inheritance_types_list.parse(self, input) } ProductionKind::InterfaceDefinition => { Language::interface_definition.parse(self, input) } + ProductionKind::InterfaceMembersList => { + Language::interface_members_list.parse(self, input) + } ProductionKind::LeadingTrivia => Language::leading_trivia.parse(self, input), ProductionKind::LibraryDefinition => Language::library_definition.parse(self, input), + ProductionKind::LibraryMembersList => Language::library_members_list.parse(self, input), ProductionKind::MappingKeyType => Language::mapping_key_type.parse(self, input), ProductionKind::MappingType => Language::mapping_type.parse(self, input), ProductionKind::MappingValueType => Language::mapping_value_type.parse(self, input), - ProductionKind::MemberAccessOperator => { - Language::member_access_operator.parse(self, input) + ProductionKind::ModifierAttributesList => { + Language::modifier_attributes_list.parse(self, input) } - ProductionKind::ModifierAttribute => Language::modifier_attribute.parse(self, input), ProductionKind::ModifierDefinition => Language::modifier_definition.parse(self, input), ProductionKind::ModifierInvocation => Language::modifier_invocation.parse(self, input), - ProductionKind::MulDivModOperator => Language::mul_div_mod_operator.parse(self, input), ProductionKind::NamedArgument => Language::named_argument.parse(self, input), - ProductionKind::NamedArgumentList => Language::named_argument_list.parse(self, input), + ProductionKind::NamedArgumentsDeclaration => { + Language::named_arguments_declaration.parse(self, input) + } + ProductionKind::NamedArgumentsList => Language::named_arguments_list.parse(self, input), + ProductionKind::NamedImport => Language::named_import.parse(self, input), ProductionKind::NewExpression => Language::new_expression.parse(self, input), - ProductionKind::NumberUnit => Language::number_unit.parse(self, input), ProductionKind::NumericExpression => Language::numeric_expression.parse(self, input), - ProductionKind::OrOperator => Language::or_operator.parse(self, input), - ProductionKind::OrderComparisonOperator => { - Language::order_comparison_operator.parse(self, input) - } ProductionKind::OverrideSpecifier => Language::override_specifier.parse(self, input), - ProductionKind::ParameterDeclaration => { - Language::parameter_declaration.parse(self, input) + ProductionKind::Parameter => Language::parameter.parse(self, input), + ProductionKind::ParametersDeclaration => { + Language::parameters_declaration.parse(self, input) } - ProductionKind::ParameterList => Language::parameter_list.parse(self, input), - ProductionKind::PayableType => Language::payable_type.parse(self, input), - ProductionKind::PositionalArgumentList => { - Language::positional_argument_list.parse(self, input) + ProductionKind::ParametersList => Language::parameters_list.parse(self, input), + ProductionKind::PathImport => Language::path_import.parse(self, input), + ProductionKind::PositionalArgumentsList => { + Language::positional_arguments_list.parse(self, input) } ProductionKind::PragmaDirective => Language::pragma_directive.parse(self, input), - ProductionKind::PrimaryExpression => Language::primary_expression.parse(self, input), - ProductionKind::ReceiveFunctionAttribute => { - Language::receive_function_attribute__sparse_dispatch.parse(self, input) + ProductionKind::ReceiveFunctionAttributesList => { + Language::receive_function_attributes_list__sparse_dispatch.parse(self, input) } ProductionKind::ReceiveFunctionDefinition => { Language::receive_function_definition__sparse_dispatch.parse(self, input) } ProductionKind::ReturnStatement => Language::return_statement.parse(self, input), + ProductionKind::ReturnsDeclaration => Language::returns_declaration.parse(self, input), ProductionKind::RevertStatement => Language::revert_statement.parse(self, input), - ProductionKind::SelectiveImport => Language::selective_import.parse(self, input), - ProductionKind::ShiftOperator => Language::shift_operator.parse(self, input), - ProductionKind::SimpleImport => Language::simple_import.parse(self, input), - ProductionKind::SimpleStatement => Language::simple_statement.parse(self, input), ProductionKind::SourceUnit => Language::source_unit.parse(self, input), - ProductionKind::StateVariableAttribute => { - Language::state_variable_attribute.parse(self, input) + ProductionKind::SourceUnitMembersList => { + Language::source_unit_members_list.parse(self, input) } - ProductionKind::StateVariableDeclaration => { - Language::state_variable_declaration.parse(self, input) + ProductionKind::StateVariableAttributesList => { + Language::state_variable_attributes_list.parse(self, input) + } + ProductionKind::StateVariableDefinition => { + Language::state_variable_definition.parse(self, input) } ProductionKind::Statement => Language::statement.parse(self, input), - ProductionKind::StringExpression => Language::string_expression.parse(self, input), + ProductionKind::StatementsList => Language::statements_list.parse(self, input), ProductionKind::StructDefinition => Language::struct_definition.parse(self, input), ProductionKind::StructMember => Language::struct_member.parse(self, input), + ProductionKind::StructMembersList => Language::struct_members_list.parse(self, input), ProductionKind::ThrowStatement => { Language::throw_statement__sparse_dispatch.parse(self, input) } @@ -786,36 +719,52 @@ impl Language { Language::tuple_deconstruction_statement.parse(self, input) } ProductionKind::TupleExpression => Language::tuple_expression.parse(self, input), + ProductionKind::TupleMember => Language::tuple_member.parse(self, input), + ProductionKind::TupleMembersList => Language::tuple_members_list.parse(self, input), + ProductionKind::TupleValuesList => Language::tuple_values_list.parse(self, input), ProductionKind::TypeExpression => { Language::type_expression__sparse_dispatch.parse(self, input) } ProductionKind::TypeName => Language::type_name.parse(self, input), - ProductionKind::UnaryPostfixOperator => { - Language::unary_postfix_operator.parse(self, input) - } - ProductionKind::UnaryPrefixOperator => { - Language::unary_prefix_operator.parse(self, input) - } ProductionKind::UncheckedBlock => { Language::unchecked_block__sparse_dispatch.parse(self, input) } - ProductionKind::UnnamedFunctionAttribute => { - Language::unnamed_function_attribute__sparse_dispatch.parse(self, input) + ProductionKind::UnicodeStringLiteralsList => { + Language::unicode_string_literals_list__sparse_dispatch.parse(self, input) + } + ProductionKind::UnnamedFunctionAttributesList => { + Language::unnamed_function_attributes_list__sparse_dispatch.parse(self, input) } ProductionKind::UnnamedFunctionDefinition => { Language::unnamed_function_definition__sparse_dispatch.parse(self, input) } - ProductionKind::UserDefinedOperator => { - Language::user_defined_operator__sparse_dispatch.parse(self, input) - } ProductionKind::UserDefinedValueTypeDefinition => { Language::user_defined_value_type_definition__sparse_dispatch.parse(self, input) } ProductionKind::UsingDirective => Language::using_directive.parse(self, input), + ProductionKind::UsingDirectiveDeconstruction => { + Language::using_directive_deconstruction.parse(self, input) + } + ProductionKind::UsingDirectivePath => Language::using_directive_path.parse(self, input), + ProductionKind::UsingDirectiveSymbol => { + Language::using_directive_symbol.parse(self, input) + } + ProductionKind::UsingDirectiveSymbolsList => { + Language::using_directive_symbols_list.parse(self, input) + } + ProductionKind::VariableDeclaration => { + Language::variable_declaration.parse(self, input) + } ProductionKind::VariableDeclarationStatement => { Language::variable_declaration_statement.parse(self, input) } ProductionKind::VersionPragma => Language::version_pragma.parse(self, input), + ProductionKind::VersionPragmaExpression => { + Language::version_pragma_expression.parse(self, input) + } + ProductionKind::VersionPragmaExpressionsList => { + Language::version_pragma_expressions_list.parse(self, input) + } ProductionKind::VersionPragmaSpecifier => { Language::version_pragma_specifier.parse(self, input) } @@ -832,17 +781,32 @@ impl Language { Language::yul_declaration_statement.parse(self, input) } ProductionKind::YulExpression => Language::yul_expression.parse(self, input), + ProductionKind::YulExpressionsList => Language::yul_expressions_list.parse(self, input), ProductionKind::YulForStatement => Language::yul_for_statement.parse(self, input), ProductionKind::YulFunctionDefinition => { Language::yul_function_definition.parse(self, input) } ProductionKind::YulIdentifierPath => Language::yul_identifier_path.parse(self, input), + ProductionKind::YulIdentifierPathsList => { + Language::yul_identifier_paths_list.parse(self, input) + } + ProductionKind::YulIdentifiersList => Language::yul_identifiers_list.parse(self, input), ProductionKind::YulIfStatement => Language::yul_if_statement.parse(self, input), ProductionKind::YulLeaveStatement => { Language::yul_leave_statement__sparse_dispatch.parse(self, input) } - ProductionKind::YulLiteral => Language::yul_literal.parse(self, input), + ProductionKind::YulParametersDeclaration => { + Language::yul_parameters_declaration.parse(self, input) + } + ProductionKind::YulReturnsDeclaration => { + Language::yul_returns_declaration.parse(self, input) + } ProductionKind::YulStatement => Language::yul_statement.parse(self, input), + ProductionKind::YulStatementsList => Language::yul_statements_list.parse(self, input), + ProductionKind::YulSwitchCase => Language::yul_switch_case.parse(self, input), + ProductionKind::YulSwitchCasesList => { + Language::yul_switch_cases_list.parse(self, input) + } ProductionKind::YulSwitchStatement => Language::yul_switch_statement.parse(self, input), }; diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parsers.rs b/crates/solidity/outputs/cargo/crate/src/generated/parsers.rs index 380544cc4f..d2afacd285 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parsers.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parsers.rs @@ -81,7 +81,7 @@ impl Language { .with_kind(RuleKind::ABICoderPragma) } - // AddSubOperator = PLUS | MINUS; + // «AddSubOperator» = PLUS | MINUS; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -107,30 +107,47 @@ impl Language { } running_result } - .with_kind(RuleKind::AddSubOperator) } - // AddressType = ADDRESS_KEYWORD PAYABLE_KEYWORD?; + // AddressType = (ADDRESS_KEYWORD PAYABLE_KEYWORD?) | PAYABLE_KEYWORD; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn address_type(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::r#match(vec![], vec![]); + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::address_keyword, - TokenKind::AddressKeyword, - )) { + if running_result.incorporate_choice_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::address_keyword, + TokenKind::AddressKeyword, + ), + ) { + break; + } + running_result.incorporate_sequence_result(transform_option_result( + self.parse_token_with_trivia( + stream, + &Self::payable_keyword, + TokenKind::PayableKeyword, + ), + )); + break; + } + running_result + }) { break; } - running_result.incorporate_sequence_result(transform_option_result( - self.parse_token_with_trivia( - stream, - &Self::payable_keyword, - TokenKind::PayableKeyword, - ), + stream.set_position(start_position); + running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::payable_keyword, + TokenKind::PayableKeyword, )); break; } @@ -139,7 +156,7 @@ impl Language { .with_kind(RuleKind::AddressType) } - // AndOperator = AMPERSAND_AMPERSAND; + // «AndOperator» = AMPERSAND_AMPERSAND; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -149,14 +166,13 @@ impl Language { &Self::ampersand_ampersand, TokenKind::AmpersandAmpersand, ) - .with_kind(RuleKind::AndOperator) } - // ArgumentList = OPEN_PAREN (PositionalArgumentList | NamedArgumentList)? CLOSE_PAREN; + // ArgumentsDeclaration = OPEN_PAREN (PositionalArgumentsList | NamedArgumentsDeclaration)? CLOSE_PAREN; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn argument_list(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn arguments_declaration(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -172,12 +188,13 @@ impl Language { let start_position = stream.position(); loop { if running_result - .incorporate_choice_result(self.positional_argument_list(stream)) + .incorporate_choice_result(self.positional_arguments_list(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.named_argument_list(stream)); + running_result + .incorporate_choice_result(self.named_arguments_declaration(stream)); break; } running_result @@ -193,14 +210,14 @@ impl Language { } running_result } - .with_kind(RuleKind::ArgumentList) + .with_kind(RuleKind::ArgumentsDeclaration) } - // ArrayLiteral = OPEN_BRACKET Expression (COMMA Expression)* CLOSE_BRACKET; + // ArrayExpression = OPEN_BRACKET ArrayValuesList CLOSE_BRACKET; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn array_literal(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn array_expression(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -211,38 +228,7 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.expression(stream)) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result - .incorporate_sequence_result(self.expression(stream)); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - }) { + if !running_result.incorporate_sequence_result(self.array_values_list(stream)) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -254,82 +240,146 @@ impl Language { } running_result } - .with_kind(RuleKind::ArrayLiteral) + .with_kind(RuleKind::ArrayExpression) } - // AssemblyFlags = OPEN_PAREN DOUBLE_QUOTED_ASCII_STRING_LITERAL (COMMA DOUBLE_QUOTED_ASCII_STRING_LITERAL)* CLOSE_PAREN; + // «ArrayTypeNameOperator» = OPEN_BRACKET Expression? CLOSE_BRACKET; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn assembly_flags(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn array_type_name_operator(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::open_paren, - TokenKind::OpenParen, + &Self::open_bracket, + TokenKind::OpenBracket, )) { break; } - if !running_result.incorporate_sequence_result({ + if !running_result + .incorporate_sequence_result(transform_option_result(self.expression(stream))) + { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_bracket, + TokenKind::CloseBracket, + )); + break; + } + running_result + } + } + + // ArrayValuesList = Expression (COMMA Expression)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn array_values_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.expression(stream)) { + break; + } + running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::double_quoted_ascii_string_literal, - TokenKind::DoubleQuotedAsciiStringLiteral, - ), - ) { + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.expression(stream)); break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::double_quoted_ascii_string_literal, - TokenKind::DoubleQuotedAsciiStringLiteral, - ), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } + running_result + }) {} running_result - }) { + }); + break; + } + running_result + } + .with_kind(RuleKind::ArrayValuesList) + } + + // AsciiStringLiteralsList = ASCII_STRING_LITERAL+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn ascii_string_literals_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.parse_token_with_trivia( + stream, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, + )) {} + running_result + } + .with_kind(RuleKind::AsciiStringLiteralsList) + } + + // AssemblyFlagsList = ASCII_STRING_LITERAL (COMMA ASCII_STRING_LITERAL)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn assembly_flags_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, + )) { break; } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_paren, - TokenKind::CloseParen, - )); + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, + ), + ); + break; + } + running_result + }) {} + running_result + }); break; } running_result } - .with_kind(RuleKind::AssemblyFlags) + .with_kind(RuleKind::AssemblyFlagsList) } - // AssemblyStatement = ASSEMBLY_KEYWORD EVMASM? AssemblyFlags? YulBlock; + // AssemblyStatement = ASSEMBLY_KEYWORD ASCII_STRING_LITERAL? (OPEN_PAREN AssemblyFlagsList CLOSE_PAREN)? YulBlock; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -345,13 +395,40 @@ impl Language { break; } if !running_result.incorporate_sequence_result(transform_option_result( - self.parse_token_with_trivia(stream, &Self::evmasm, TokenKind::Evmasm), + self.parse_token_with_trivia( + stream, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, + ), )) { break; } - if !running_result.incorporate_sequence_result(transform_option_result( - self.assembly_flags(stream), - )) { + if !running_result.incorporate_sequence_result(transform_option_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::open_paren, + TokenKind::OpenParen, + ), + ) { + break; + } + if !running_result + .incorporate_sequence_result(self.assembly_flags_list(stream)) + { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_paren, + TokenKind::CloseParen, + )); + break; + } + running_result + })) { break; } running_result.incorporate_sequence_result(self.yul_block(stream)); @@ -362,18 +439,18 @@ impl Language { .with_kind(RuleKind::AssemblyStatement) } - // AssignmentOperator = EQUAL - // | BAR_EQUAL - // | CARET_EQUAL - // | AMPERSAND_EQUAL - // | LESS_THAN_LESS_THAN_EQUAL - // | GREATER_THAN_GREATER_THAN_EQUAL - // | GREATER_THAN_GREATER_THAN_GREATER_THAN_EQUAL - // | PLUS_EQUAL - // | MINUS_EQUAL - // | ASTERISK_EQUAL - // | SLASH_EQUAL - // | PERCENT_EQUAL; + // «AssignmentOperator» = EQUAL + // | BAR_EQUAL + // | PLUS_EQUAL + // | MINUS_EQUAL + // | CARET_EQUAL + // | SLASH_EQUAL + // | PERCENT_EQUAL + // | ASTERISK_EQUAL + // | AMPERSAND_EQUAL + // | LESS_THAN_LESS_THAN_EQUAL + // | GREATER_THAN_GREATER_THAN_EQUAL + // | GREATER_THAN_GREATER_THAN_GREATER_THAN_EQUAL; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -400,153 +477,116 @@ impl Language { stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::caret_equal, - TokenKind::CaretEqual, + &Self::plus_equal, + TokenKind::PlusEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::ampersand_equal, - TokenKind::AmpersandEqual, + &Self::minus_equal, + TokenKind::MinusEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::less_than_less_than_equal, - TokenKind::LessThanLessThanEqual, + &Self::caret_equal, + TokenKind::CaretEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::greater_than_greater_than_equal, - TokenKind::GreaterThanGreaterThanEqual, + &Self::slash_equal, + TokenKind::SlashEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::greater_than_greater_than_greater_than_equal, - TokenKind::GreaterThanGreaterThanGreaterThanEqual, + &Self::percent_equal, + TokenKind::PercentEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::plus_equal, - TokenKind::PlusEqual, + &Self::asterisk_equal, + TokenKind::AsteriskEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::minus_equal, - TokenKind::MinusEqual, + &Self::ampersand_equal, + TokenKind::AmpersandEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::asterisk_equal, - TokenKind::AsteriskEqual, + &Self::less_than_less_than_equal, + TokenKind::LessThanLessThanEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::slash_equal, - TokenKind::SlashEqual, + &Self::greater_than_greater_than_equal, + TokenKind::GreaterThanGreaterThanEqual, )) { break; } stream.set_position(start_position); running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::percent_equal, - TokenKind::PercentEqual, + &Self::greater_than_greater_than_greater_than_equal, + TokenKind::GreaterThanGreaterThanGreaterThanEqual, )); break; } running_result } - .with_kind(RuleKind::AssignmentOperator) } - // AsteriskImport = ASTERISK ImportAlias FROM_KEYWORD ImportPath; + // «BitwiseAndOperator» = AMPERSAND; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn asterisk_import(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::asterisk, - TokenKind::Asterisk, - )) { - break; - } - if !running_result.incorporate_sequence_result(self.import_alias(stream)) { - break; - } - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::from_keyword, - TokenKind::FromKeyword, - )) { - break; - } - running_result.incorporate_sequence_result(self.import_path(stream)); - break; - } - running_result - } - .with_kind(RuleKind::AsteriskImport) - } - - // BitAndOperator = AMPERSAND; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn bit_and_operator(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn bitwise_and_operator(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, &Self::ampersand, TokenKind::Ampersand) - .with_kind(RuleKind::BitAndOperator) } - // BitOrOperator = BAR; + // «BitwiseOrOperator» = BAR; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn bit_or_operator(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn bitwise_or_operator(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, &Self::bar, TokenKind::Bar) - .with_kind(RuleKind::BitOrOperator) } - // BitXOrOperator = CARET; + // «BitwiseXOrOperator» = CARET; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn bit_x_or_operator(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn bitwise_x_or_operator(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, &Self::caret, TokenKind::Caret) - .with_kind(RuleKind::BitXOrOperator) } - // (* v0.4.11 *) - // Block = OPEN_BRACE Statement* CLOSE_BRACE; + // Block = OPEN_BRACE StatementsList? CLOSE_BRACE; - #[allow(dead_code, non_snake_case)] - fn block__0_4_11(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn block(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -557,59 +597,11 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result(self.statement(stream)) {} - running_result - }) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_brace, - TokenKind::CloseBrace, - )); - break; - } - running_result - } - .with_kind(RuleKind::Block) - } - - // (* v0.8.0 *) - // Block = OPEN_BRACE (Statement | UncheckedBlock)* CLOSE_BRACE; - - #[allow(dead_code, non_snake_case)] - fn block__0_8_0(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::open_brace, - TokenKind::OpenBrace, + if !running_result.incorporate_sequence_result(transform_option_result( + self.statements_list(stream), )) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result(self.statement(stream)) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.unchecked_block(stream)); - break; - } - running_result - }) {} - running_result - }) { - break; - } running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, &Self::close_brace, @@ -622,19 +614,11 @@ impl Language { .with_kind(RuleKind::Block) } - pub(crate) fn block(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_8_0 { - self.block__0_8_0(stream) - } else { - self.block__0_4_11(stream) - } - } - - // BooleanLiteral = TRUE_KEYWORD | FALSE_KEYWORD; + // «BooleanExpression» = TRUE_KEYWORD | FALSE_KEYWORD; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn boolean_literal(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn boolean_expression(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); @@ -656,7 +640,6 @@ impl Language { } running_result } - .with_kind(RuleKind::BooleanLiteral) } // BreakStatement = BREAK_KEYWORD SEMICOLON; @@ -687,7 +670,7 @@ impl Language { } // (* v0.6.0 *) - // CatchClause = CATCH_KEYWORD (IDENTIFIER? ParameterList)? Block; + // CatchClause = CATCH_KEYWORD CatchClauseError? Block; #[allow(dead_code, non_snake_case)] fn catch_clause__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -701,23 +684,9 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(transform_option_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - )) { - break; - } - running_result.incorporate_sequence_result(self.parameter_list(stream)); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.catch_clause_error(stream), + )) { break; } running_result.incorporate_sequence_result(self.block(stream)); @@ -746,7 +715,77 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // ConditionalOperator = QUESTION_MARK Expression COLON Expression; + // (* v0.6.0 *) + // CatchClauseError = IDENTIFIER? ParametersDeclaration; + + #[allow(dead_code, non_snake_case)] + fn catch_clause_error__0_6_0(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(transform_option_result( + self.parse_token_with_trivia(stream, &Self::identifier, TokenKind::Identifier), + )) { + break; + } + running_result.incorporate_sequence_result(self.parameters_declaration(stream)); + break; + } + running_result + } + .with_kind(RuleKind::CatchClauseError) + } + + #[allow(non_snake_case)] + pub(crate) fn catch_clause_error__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_6_0 { + Some(self.catch_clause_error__0_6_0(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn catch_clause_error(&self, stream: &mut Stream) -> ParserResult { + self.catch_clause_error__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // (* v0.6.0 *) + // CatchClausesList = CatchClause+; + + #[allow(dead_code, non_snake_case)] + fn catch_clauses_list__0_6_0(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.catch_clause(stream)) {} + running_result + } + .with_kind(RuleKind::CatchClausesList) + } + + #[allow(non_snake_case)] + pub(crate) fn catch_clauses_list__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_6_0 { + Some(self.catch_clauses_list__0_6_0(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn catch_clauses_list(&self, stream: &mut Stream) -> ParserResult { + self.catch_clauses_list__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // «ConditionalOperator» = QUESTION_MARK Expression COLON Expression; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -776,7 +815,6 @@ impl Language { } running_result } - .with_kind(RuleKind::ConditionalOperator) } // ConstantDefinition = TypeName CONSTANT_KEYWORD IDENTIFIER EQUAL Expression SEMICOLON; @@ -836,10 +874,10 @@ impl Language { } // (* v0.4.22 *) - // ConstructorAttribute = ModifierInvocation - // | INTERNAL_KEYWORD - // | PAYABLE_KEYWORD - // | PUBLIC_KEYWORD; + // «ConstructorAttribute» = ModifierInvocation + // | INTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | PUBLIC_KEYWORD; #[allow(dead_code, non_snake_case)] fn constructor_attribute__0_4_22(&self, stream: &mut Stream) -> ParserResult { @@ -876,7 +914,6 @@ impl Language { } running_result } - .with_kind(RuleKind::ConstructorAttribute) } #[allow(non_snake_case)] @@ -898,7 +935,40 @@ impl Language { } // (* v0.4.22 *) - // ConstructorDefinition = CONSTRUCTOR_KEYWORD ParameterList ConstructorAttribute* Block; + // ConstructorAttributesList = «ConstructorAttribute»+; + + #[allow(dead_code, non_snake_case)] + fn constructor_attributes_list__0_4_22(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.constructor_attribute(stream)) + { + } + running_result + } + .with_kind(RuleKind::ConstructorAttributesList) + } + + #[allow(non_snake_case)] + pub(crate) fn constructor_attributes_list__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_4_22 { + Some(self.constructor_attributes_list__0_4_22(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn constructor_attributes_list(&self, stream: &mut Stream) -> ParserResult { + self.constructor_attributes_list__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // (* v0.4.22 *) + // ConstructorDefinition = CONSTRUCTOR_KEYWORD ParametersDeclaration ConstructorAttributesList? Block; #[allow(dead_code, non_snake_case)] fn constructor_definition__0_4_22(&self, stream: &mut Stream) -> ParserResult { @@ -912,17 +982,13 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(self.parameter_list(stream)) { + if !running_result.incorporate_sequence_result(self.parameters_declaration(stream)) + { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.constructor_attribute(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.constructor_attributes_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.block(stream)); @@ -979,80 +1045,217 @@ impl Language { } // (* v0.4.11 *) - // «ContractBodyElement» = UsingDirective - // | FunctionDefinition - // | UnnamedFunctionDefinition - // | ModifierDefinition - // | StructDefinition - // | EnumDefinition - // | EventDefinition - // | ErrorDefinition - // | StateVariableDeclaration; + // ContractDefinition = CONTRACT_KEYWORD IDENTIFIER InheritanceSpecifier? OPEN_BRACE ContractMembersList? CLOSE_BRACE; #[allow(dead_code, non_snake_case)] - fn contract_body_element__0_4_11(&self, stream: &mut Stream) -> ParserResult { + fn contract_definition__0_4_11(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); + let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if running_result.incorporate_choice_result(self.using_directive(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.function_definition(stream)) { - break; - } - stream.set_position(start_position); - if running_result - .incorporate_choice_result(self.unnamed_function_definition(stream)) - { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.modifier_definition(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.struct_definition(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.enum_definition(stream)) { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::contract_keyword, + TokenKind::ContractKeyword, + )) { break; } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.event_definition(stream)) { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )) { break; } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.error_definition(stream)) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.inheritance_specifier(stream), + )) { break; } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.state_variable_declaration(stream)); + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::open_brace, + TokenKind::OpenBrace, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.contract_members_list(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_brace, + TokenKind::CloseBrace, + )); + break; + } + running_result + }); break; } running_result } + .with_kind(RuleKind::ContractDefinition) } - // (* v0.4.22 *) - // «ContractBodyElement» = UsingDirective - // | ConstructorDefinition - // | FunctionDefinition - // | UnnamedFunctionDefinition - // | ModifierDefinition - // | StructDefinition - // | EnumDefinition - // | EventDefinition - // | ErrorDefinition - // | StateVariableDeclaration; + // (* v0.6.0 *) + // ContractDefinition = ABSTRACT_KEYWORD? CONTRACT_KEYWORD IDENTIFIER InheritanceSpecifier? OPEN_BRACE ContractMembersList? CLOSE_BRACE; #[allow(dead_code, non_snake_case)] - fn contract_body_element__0_4_22(&self, stream: &mut Stream) -> ParserResult { + fn contract_definition__0_6_0(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(transform_option_result( + self.parse_token_with_trivia( + stream, + &Self::abstract_keyword, + TokenKind::AbstractKeyword, + ), + )) { + break; + } + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::contract_keyword, + TokenKind::ContractKeyword, + )) { + break; + } + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.inheritance_specifier(stream), + )) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::open_brace, + TokenKind::OpenBrace, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.contract_members_list(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_brace, + TokenKind::CloseBrace, + )); + break; + } + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::ContractDefinition) + } + + pub(crate) fn contract_definition(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_6_0 { + self.contract_definition__0_6_0(stream) + } else { + self.contract_definition__0_4_11(stream) + } + } + + // (* v0.4.11 *) + // «ContractMember» = UsingDirective + // | FunctionDefinition + // | UnnamedFunctionDefinition + // | ModifierDefinition + // | StructDefinition + // | EnumDefinition + // | EventDefinition + // | ErrorDefinition + // | StateVariableDefinition; + + #[allow(dead_code, non_snake_case)] + fn contract_member__0_4_11(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result(self.using_directive(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.function_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result + .incorporate_choice_result(self.unnamed_function_definition(stream)) + { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.modifier_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.struct_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.enum_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.event_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.error_definition(stream)) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.state_variable_definition(stream)); + break; + } + running_result + } + } + + // (* v0.4.22 *) + // «ContractMember» = UsingDirective + // | ConstructorDefinition + // | FunctionDefinition + // | UnnamedFunctionDefinition + // | ModifierDefinition + // | StructDefinition + // | EnumDefinition + // | EventDefinition + // | ErrorDefinition + // | StateVariableDefinition; + + #[allow(dead_code, non_snake_case)] + fn contract_member__0_4_22(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { if running_result.incorporate_choice_result(self.using_directive(stream)) { break; @@ -1092,7 +1295,7 @@ impl Language { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.state_variable_declaration(stream)); + running_result.incorporate_choice_result(self.state_variable_definition(stream)); break; } running_result @@ -1100,20 +1303,20 @@ impl Language { } // (* v0.6.0 *) - // «ContractBodyElement» = UsingDirective - // | ConstructorDefinition - // | FunctionDefinition - // | FallbackFunctionDefinition - // | ReceiveFunctionDefinition - // | ModifierDefinition - // | StructDefinition - // | EnumDefinition - // | EventDefinition - // | ErrorDefinition - // | StateVariableDeclaration; + // «ContractMember» = UsingDirective + // | ConstructorDefinition + // | FunctionDefinition + // | FallbackFunctionDefinition + // | ReceiveFunctionDefinition + // | ModifierDefinition + // | StructDefinition + // | EnumDefinition + // | EventDefinition + // | ErrorDefinition + // | StateVariableDefinition; #[allow(dead_code, non_snake_case)] - fn contract_body_element__0_6_0(&self, stream: &mut Stream) -> ParserResult { + fn contract_member__0_6_0(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); @@ -1162,7 +1365,7 @@ impl Language { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.state_variable_declaration(stream)); + running_result.incorporate_choice_result(self.state_variable_definition(stream)); break; } running_result @@ -1170,21 +1373,21 @@ impl Language { } // (* v0.8.8 *) - // «ContractBodyElement» = UsingDirective - // | ConstructorDefinition - // | FunctionDefinition - // | FallbackFunctionDefinition - // | ReceiveFunctionDefinition - // | ModifierDefinition - // | StructDefinition - // | EnumDefinition - // | UserDefinedValueTypeDefinition - // | EventDefinition - // | ErrorDefinition - // | StateVariableDeclaration; + // «ContractMember» = UsingDirective + // | ConstructorDefinition + // | FunctionDefinition + // | FallbackFunctionDefinition + // | ReceiveFunctionDefinition + // | ModifierDefinition + // | StructDefinition + // | EnumDefinition + // | EventDefinition + // | ErrorDefinition + // | StateVariableDefinition + // | UserDefinedValueTypeDefinition; #[allow(dead_code, non_snake_case)] - fn contract_body_element__0_8_8(&self, stream: &mut Stream) -> ParserResult { + fn contract_member__0_8_8(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); @@ -1225,453 +1428,397 @@ impl Language { break; } stream.set_position(start_position); - if running_result - .incorporate_choice_result(self.user_defined_value_type_definition(stream)) - { + if running_result.incorporate_choice_result(self.event_definition(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.event_definition(stream)) { + if running_result.incorporate_choice_result(self.error_definition(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.error_definition(stream)) { + if running_result.incorporate_choice_result(self.state_variable_definition(stream)) + { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.state_variable_declaration(stream)); + running_result + .incorporate_choice_result(self.user_defined_value_type_definition(stream)); break; } running_result } } - pub(crate) fn contract_body_element(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn contract_member(&self, stream: &mut Stream) -> ParserResult { if self.version_is_equal_to_or_greater_than_0_8_8 { - self.contract_body_element__0_8_8(stream) + self.contract_member__0_8_8(stream) } else if self.version_is_equal_to_or_greater_than_0_6_0 { - self.contract_body_element__0_6_0(stream) + self.contract_member__0_6_0(stream) } else if self.version_is_equal_to_or_greater_than_0_4_22 { - self.contract_body_element__0_4_22(stream) + self.contract_member__0_4_22(stream) } else { - self.contract_body_element__0_4_11(stream) + self.contract_member__0_4_11(stream) + } + } + + // ContractMembersList = «ContractMember»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn contract_members_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.contract_member(stream)) {} + running_result } + .with_kind(RuleKind::ContractMembersList) } // (* v0.4.11 *) - // ContractDefinition = CONTRACT_KEYWORD IDENTIFIER InheritanceSpecifierList? OPEN_BRACE ContractBodyElements CLOSE_BRACE; - // ContractBodyElements = «ContractBodyElement»*; + // «ControlStatement» = IfStatement + // | ForStatement + // | WhileStatement + // | DoWhileStatement + // | ContinueStatement + // | BreakStatement + // | DeleteStatement + // | ReturnStatement + // | RevertStatement + // | ThrowStatement; #[allow(dead_code, non_snake_case)] - fn contract_definition__0_4_11(&self, stream: &mut Stream) -> ParserResult { + fn control_statement__0_4_11(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::r#match(vec![], vec![]); + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::contract_keyword, - TokenKind::ContractKeyword, - )) { + if running_result.incorporate_choice_result(self.if_statement(stream)) { break; } - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - )) { + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.for_statement(stream)) { break; } - if !running_result.incorporate_sequence_result(transform_option_result( - self.inheritance_specifier_list(stream), - )) { + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.while_statement(stream)) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_brace, - TokenKind::OpenBrace, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.contract_body_element(stream)) - { - } - running_result.with_kind(RuleKind::ContractBodyElements) - }) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_brace, - TokenKind::CloseBrace, - )); - break; - } - running_result - }); + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.do_while_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.continue_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.break_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.delete_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.return_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.revert_statement(stream)) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.throw_statement(stream)); break; } running_result } - .with_kind(RuleKind::ContractDefinition) } - // (* v0.6.0 *) - // ContractDefinition = ABSTRACT_KEYWORD? CONTRACT_KEYWORD IDENTIFIER InheritanceSpecifierList? OPEN_BRACE ContractBodyElements CLOSE_BRACE; - // ContractBodyElements = «ContractBodyElement»*; + // (* v0.4.21 *) + // «ControlStatement» = IfStatement + // | ForStatement + // | WhileStatement + // | DoWhileStatement + // | ContinueStatement + // | BreakStatement + // | DeleteStatement + // | ReturnStatement + // | RevertStatement + // | ThrowStatement + // | EmitStatement; #[allow(dead_code, non_snake_case)] - fn contract_definition__0_6_0(&self, stream: &mut Stream) -> ParserResult { + fn control_statement__0_4_21(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::r#match(vec![], vec![]); + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { - if !running_result.incorporate_sequence_result(transform_option_result( - self.parse_token_with_trivia( - stream, - &Self::abstract_keyword, - TokenKind::AbstractKeyword, - ), - )) { + if running_result.incorporate_choice_result(self.if_statement(stream)) { break; } - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::contract_keyword, - TokenKind::ContractKeyword, - )) { + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.for_statement(stream)) { break; } - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - )) { + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.while_statement(stream)) { break; } - if !running_result.incorporate_sequence_result(transform_option_result( - self.inheritance_specifier_list(stream), - )) { + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.do_while_statement(stream)) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_brace, - TokenKind::OpenBrace, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.contract_body_element(stream)) - { - } - running_result.with_kind(RuleKind::ContractBodyElements) - }) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_brace, - TokenKind::CloseBrace, - )); - break; - } - running_result - }); - break; - } - running_result - } - .with_kind(RuleKind::ContractDefinition) - } - - pub(crate) fn contract_definition(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_6_0 { - self.contract_definition__0_6_0(stream) - } else { - self.contract_definition__0_4_11(stream) - } - } - - // (* v0.4.11 *) - // DataLocation = MEMORY_KEYWORD | STORAGE_KEYWORD; - - #[allow(dead_code, non_snake_case)] - fn data_location__0_4_11(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::memory_keyword, - TokenKind::MemoryKeyword, - )) { + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.continue_statement(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::storage_keyword, - TokenKind::StorageKeyword, - )); + if running_result.incorporate_choice_result(self.break_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.delete_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.return_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.revert_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.throw_statement(stream)) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.emit_statement(stream)); break; } running_result } - .with_kind(RuleKind::DataLocation) } // (* v0.5.0 *) - // DataLocation = MEMORY_KEYWORD - // | STORAGE_KEYWORD - // | CALLDATA_KEYWORD; + // «ControlStatement» = IfStatement + // | ForStatement + // | WhileStatement + // | DoWhileStatement + // | ContinueStatement + // | BreakStatement + // | DeleteStatement + // | ReturnStatement + // | RevertStatement + // | EmitStatement; #[allow(dead_code, non_snake_case)] - fn data_location__0_5_0(&self, stream: &mut Stream) -> ParserResult { + fn control_statement__0_5_0(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::memory_keyword, - TokenKind::MemoryKeyword, - )) { + if running_result.incorporate_choice_result(self.if_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::storage_keyword, - TokenKind::StorageKeyword, - )) { + if running_result.incorporate_choice_result(self.for_statement(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::calldata_keyword, - TokenKind::CalldataKeyword, - )); - break; - } - running_result - } - .with_kind(RuleKind::DataLocation) - } - - pub(crate) fn data_location(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_5_0 { - self.data_location__0_5_0(stream) - } else { - self.data_location__0_4_11(stream) - } - } - - // (* v0.4.11 *) - // Definition = ConstantDefinition - // | ContractDefinition - // | EnumDefinition - // | ErrorDefinition - // | FunctionDefinition - // | InterfaceDefinition - // | LibraryDefinition - // | StructDefinition; - - #[allow(dead_code, non_snake_case)] - fn definition__0_4_11(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result(self.constant_definition(stream)) { + if running_result.incorporate_choice_result(self.while_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.contract_definition(stream)) { + if running_result.incorporate_choice_result(self.do_while_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.enum_definition(stream)) { + if running_result.incorporate_choice_result(self.continue_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.error_definition(stream)) { + if running_result.incorporate_choice_result(self.break_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.function_definition(stream)) { + if running_result.incorporate_choice_result(self.delete_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.interface_definition(stream)) { + if running_result.incorporate_choice_result(self.return_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.library_definition(stream)) { + if running_result.incorporate_choice_result(self.revert_statement(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.struct_definition(stream)); + running_result.incorporate_choice_result(self.emit_statement(stream)); break; } running_result } - .with_kind(RuleKind::Definition) } - // (* v0.8.8 *) - // Definition = ConstantDefinition - // | ContractDefinition - // | EnumDefinition - // | ErrorDefinition - // | FunctionDefinition - // | InterfaceDefinition - // | LibraryDefinition - // | StructDefinition - // | UserDefinedValueTypeDefinition; + // (* v0.6.0 *) + // «ControlStatement» = IfStatement + // | ForStatement + // | WhileStatement + // | DoWhileStatement + // | ContinueStatement + // | BreakStatement + // | DeleteStatement + // | ReturnStatement + // | RevertStatement + // | EmitStatement + // | TryStatement; #[allow(dead_code, non_snake_case)] - fn definition__0_8_8(&self, stream: &mut Stream) -> ParserResult { + fn control_statement__0_6_0(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result(self.constant_definition(stream)) { + if running_result.incorporate_choice_result(self.if_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.contract_definition(stream)) { + if running_result.incorporate_choice_result(self.for_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.enum_definition(stream)) { + if running_result.incorporate_choice_result(self.while_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.error_definition(stream)) { + if running_result.incorporate_choice_result(self.do_while_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.function_definition(stream)) { + if running_result.incorporate_choice_result(self.continue_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.interface_definition(stream)) { + if running_result.incorporate_choice_result(self.break_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.library_definition(stream)) { + if running_result.incorporate_choice_result(self.delete_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.struct_definition(stream)) { + if running_result.incorporate_choice_result(self.return_statement(stream)) { break; } stream.set_position(start_position); - running_result - .incorporate_choice_result(self.user_defined_value_type_definition(stream)); + if running_result.incorporate_choice_result(self.revert_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.emit_statement(stream)) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.try_statement(stream)); break; } running_result } - .with_kind(RuleKind::Definition) } - pub(crate) fn definition(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_8_8 { - self.definition__0_8_8(stream) + pub(crate) fn control_statement(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_6_0 { + self.control_statement__0_6_0(stream) + } else if self.version_is_equal_to_or_greater_than_0_5_0 { + self.control_statement__0_5_0(stream) + } else if self.version_is_equal_to_or_greater_than_0_4_21 { + self.control_statement__0_4_21(stream) } else { - self.definition__0_4_11(stream) + self.control_statement__0_4_11(stream) } } - // DeleteStatement = DELETE_KEYWORD Expression SEMICOLON; + // (* v0.4.11 *) + // «DataLocation» = MEMORY_KEYWORD | STORAGE_KEYWORD; - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn delete_statement(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code, non_snake_case)] + fn data_location__0_4_11(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::r#match(vec![], vec![]); + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::delete_keyword, - TokenKind::DeleteKeyword, - ), - ) { - break; - } - running_result.incorporate_sequence_result(self.expression(stream)); - break; - } - running_result - }) { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::memory_keyword, + TokenKind::MemoryKeyword, + )) { break; } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream.set_position(start_position); + running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::semicolon, - TokenKind::Semicolon, + &Self::storage_keyword, + TokenKind::StorageKeyword, )); break; } running_result } - .with_kind(RuleKind::DeleteStatement) } - // Directive = PragmaDirective - // | ImportDirective - // | UsingDirective; + // (* v0.5.0 *) + // «DataLocation» = MEMORY_KEYWORD + // | STORAGE_KEYWORD + // | CALLDATA_KEYWORD; - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn directive(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code, non_snake_case)] + fn data_location__0_5_0(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result(self.pragma_directive(stream)) { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::memory_keyword, + TokenKind::MemoryKeyword, + )) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.import_directive(stream)) { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::storage_keyword, + TokenKind::StorageKeyword, + )) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.using_directive(stream)); + running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::calldata_keyword, + TokenKind::CalldataKeyword, + )); break; } running_result } - .with_kind(RuleKind::Directive) } - // DoWhileStatement = DO_KEYWORD Statement WHILE_KEYWORD OPEN_PAREN Expression CLOSE_PAREN SEMICOLON; + pub(crate) fn data_location(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_5_0 { + self.data_location__0_5_0(stream) + } else { + self.data_location__0_4_11(stream) + } + } + + // DeconstructionImport = OPEN_BRACE DeconstructionImportSymbolsList CLOSE_BRACE FROM_KEYWORD ASCII_STRING_LITERAL; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn do_while_statement(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn deconstruction_import(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -1681,36 +1828,216 @@ impl Language { if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::do_keyword, - TokenKind::DoKeyword, + &Self::open_brace, + TokenKind::OpenBrace, ), ) { break; } - if !running_result.incorporate_sequence_result(self.statement(stream)) { - break; - } if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::while_keyword, - TokenKind::WhileKeyword, - ), + self.deconstruction_import_symbols_list(stream), ) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_paren, - TokenKind::OpenParen, - ), - ) { - break; - } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_brace, + TokenKind::CloseBrace, + )); + break; + } + running_result + }) { + break; + } + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::from_keyword, + TokenKind::FromKeyword, + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, + )); + break; + } + running_result + } + .with_kind(RuleKind::DeconstructionImport) + } + + // DeconstructionImportSymbol = IDENTIFIER (AS_KEYWORD IDENTIFIER)?; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn deconstruction_import_symbol(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )) { + break; + } + running_result.incorporate_sequence_result(transform_option_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::as_keyword, + TokenKind::AsKeyword, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )); + break; + } + running_result + })); + break; + } + running_result + } + .with_kind(RuleKind::DeconstructionImportSymbol) + } + + // DeconstructionImportSymbolsList = DeconstructionImportSymbol (COMMA DeconstructionImportSymbol)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn deconstruction_import_symbols_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result + .incorporate_sequence_result(self.deconstruction_import_symbol(stream)) + { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result( + self.deconstruction_import_symbol(stream), + ); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::DeconstructionImportSymbolsList) + } + + // DeleteStatement = DELETE_KEYWORD Expression SEMICOLON; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn delete_statement(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::delete_keyword, + TokenKind::DeleteKeyword, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.expression(stream)); + break; + } + running_result + }) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::semicolon, + TokenKind::Semicolon, + )); + break; + } + running_result + } + .with_kind(RuleKind::DeleteStatement) + } + + // DoWhileStatement = DO_KEYWORD Statement WHILE_KEYWORD OPEN_PAREN Expression CLOSE_PAREN SEMICOLON; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn do_while_statement(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::do_keyword, + TokenKind::DoKeyword, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result(self.statement(stream)) { + break; + } + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::while_keyword, + TokenKind::WhileKeyword, + ), + ) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::open_paren, + TokenKind::OpenParen, + ), + ) { + break; + } if !running_result .incorporate_sequence_result(self.expression(stream)) { @@ -1746,16 +2073,15 @@ impl Language { } // (* v0.4.11 *) - // ElementaryType = BOOL_KEYWORD - // | STRING_KEYWORD - // | AddressType - // | PayableType - // | BYTE_TYPE - // | FIXED_BYTES_TYPE - // | SIGNED_INTEGER_TYPE - // | UNSIGNED_INTEGER_TYPE - // | SIGNED_FIXED_TYPE - // | UNSIGNED_FIXED_TYPE; + // «ElementaryType» = BOOL_KEYWORD + // | BYTE_KEYWORD + // | STRING_KEYWORD + // | AddressType + // | FIXED_BYTES_TYPE + // | SIGNED_INTEGER_TYPE + // | UNSIGNED_INTEGER_TYPE + // | SIGNED_FIXED_TYPE + // | UNSIGNED_FIXED_TYPE; #[allow(dead_code, non_snake_case)] fn elementary_type__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -1773,28 +2099,24 @@ impl Language { stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::string_keyword, - TokenKind::StringKeyword, + &Self::byte_keyword, + TokenKind::ByteKeyword, )) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.address_type(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.payable_type(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::byte_type, - TokenKind::ByteType, + &Self::string_keyword, + TokenKind::StringKeyword, )) { break; } stream.set_position(start_position); + if running_result.incorporate_choice_result(self.address_type(stream)) { + break; + } + stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::fixed_bytes_type, @@ -1836,19 +2158,17 @@ impl Language { } running_result } - .with_kind(RuleKind::ElementaryType) } // (* v0.8.0 *) - // ElementaryType = BOOL_KEYWORD - // | STRING_KEYWORD - // | AddressType - // | PayableType - // | FIXED_BYTES_TYPE - // | SIGNED_INTEGER_TYPE - // | UNSIGNED_INTEGER_TYPE - // | SIGNED_FIXED_TYPE - // | UNSIGNED_FIXED_TYPE; + // «ElementaryType» = BOOL_KEYWORD + // | STRING_KEYWORD + // | AddressType + // | FIXED_BYTES_TYPE + // | SIGNED_INTEGER_TYPE + // | UNSIGNED_INTEGER_TYPE + // | SIGNED_FIXED_TYPE + // | UNSIGNED_FIXED_TYPE; #[allow(dead_code, non_snake_case)] fn elementary_type__0_8_0(&self, stream: &mut Stream) -> ParserResult { @@ -1876,10 +2196,6 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.payable_type(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::fixed_bytes_type, @@ -1921,7 +2237,6 @@ impl Language { } running_result } - .with_kind(RuleKind::ElementaryType) } pub(crate) fn elementary_type(&self, stream: &mut Stream) -> ParserResult { @@ -1933,7 +2248,7 @@ impl Language { } // (* v0.4.21 *) - // EmitStatement = EMIT_KEYWORD IdentifierPath ArgumentList SEMICOLON; + // EmitStatement = EMIT_KEYWORD IdentifierPath ArgumentsDeclaration SEMICOLON; #[allow(dead_code, non_snake_case)] fn emit_statement__0_4_21(&self, stream: &mut Stream) -> ParserResult { @@ -1956,7 +2271,8 @@ impl Language { { break; } - running_result.incorporate_sequence_result(self.argument_list(stream)); + running_result + .incorporate_sequence_result(self.arguments_declaration(stream)); break; } running_result @@ -2042,7 +2358,7 @@ impl Language { .with_kind(RuleKind::EndOfFileTrivia) } - // EnumDefinition = ENUM_KEYWORD IDENTIFIER OPEN_BRACE (IDENTIFIER (COMMA IDENTIFIER)*)? CLOSE_BRACE; + // EnumDefinition = ENUM_KEYWORD IDENTIFIER OPEN_BRACE IdentifiersList? CLOSE_BRACE; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2076,50 +2392,9 @@ impl Language { ) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.identifiers_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -2138,7 +2413,7 @@ impl Language { .with_kind(RuleKind::EnumDefinition) } - // EqualityComparisonOperator = EQUAL_EQUAL | BANG_EQUAL; + // «EqualityComparisonOperator» = EQUAL_EQUAL | BANG_EQUAL; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2164,10 +2439,9 @@ impl Language { } running_result } - .with_kind(RuleKind::EqualityComparisonOperator) } - // ErrorDefinition = ERROR_KEYWORD IDENTIFIER OPEN_PAREN (ErrorParameter (COMMA ErrorParameter)*)? CLOSE_PAREN SEMICOLON; + // ErrorDefinition = ERROR_KEYWORD IDENTIFIER OPEN_PAREN ErrorParametersList? CLOSE_PAREN SEMICOLON; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2209,50 +2483,7 @@ impl Language { break; } if !running_result.incorporate_sequence_result( - transform_option_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.error_parameter(stream), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) - { - break; - } - running_result - .incorporate_sequence_result( - self.error_parameter(stream), - ); - break; - } - running_result - }) - { - } - running_result - }); - break; - } - running_result - }), + transform_option_result(self.error_parameters_list(stream)), ) { break; } @@ -2306,15 +2537,55 @@ impl Language { .with_kind(RuleKind::ErrorParameter) } - // EventDefinition = EVENT_KEYWORD IDENTIFIER OPEN_PAREN (EventParameter (COMMA EventParameter)*)? CLOSE_PAREN ANONYMOUS_KEYWORD? SEMICOLON; + // ErrorParametersList = ErrorParameter (COMMA ErrorParameter)*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn event_definition(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn error_parameters_list(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result({ + if !running_result.incorporate_sequence_result(self.error_parameter(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result + .incorporate_sequence_result(self.error_parameter(stream)); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::ErrorParametersList) + } + + // EventDefinition = EVENT_KEYWORD IDENTIFIER OPEN_PAREN EventParametersList? CLOSE_PAREN ANONYMOUS_KEYWORD? SEMICOLON; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn event_definition(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); loop { if !running_result.incorporate_sequence_result( @@ -2348,50 +2619,7 @@ impl Language { break; } if !running_result.incorporate_sequence_result( - transform_option_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.event_parameter(stream), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) - { - break; - } - running_result - .incorporate_sequence_result( - self.event_parameter(stream), - ); - break; - } - running_result - }) - { - } - running_result - }); - break; - } - running_result - }), + transform_option_result(self.event_parameters_list(stream)), ) { break; } @@ -2463,6 +2691,46 @@ impl Language { .with_kind(RuleKind::EventParameter) } + // EventParametersList = EventParameter (COMMA EventParameter)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn event_parameters_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.event_parameter(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result + .incorporate_sequence_result(self.event_parameter(stream)); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::EventParametersList) + } + // ExperimentalPragma = EXPERIMENTAL_KEYWORD IDENTIFIER; #[allow(dead_code)] @@ -2490,7 +2758,7 @@ impl Language { .with_kind(RuleKind::ExperimentalPragma) } - // ExponentiationOperator = ASTERISK_ASTERISK; + // «ExponentiationOperator» = ASTERISK_ASTERISK; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2500,47 +2768,35 @@ impl Language { &Self::asterisk_asterisk, TokenKind::AsteriskAsterisk, ) - .with_kind(RuleKind::ExponentiationOperator) } // (* v0.4.11 *) - // Expression = AssignmentExpression + // Expression = BinaryExpression // | ConditionalExpression - // | OrExpression - // | AndExpression - // | EqualityComparisonExpression - // | OrderComparisonExpression - // | BitOrExpression - // | BitXOrExpression - // | BitAndExpression - // | ShiftExpression - // | AddSubExpression - // | MulDivModExpression - // | ExponentiationExpression // | UnaryPostfixExpression // | UnaryPrefixExpression // | FunctionCallExpression // | MemberAccessExpression // | IndexAccessExpression - // | PrimaryExpression; - // AssignmentExpression = Expression AssignmentOperator Expression; - // ConditionalExpression = Expression ConditionalOperator; - // OrExpression = Expression OrOperator Expression; - // AndExpression = Expression AndOperator Expression; - // EqualityComparisonExpression = Expression EqualityComparisonOperator Expression; - // OrderComparisonExpression = Expression OrderComparisonOperator Expression; - // BitOrExpression = Expression BitOrOperator Expression; - // BitXOrExpression = Expression BitXOrOperator Expression; - // BitAndExpression = Expression BitAndOperator Expression; - // ShiftExpression = Expression ShiftOperator Expression; - // AddSubExpression = Expression AddSubOperator Expression; - // MulDivModExpression = Expression MulDivModOperator Expression; - // ExponentiationExpression = Expression ExponentiationOperator Expression; - // UnaryPostfixExpression = Expression UnaryPostfixOperator; - // UnaryPrefixExpression = UnaryPrefixOperator Expression; - // FunctionCallExpression = Expression FunctionCallOperator; - // MemberAccessExpression = Expression MemberAccessOperator; - // IndexAccessExpression = Expression IndexAccessOperator; + // | «PrimaryExpression»; + // BinaryExpression = Expression «AssignmentOperator» Expression; + // ConditionalExpression = Expression «ConditionalOperator»; + // BinaryExpression = Expression «OrOperator» Expression; + // BinaryExpression = Expression «AndOperator» Expression; + // BinaryExpression = Expression «EqualityComparisonOperator» Expression; + // BinaryExpression = Expression «OrderComparisonOperator» Expression; + // BinaryExpression = Expression «BitwiseOrOperator» Expression; + // BinaryExpression = Expression «BitwiseXOrOperator» Expression; + // BinaryExpression = Expression «BitwiseAndOperator» Expression; + // BinaryExpression = Expression «ShiftOperator» Expression; + // BinaryExpression = Expression «AddSubOperator» Expression; + // BinaryExpression = Expression «MulDivModOperator» Expression; + // BinaryExpression = Expression «ExponentiationOperator» Expression; + // UnaryPostfixExpression = Expression «UnaryPostfixOperator»; + // UnaryPrefixExpression = «UnaryPrefixOperator» Expression; + // FunctionCallExpression = Expression «FunctionCallOperator»; + // MemberAccessExpression = Expression «MemberAccessOperator»; + // IndexAccessExpression = Expression «IndexAccessOperator»; #[allow(dead_code, non_snake_case)] fn expression__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -2642,173 +2898,152 @@ impl Language { break result; } } - let result = loop { - let start_position = stream.position(); - stream.set_position(start_position); - let next_result = self.assignment_operator(stream).to_pratt_element_operator( - RuleKind::AssignmentExpression, - 1u8, - 1u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.or_operator(stream).to_pratt_element_operator( - RuleKind::OrExpression, - 5u8, - 5u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.and_operator(stream).to_pratt_element_operator( - RuleKind::AndExpression, - 7u8, - 7u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self - .equality_comparison_operator(stream) - .to_pratt_element_operator( - RuleKind::EqualityComparisonExpression, - 9u8, - 9u8 + 1, + let result = + loop { + let start_position = stream.position(); + stream.set_position(start_position); + let next_result = self + .assignment_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 1u8, 1u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.or_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 5u8, + 5u8 + 1, ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self - .order_comparison_operator(stream) - .to_pratt_element_operator( - RuleKind::OrderComparisonExpression, - 11u8, - 11u8 + 1, + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.and_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 7u8, + 7u8 + 1, ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.bit_or_operator(stream).to_pratt_element_operator( - RuleKind::BitOrExpression, - 13u8, - 13u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.bit_x_or_operator(stream).to_pratt_element_operator( - RuleKind::BitXOrExpression, - 15u8, - 15u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.bit_and_operator(stream).to_pratt_element_operator( - RuleKind::BitAndExpression, - 17u8, - 17u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.shift_operator(stream).to_pratt_element_operator( - RuleKind::ShiftExpression, - 19u8, - 19u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.add_sub_operator(stream).to_pratt_element_operator( - RuleKind::AddSubExpression, - 21u8, - 21u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.mul_div_mod_operator(stream).to_pratt_element_operator( - RuleKind::MulDivModExpression, - 23u8, - 23u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self - .exponentiation_operator(stream) - .to_pratt_element_operator( - RuleKind::ExponentiationExpression, - 25u8, - 25u8 + 1, + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .equality_comparison_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 9u8, 9u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .order_comparison_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 11u8, 11u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .bitwise_or_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 13u8, 13u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .bitwise_x_or_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 15u8, 15u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .bitwise_and_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 17u8, 17u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.shift_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 19u8, + 19u8 + 1, ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - break ParserResult::no_match(vec![]); - }; + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.add_sub_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 21u8, + 21u8 + 1, + ); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .mul_div_mod_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 23u8, 23u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .exponentiation_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 25u8, 25u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + break ParserResult::no_match(vec![]); + }; match result { ParserResult::PrattOperatorMatch(_) => elements.push(result), _ => break result, @@ -2844,43 +3079,32 @@ impl Language { } // (* v0.6.0 *) - // Expression = AssignmentExpression + // Expression = BinaryExpression // | ConditionalExpression - // | OrExpression - // | AndExpression - // | EqualityComparisonExpression - // | OrderComparisonExpression - // | BitOrExpression - // | BitXOrExpression - // | BitAndExpression - // | ShiftExpression - // | AddSubExpression - // | MulDivModExpression - // | ExponentiationExpression // | UnaryPostfixExpression // | UnaryPrefixExpression // | FunctionCallExpression // | MemberAccessExpression // | IndexAccessExpression - // | PrimaryExpression; - // AssignmentExpression = Expression AssignmentOperator Expression; - // ConditionalExpression = Expression ConditionalOperator; - // OrExpression = Expression OrOperator Expression; - // AndExpression = Expression AndOperator Expression; - // EqualityComparisonExpression = Expression EqualityComparisonOperator Expression; - // OrderComparisonExpression = Expression OrderComparisonOperator Expression; - // BitOrExpression = Expression BitOrOperator Expression; - // BitXOrExpression = Expression BitXOrOperator Expression; - // BitAndExpression = Expression BitAndOperator Expression; - // ShiftExpression = Expression ShiftOperator Expression; - // AddSubExpression = Expression AddSubOperator Expression; - // MulDivModExpression = Expression MulDivModOperator Expression; - // ExponentiationExpression = Expression ExponentiationOperator Expression; (* Right Associative *) - // UnaryPostfixExpression = Expression UnaryPostfixOperator; - // UnaryPrefixExpression = UnaryPrefixOperator Expression; - // FunctionCallExpression = Expression FunctionCallOperator; - // MemberAccessExpression = Expression MemberAccessOperator; - // IndexAccessExpression = Expression IndexAccessOperator; + // | «PrimaryExpression»; + // BinaryExpression = Expression «AssignmentOperator» Expression; + // ConditionalExpression = Expression «ConditionalOperator»; + // BinaryExpression = Expression «OrOperator» Expression; + // BinaryExpression = Expression «AndOperator» Expression; + // BinaryExpression = Expression «EqualityComparisonOperator» Expression; + // BinaryExpression = Expression «OrderComparisonOperator» Expression; + // BinaryExpression = Expression «BitwiseOrOperator» Expression; + // BinaryExpression = Expression «BitwiseXOrOperator» Expression; + // BinaryExpression = Expression «BitwiseAndOperator» Expression; + // BinaryExpression = Expression «ShiftOperator» Expression; + // BinaryExpression = Expression «AddSubOperator» Expression; + // BinaryExpression = Expression «MulDivModOperator» Expression; + // BinaryExpression = Expression «ExponentiationOperator» Expression; (* Right Associative *) + // UnaryPostfixExpression = Expression «UnaryPostfixOperator»; + // UnaryPrefixExpression = «UnaryPrefixOperator» Expression; + // FunctionCallExpression = Expression «FunctionCallOperator»; + // MemberAccessExpression = Expression «MemberAccessOperator»; + // IndexAccessExpression = Expression «IndexAccessOperator»; #[allow(dead_code, non_snake_case)] fn expression__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -2948,8 +3172,165 @@ impl Language { } stream.set_position(start_position); let next_result = self - .member_access_operator(stream) - .to_pratt_element_operator(RuleKind::MemberAccessExpression, 33u8, 255); + .member_access_operator(stream) + .to_pratt_element_operator(RuleKind::MemberAccessExpression, 33u8, 255); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .index_access_operator(stream) + .to_pratt_element_operator(RuleKind::IndexAccessExpression, 35u8, 255); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + break ParserResult::no_match(vec![]); + }; + match result { + ParserResult::PrattOperatorMatch(_) => elements.push(result), + _ => break result, + } + }; + match result { + ParserResult::NoMatch(_) => {} + _ => { + break result; + } + } + let result = + loop { + let start_position = stream.position(); + stream.set_position(start_position); + let next_result = self + .assignment_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 1u8, 1u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.or_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 5u8, + 5u8 + 1, + ); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.and_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 7u8, + 7u8 + 1, + ); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .equality_comparison_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 9u8, 9u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .order_comparison_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 11u8, 11u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .bitwise_or_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 13u8, 13u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .bitwise_x_or_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 15u8, 15u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .bitwise_and_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 17u8, 17u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.shift_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 19u8, + 19u8 + 1, + ); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.add_sub_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 21u8, + 21u8 + 1, + ); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .mul_div_mod_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 23u8, 23u8 + 1); match next_result { ParserResult::PrattOperatorMatch(_) => break next_result, ParserResult::Match(_) => unreachable!( @@ -2959,8 +3340,8 @@ impl Language { } stream.set_position(start_position); let next_result = self - .index_access_operator(stream) - .to_pratt_element_operator(RuleKind::IndexAccessExpression, 35u8, 255); + .exponentiation_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 25u8 + 1, 25u8); match next_result { ParserResult::PrattOperatorMatch(_) => break next_result, ParserResult::Match(_) => unreachable!( @@ -2971,184 +3352,6 @@ impl Language { stream.set_position(start_position); break ParserResult::no_match(vec![]); }; - match result { - ParserResult::PrattOperatorMatch(_) => elements.push(result), - _ => break result, - } - }; - match result { - ParserResult::NoMatch(_) => {} - _ => { - break result; - } - } - let result = loop { - let start_position = stream.position(); - stream.set_position(start_position); - let next_result = self.assignment_operator(stream).to_pratt_element_operator( - RuleKind::AssignmentExpression, - 1u8, - 1u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.or_operator(stream).to_pratt_element_operator( - RuleKind::OrExpression, - 5u8, - 5u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.and_operator(stream).to_pratt_element_operator( - RuleKind::AndExpression, - 7u8, - 7u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self - .equality_comparison_operator(stream) - .to_pratt_element_operator( - RuleKind::EqualityComparisonExpression, - 9u8, - 9u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self - .order_comparison_operator(stream) - .to_pratt_element_operator( - RuleKind::OrderComparisonExpression, - 11u8, - 11u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.bit_or_operator(stream).to_pratt_element_operator( - RuleKind::BitOrExpression, - 13u8, - 13u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.bit_x_or_operator(stream).to_pratt_element_operator( - RuleKind::BitXOrExpression, - 15u8, - 15u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.bit_and_operator(stream).to_pratt_element_operator( - RuleKind::BitAndExpression, - 17u8, - 17u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.shift_operator(stream).to_pratt_element_operator( - RuleKind::ShiftExpression, - 19u8, - 19u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.add_sub_operator(stream).to_pratt_element_operator( - RuleKind::AddSubExpression, - 21u8, - 21u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.mul_div_mod_operator(stream).to_pratt_element_operator( - RuleKind::MulDivModExpression, - 23u8, - 23u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self - .exponentiation_operator(stream) - .to_pratt_element_operator( - RuleKind::ExponentiationExpression, - 25u8 + 1, - 25u8, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - break ParserResult::no_match(vec![]); - }; match result { ParserResult::PrattOperatorMatch(_) => elements.push(result), _ => break result, @@ -3215,13 +3418,13 @@ impl Language { } // (* v0.6.0 *) - // FallbackFunctionAttribute = ModifierInvocation - // | OverrideSpecifier - // | EXTERNAL_KEYWORD - // | PAYABLE_KEYWORD - // | PURE_KEYWORD - // | VIEW_KEYWORD - // | VIRTUAL_KEYWORD; + // «FallbackFunctionAttribute» = ModifierInvocation + // | OverrideSpecifier + // | EXTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | PURE_KEYWORD + // | VIEW_KEYWORD + // | VIRTUAL_KEYWORD; #[allow(dead_code, non_snake_case)] fn fallback_function_attribute__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -3278,7 +3481,6 @@ impl Language { } running_result } - .with_kind(RuleKind::FallbackFunctionAttribute) } #[allow(non_snake_case)] @@ -3300,7 +3502,41 @@ impl Language { } // (* v0.6.0 *) - // FallbackFunctionDefinition = FALLBACK_KEYWORD ParameterList FallbackFunctionAttribute* (RETURNS_KEYWORD ParameterList)? (SEMICOLON | Block); + // FallbackFunctionAttributesList = «FallbackFunctionAttribute»+; + + #[allow(dead_code, non_snake_case)] + fn fallback_function_attributes_list__0_6_0(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result + .incorporate_one_or_more_result(self.fallback_function_attribute(stream)) + { + } + running_result + } + .with_kind(RuleKind::FallbackFunctionAttributesList) + } + + #[allow(non_snake_case)] + pub(crate) fn fallback_function_attributes_list__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_6_0 { + Some(self.fallback_function_attributes_list__0_6_0(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn fallback_function_attributes_list(&self, stream: &mut Stream) -> ParserResult { + self.fallback_function_attributes_list__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // (* v0.6.0 *) + // FallbackFunctionDefinition = FALLBACK_KEYWORD ParametersDeclaration FallbackFunctionAttributesList? ReturnsDeclaration? (SEMICOLON | Block); #[allow(dead_code, non_snake_case)] fn fallback_function_definition__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -3314,36 +3550,18 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(self.parameter_list(stream)) { + if !running_result.incorporate_sequence_result(self.parameters_declaration(stream)) + { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.fallback_function_attribute(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.fallback_function_attributes_list(stream), + )) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::returns_keyword, - TokenKind::ReturnsKeyword, - ), - ) { - break; - } - running_result.incorporate_sequence_result(self.parameter_list(stream)); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.returns_declaration(stream), + )) { break; } running_result.incorporate_sequence_result({ @@ -3388,7 +3606,7 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // ForStatement = FOR_KEYWORD OPEN_PAREN (SimpleStatement | SEMICOLON) (ExpressionStatement | SEMICOLON) Expression? CLOSE_PAREN Statement; + // ForStatement = FOR_KEYWORD OPEN_PAREN («SimpleStatement» | SEMICOLON) (ExpressionStatement | SEMICOLON) Expression? CLOSE_PAREN Statement; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -3493,16 +3711,16 @@ impl Language { } // (* v0.4.11 *) - // FunctionAttribute = CONSTANT_KEYWORD - // | EXTERNAL_KEYWORD - // | INTERNAL_KEYWORD - // | ModifierInvocation - // | OverrideSpecifier - // | PAYABLE_KEYWORD - // | PRIVATE_KEYWORD - // | PUBLIC_KEYWORD - // | PURE_KEYWORD - // | VIEW_KEYWORD; + // «FunctionAttribute» = ModifierInvocation + // | OverrideSpecifier + // | CONSTANT_KEYWORD + // | EXTERNAL_KEYWORD + // | INTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD + // | PURE_KEYWORD + // | VIEW_KEYWORD; #[allow(dead_code, non_snake_case)] fn function_attribute__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -3510,6 +3728,14 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { + if running_result.incorporate_choice_result(self.modifier_invocation(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.override_specifier(stream)) { + break; + } + stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::constant_keyword, @@ -3534,14 +3760,6 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.modifier_invocation(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.override_specifier(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::payable_keyword, @@ -3583,19 +3801,18 @@ impl Language { } running_result } - .with_kind(RuleKind::FunctionAttribute) } // (* v0.5.0 *) - // FunctionAttribute = EXTERNAL_KEYWORD - // | INTERNAL_KEYWORD - // | ModifierInvocation - // | OverrideSpecifier - // | PAYABLE_KEYWORD - // | PRIVATE_KEYWORD - // | PUBLIC_KEYWORD - // | PURE_KEYWORD - // | VIEW_KEYWORD; + // «FunctionAttribute» = ModifierInvocation + // | OverrideSpecifier + // | EXTERNAL_KEYWORD + // | INTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD + // | PURE_KEYWORD + // | VIEW_KEYWORD; #[allow(dead_code, non_snake_case)] fn function_attribute__0_5_0(&self, stream: &mut Stream) -> ParserResult { @@ -3603,6 +3820,14 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { + if running_result.incorporate_choice_result(self.modifier_invocation(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.override_specifier(stream)) { + break; + } + stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::external_keyword, @@ -3619,14 +3844,6 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.modifier_invocation(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.override_specifier(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::payable_keyword, @@ -3668,20 +3885,19 @@ impl Language { } running_result } - .with_kind(RuleKind::FunctionAttribute) } // (* v0.6.0 *) - // FunctionAttribute = EXTERNAL_KEYWORD - // | INTERNAL_KEYWORD - // | ModifierInvocation - // | OverrideSpecifier - // | PAYABLE_KEYWORD - // | PRIVATE_KEYWORD - // | PUBLIC_KEYWORD - // | PURE_KEYWORD - // | VIEW_KEYWORD - // | VIRTUAL_KEYWORD; + // «FunctionAttribute» = ModifierInvocation + // | OverrideSpecifier + // | EXTERNAL_KEYWORD + // | INTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD + // | PURE_KEYWORD + // | VIEW_KEYWORD + // | VIRTUAL_KEYWORD; #[allow(dead_code, non_snake_case)] fn function_attribute__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -3689,6 +3905,14 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { + if running_result.incorporate_choice_result(self.modifier_invocation(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.override_specifier(stream)) { + break; + } + stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::external_keyword, @@ -3705,14 +3929,6 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.modifier_invocation(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.override_specifier(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::payable_keyword, @@ -3762,7 +3978,6 @@ impl Language { } running_result } - .with_kind(RuleKind::FunctionAttribute) } pub(crate) fn function_attribute(&self, stream: &mut Stream) -> ParserResult { @@ -3774,47 +3989,33 @@ impl Language { self.function_attribute__0_4_11(stream) } } - - // (* v0.4.11 *) - // FunctionCallOperator = ArgumentList; - - #[allow(dead_code, non_snake_case)] - fn function_call_operator__0_4_11(&self, stream: &mut Stream) -> ParserResult { - self.argument_list(stream) - .with_kind(RuleKind::FunctionCallOperator) - } - - // (* v0.6.2 *) - // FunctionCallOperator = FunctionCallOptions* ArgumentList; - - #[allow(dead_code, non_snake_case)] - fn function_call_operator__0_6_2(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.function_call_options(stream)) - { - } - running_result - }) { - break; - } - running_result.incorporate_sequence_result(self.argument_list(stream)); - break; - } + + // FunctionAttributesList = «FunctionAttribute»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn function_attributes_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.function_attribute(stream)) {} running_result } - .with_kind(RuleKind::FunctionCallOperator) + .with_kind(RuleKind::FunctionAttributesList) } - // (* v0.8.0 *) - // FunctionCallOperator = FunctionCallOptions? ArgumentList; + // (* v0.4.11 *) + // «FunctionCallOperator» = ArgumentsDeclaration; #[allow(dead_code, non_snake_case)] - fn function_call_operator__0_8_0(&self, stream: &mut Stream) -> ParserResult { + fn function_call_operator__0_4_11(&self, stream: &mut Stream) -> ParserResult { + self.arguments_declaration(stream) + } + + // (* v0.6.2 *) + // «FunctionCallOperator» = FunctionCallOptions? ArgumentsDeclaration; + + #[allow(dead_code, non_snake_case)] + fn function_call_operator__0_6_2(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -3823,18 +4024,15 @@ impl Language { )) { break; } - running_result.incorporate_sequence_result(self.argument_list(stream)); + running_result.incorporate_sequence_result(self.arguments_declaration(stream)); break; } running_result } - .with_kind(RuleKind::FunctionCallOperator) } pub(crate) fn function_call_operator(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_8_0 { - self.function_call_operator__0_8_0(stream) - } else if self.version_is_equal_to_or_greater_than_0_6_2 { + if self.version_is_equal_to_or_greater_than_0_6_2 { self.function_call_operator__0_6_2(stream) } else { self.function_call_operator__0_4_11(stream) @@ -3842,73 +4040,38 @@ impl Language { } // (* v0.6.2 *) - // FunctionCallOptions = OPEN_BRACE (NamedArgument (COMMA NamedArgument)*)? CLOSE_BRACE; + // FunctionCallOptions = NamedArgumentsDeclaration+; #[allow(dead_code, non_snake_case)] fn function_call_options__0_6_2(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::open_brace, - TokenKind::OpenBrace, - )) { - break; - } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.named_argument(stream)) - { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result - .incorporate_sequence_result(self.named_argument(stream)); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - })) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_brace, - TokenKind::CloseBrace, - )); - break; + while running_result + .incorporate_one_or_more_result(self.named_arguments_declaration(stream)) + { } running_result } .with_kind(RuleKind::FunctionCallOptions) } + // (* v0.8.0 *) + // FunctionCallOptions = NamedArgumentsDeclaration; + + #[allow(dead_code, non_snake_case)] + fn function_call_options__0_8_0(&self, stream: &mut Stream) -> ParserResult { + self.named_arguments_declaration(stream) + .with_kind(RuleKind::FunctionCallOptions) + } + #[allow(non_snake_case)] pub(crate) fn function_call_options__sparse_dispatch( &self, stream: &mut Stream, ) -> Option { - if self.version_is_equal_to_or_greater_than_0_6_2 { + if self.version_is_equal_to_or_greater_than_0_8_0 { + Some(self.function_call_options__0_8_0(stream)) + } else if self.version_is_equal_to_or_greater_than_0_6_2 { Some(self.function_call_options__0_6_2(stream)) } else { None @@ -3921,7 +4084,7 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // FunctionDefinition = FUNCTION_KEYWORD (IDENTIFIER | FALLBACK_KEYWORD | RECEIVE_KEYWORD) ParameterList FunctionAttribute* (RETURNS_KEYWORD ParameterList)? (SEMICOLON | Block); + // FunctionDefinition = FUNCTION_KEYWORD (IDENTIFIER | FALLBACK_KEYWORD | RECEIVE_KEYWORD) ParametersDeclaration FunctionAttributesList? ReturnsDeclaration? (SEMICOLON | Block); #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -3967,36 +4130,18 @@ impl Language { }) { break; } - if !running_result.incorporate_sequence_result(self.parameter_list(stream)) { + if !running_result.incorporate_sequence_result(self.parameters_declaration(stream)) + { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.function_attribute(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.function_attributes_list(stream), + )) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::returns_keyword, - TokenKind::ReturnsKeyword, - ), - ) { - break; - } - running_result.incorporate_sequence_result(self.parameter_list(stream)); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.returns_declaration(stream), + )) { break; } running_result.incorporate_sequence_result({ @@ -4023,7 +4168,7 @@ impl Language { .with_kind(RuleKind::FunctionDefinition) } - // FunctionType = FUNCTION_KEYWORD ParameterList (INTERNAL_KEYWORD | EXTERNAL_KEYWORD | PRIVATE_KEYWORD | PUBLIC_KEYWORD | PURE_KEYWORD | VIEW_KEYWORD | PAYABLE_KEYWORD)* (RETURNS_KEYWORD ParameterList)?; + // FunctionType = FUNCTION_KEYWORD ParametersDeclaration FunctionTypeAttributesList? ReturnsDeclaration?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4038,117 +4183,225 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(self.parameter_list(stream)) { + if !running_result.incorporate_sequence_result(self.parameters_declaration(stream)) + { break; } - if !running_result.incorporate_sequence_result({ + if !running_result.incorporate_sequence_result(transform_option_result( + self.function_type_attributes_list(stream), + )) { + break; + } + running_result.incorporate_sequence_result(transform_option_result( + self.returns_declaration(stream), + )); + break; + } + running_result + } + .with_kind(RuleKind::FunctionType) + } + + // «FunctionTypeAttribute» = INTERNAL_KEYWORD + // | EXTERNAL_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD + // | PURE_KEYWORD + // | VIEW_KEYWORD + // | PAYABLE_KEYWORD; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn function_type_attribute(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::internal_keyword, + TokenKind::InternalKeyword, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::external_keyword, + TokenKind::ExternalKeyword, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::private_keyword, + TokenKind::PrivateKeyword, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::public_keyword, + TokenKind::PublicKeyword, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::pure_keyword, + TokenKind::PureKeyword, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::view_keyword, + TokenKind::ViewKeyword, + )) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::payable_keyword, + TokenKind::PayableKeyword, + )); + break; + } + running_result + } + } + + // FunctionTypeAttributesList = «FunctionTypeAttribute»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn function_type_attributes_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result + .incorporate_one_or_more_result(self.function_type_attribute(stream)) + {} + running_result + } + .with_kind(RuleKind::FunctionTypeAttributesList) + } + + // HexStringLiteralsList = HEX_STRING_LITERAL+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn hex_string_literals_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.parse_token_with_trivia( + stream, + &Self::hex_string_literal, + TokenKind::HexStringLiteral, + )) {} + running_result + } + .with_kind(RuleKind::HexStringLiteralsList) + } + + // IdentifierPath = IDENTIFIER (PERIOD IDENTIFIER)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn identifier_path(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )) { + break; + } + running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); + let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::internal_keyword, - TokenKind::InternalKeyword, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::external_keyword, - TokenKind::ExternalKeyword, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::private_keyword, - TokenKind::PrivateKeyword, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( + if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::public_keyword, - TokenKind::PublicKeyword, + &Self::period, + TokenKind::Period, ), ) { break; } - stream.set_position(start_position); - if running_result.incorporate_choice_result( + running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::pure_keyword, - TokenKind::PureKeyword, + &Self::identifier, + TokenKind::Identifier, ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( + ); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::IdentifierPath) + } + + // IdentifierPathsList = IdentifierPath (COMMA IdentifierPath)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn identifier_paths_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.identifier_path(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::view_keyword, - TokenKind::ViewKeyword, + &Self::comma, + TokenKind::Comma, ), ) { break; } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::payable_keyword, - TokenKind::PayableKeyword, - )); + running_result + .incorporate_sequence_result(self.identifier_path(stream)); break; } running_result }) {} running_result - }) { - break; - } - running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::returns_keyword, - TokenKind::ReturnsKeyword, - ), - ) { - break; - } - running_result.incorporate_sequence_result(self.parameter_list(stream)); - break; - } - running_result - })); + }); break; } running_result } - .with_kind(RuleKind::FunctionType) + .with_kind(RuleKind::IdentifierPathsList) } - // IdentifierPath = IDENTIFIER (PERIOD IDENTIFIER)*; + // IdentifiersList = IDENTIFIER (COMMA IDENTIFIER)*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn identifier_path(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn identifiers_list(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -4167,8 +4420,8 @@ impl Language { if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::period, - TokenKind::Period, + &Self::comma, + TokenKind::Comma, ), ) { break; @@ -4190,7 +4443,7 @@ impl Language { } running_result } - .with_kind(RuleKind::IdentifierPath) + .with_kind(RuleKind::IdentifiersList) } // IfStatement = IF_KEYWORD OPEN_PAREN Expression CLOSE_PAREN Statement (ELSE_KEYWORD Statement)?; @@ -4261,34 +4514,7 @@ impl Language { .with_kind(RuleKind::IfStatement) } - // ImportAlias = AS_KEYWORD IDENTIFIER; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn import_alias(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::as_keyword, - TokenKind::AsKeyword, - )) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - )); - break; - } - running_result - } - .with_kind(RuleKind::ImportAlias) - } - - // ImportDirective = IMPORT_KEYWORD (SimpleImport | AsteriskImport | SelectiveImport) SEMICOLON; + // ImportDirective = IMPORT_KEYWORD (PathImport | NamedImport | DeconstructionImport) SEMICOLON; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4313,19 +4539,19 @@ impl Language { let start_position = stream.position(); loop { if running_result - .incorporate_choice_result(self.simple_import(stream)) + .incorporate_choice_result(self.path_import(stream)) { break; } stream.set_position(start_position); if running_result - .incorporate_choice_result(self.asterisk_import(stream)) + .incorporate_choice_result(self.named_import(stream)) { break; } stream.set_position(start_position); running_result - .incorporate_choice_result(self.selective_import(stream)); + .incorporate_choice_result(self.deconstruction_import(stream)); break; } running_result @@ -4348,20 +4574,7 @@ impl Language { .with_kind(RuleKind::ImportDirective) } - // ImportPath = ASCII_STRING_LITERAL; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn import_path(&self, stream: &mut Stream) -> ParserResult { - self.parse_token_with_trivia( - stream, - &Self::ascii_string_literal, - TokenKind::AsciiStringLiteral, - ) - .with_kind(RuleKind::ImportPath) - } - - // IndexAccessOperator = OPEN_BRACKET ((Expression (COLON Expression?)?) | (COLON Expression?)) CLOSE_BRACKET; + // «IndexAccessOperator» = OPEN_BRACKET ((Expression (COLON Expression?)?) | (COLON Expression?)) CLOSE_BRACKET; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4451,14 +4664,36 @@ impl Language { } running_result } - .with_kind(RuleKind::IndexAccessOperator) } - // InheritanceSpecifier = IdentifierPath ArgumentList?; + // InheritanceSpecifier = IS_KEYWORD InheritanceTypesList; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn inheritance_specifier(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::is_keyword, + TokenKind::IsKeyword, + )) { + break; + } + running_result.incorporate_sequence_result(self.inheritance_types_list(stream)); + break; + } + running_result + } + .with_kind(RuleKind::InheritanceSpecifier) + } + + // InheritanceType = IdentifierPath ArgumentsDeclaration?; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn inheritance_type(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -4466,73 +4701,56 @@ impl Language { break; } running_result.incorporate_sequence_result(transform_option_result( - self.argument_list(stream), + self.arguments_declaration(stream), )); break; } running_result } - .with_kind(RuleKind::InheritanceSpecifier) + .with_kind(RuleKind::InheritanceType) } - // InheritanceSpecifierList = IS_KEYWORD InheritanceSpecifier (COMMA InheritanceSpecifier)*; + // InheritanceTypesList = InheritanceType (COMMA InheritanceType)*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn inheritance_specifier_list(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn inheritance_types_list(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::is_keyword, - TokenKind::IsKeyword, - )) { + if !running_result.incorporate_sequence_result(self.inheritance_type(stream)) { break; } running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result(self.inheritance_specifier(stream)) - { + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result + .incorporate_sequence_result(self.inheritance_type(stream)); break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.inheritance_specifier(stream), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } + running_result + }) {} running_result }); break; } running_result } - .with_kind(RuleKind::InheritanceSpecifierList) + .with_kind(RuleKind::InheritanceTypesList) } - // InterfaceDefinition = INTERFACE_KEYWORD IDENTIFIER InheritanceSpecifierList? OPEN_BRACE «ContractBodyElement»* CLOSE_BRACE; + // InterfaceDefinition = INTERFACE_KEYWORD IDENTIFIER InheritanceSpecifier? OPEN_BRACE InterfaceMembersList? CLOSE_BRACE; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4555,7 +4773,7 @@ impl Language { break; } if !running_result.incorporate_sequence_result(transform_option_result( - self.inheritance_specifier_list(stream), + self.inheritance_specifier(stream), )) { break; } @@ -4571,14 +4789,9 @@ impl Language { ) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.contract_body_element(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.interface_members_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -4597,6 +4810,19 @@ impl Language { .with_kind(RuleKind::InterfaceDefinition) } + // InterfaceMembersList = «ContractMember»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn interface_members_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.contract_member(stream)) {} + running_result + } + .with_kind(RuleKind::InterfaceMembersList) + } + // LeadingTrivia = (WHITESPACE | END_OF_LINE | MULTILINE_COMMENT | SINGLE_LINE_COMMENT)+; #[allow(dead_code)] @@ -4646,7 +4872,7 @@ impl Language { .with_kind(RuleKind::LeadingTrivia) } - // LibraryDefinition = LIBRARY_KEYWORD IDENTIFIER OPEN_BRACE «ContractBodyElement»* CLOSE_BRACE; + // LibraryDefinition = LIBRARY_KEYWORD IDENTIFIER OPEN_BRACE LibraryMembersList? CLOSE_BRACE; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4680,14 +4906,9 @@ impl Language { ) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.contract_body_element(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.library_members_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -4706,8 +4927,21 @@ impl Language { .with_kind(RuleKind::LibraryDefinition) } + // LibraryMembersList = «ContractMember»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn library_members_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.contract_member(stream)) {} + running_result + } + .with_kind(RuleKind::LibraryMembersList) + } + // (* v0.4.11 *) - // MappingKeyType = (ElementaryType | IdentifierPath); + // MappingKeyType = «ElementaryType» | IdentifierPath; #[allow(dead_code, non_snake_case)] fn mapping_key_type__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -4728,7 +4962,7 @@ impl Language { } // (* v0.8.18 *) - // MappingKeyType = (ElementaryType | IdentifierPath) IDENTIFIER?; + // MappingKeyType = («ElementaryType» | IdentifierPath) IDENTIFIER?; #[allow(dead_code, non_snake_case)] fn mapping_key_type__0_8_18(&self, stream: &mut Stream) -> ParserResult { @@ -4873,7 +5107,7 @@ impl Language { } } - // MemberAccessOperator = PERIOD (IDENTIFIER | ADDRESS_KEYWORD); + // «MemberAccessOperator» = PERIOD (IDENTIFIER | ADDRESS_KEYWORD); #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4913,20 +5147,18 @@ impl Language { } running_result } - .with_kind(RuleKind::MemberAccessOperator) } // (* v0.4.11 *) - // ModifierAttribute = OverrideSpecifier; + // «ModifierAttribute» = OverrideSpecifier; #[allow(dead_code, non_snake_case)] fn modifier_attribute__0_4_11(&self, stream: &mut Stream) -> ParserResult { self.override_specifier(stream) - .with_kind(RuleKind::ModifierAttribute) } // (* v0.6.0 *) - // ModifierAttribute = OverrideSpecifier | VIRTUAL_KEYWORD; + // «ModifierAttribute» = OverrideSpecifier | VIRTUAL_KEYWORD; #[allow(dead_code, non_snake_case)] fn modifier_attribute__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -4947,7 +5179,6 @@ impl Language { } running_result } - .with_kind(RuleKind::ModifierAttribute) } pub(crate) fn modifier_attribute(&self, stream: &mut Stream) -> ParserResult { @@ -4958,7 +5189,20 @@ impl Language { } } - // ModifierDefinition = MODIFIER_KEYWORD IDENTIFIER ParameterList? ModifierAttribute* (SEMICOLON | Block); + // ModifierAttributesList = «ModifierAttribute»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn modifier_attributes_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.modifier_attribute(stream)) {} + running_result + } + .with_kind(RuleKind::ModifierAttributesList) + } + + // ModifierDefinition = MODIFIER_KEYWORD IDENTIFIER ParametersDeclaration? ModifierAttributesList? (SEMICOLON | Block); #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4981,18 +5225,13 @@ impl Language { break; } if !running_result.incorporate_sequence_result(transform_option_result( - self.parameter_list(stream), + self.parameters_declaration(stream), )) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.modifier_attribute(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.modifier_attributes_list(stream), + )) { break; } running_result.incorporate_sequence_result({ @@ -5019,7 +5258,7 @@ impl Language { .with_kind(RuleKind::ModifierDefinition) } - // ModifierInvocation = IdentifierPath ArgumentList?; + // ModifierInvocation = IdentifierPath ArgumentsDeclaration?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -5031,7 +5270,7 @@ impl Language { break; } running_result.incorporate_sequence_result(transform_option_result( - self.argument_list(stream), + self.arguments_declaration(stream), )); break; } @@ -5040,9 +5279,9 @@ impl Language { .with_kind(RuleKind::ModifierInvocation) } - // MulDivModOperator = ASTERISK - // | SLASH - // | PERCENT; + // «MulDivModOperator» = ASTERISK + // | SLASH + // | PERCENT; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -5076,99 +5315,155 @@ impl Language { } running_result } - .with_kind(RuleKind::MulDivModOperator) } - // NamedArgument = IDENTIFIER COLON Expression; + // NamedArgument = IDENTIFIER COLON Expression; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn named_argument(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )) { + break; + } + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::colon, + TokenKind::Colon, + )) { + break; + } + running_result.incorporate_sequence_result(self.expression(stream)); + break; + } + running_result + } + .with_kind(RuleKind::NamedArgument) + } + + // NamedArgumentsDeclaration = OPEN_BRACE NamedArgumentsList? CLOSE_BRACE; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn named_arguments_declaration(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::open_brace, + TokenKind::OpenBrace, + )) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.named_arguments_list(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_brace, + TokenKind::CloseBrace, + )); + break; + } + running_result + } + .with_kind(RuleKind::NamedArgumentsDeclaration) + } + + // NamedArgumentsList = NamedArgument (COMMA NamedArgument)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn named_arguments_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.named_argument(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.named_argument(stream)); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::NamedArgumentsList) + } + + // NamedImport = ASTERISK AS_KEYWORD IDENTIFIER FROM_KEYWORD ASCII_STRING_LITERAL; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn named_argument(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn named_import(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::identifier, - TokenKind::Identifier, + &Self::asterisk, + TokenKind::Asterisk, )) { break; } if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::colon, - TokenKind::Colon, + &Self::as_keyword, + TokenKind::AsKeyword, )) { break; } - running_result.incorporate_sequence_result(self.expression(stream)); - break; - } - running_result - } - .with_kind(RuleKind::NamedArgument) - } - - // NamedArgumentList = OPEN_BRACE (NamedArgument (COMMA NamedArgument)*)? CLOSE_BRACE; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn named_argument_list(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::open_brace, - TokenKind::OpenBrace, + &Self::identifier, + TokenKind::Identifier, )) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.named_argument(stream)) - { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result - .incorporate_sequence_result(self.named_argument(stream)); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::from_keyword, + TokenKind::FromKeyword, + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::close_brace, - TokenKind::CloseBrace, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, )); break; } running_result } - .with_kind(RuleKind::NamedArgumentList) + .with_kind(RuleKind::NamedImport) } // NewExpression = NEW_KEYWORD TypeName; @@ -5195,16 +5490,16 @@ impl Language { } // (* v0.4.11 *) - // NumberUnit = DAYS_KEYWORD - // | ETHER_KEYWORD - // | FINNEY_KEYWORD - // | HOURS_KEYWORD - // | MINUTES_KEYWORD - // | SECONDS_KEYWORD - // | SZABO_KEYWORD - // | WEEKS_KEYWORD - // | WEI_KEYWORD - // | YEARS_KEYWORD; + // «NumberUnit» = DAYS_KEYWORD + // | ETHER_KEYWORD + // | FINNEY_KEYWORD + // | HOURS_KEYWORD + // | MINUTES_KEYWORD + // | SECONDS_KEYWORD + // | SZABO_KEYWORD + // | WEEKS_KEYWORD + // | WEI_KEYWORD + // | YEARS_KEYWORD; #[allow(dead_code, non_snake_case)] fn number_unit__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -5293,19 +5588,18 @@ impl Language { } running_result } - .with_kind(RuleKind::NumberUnit) } // (* v0.5.0 *) - // NumberUnit = DAYS_KEYWORD - // | ETHER_KEYWORD - // | FINNEY_KEYWORD - // | HOURS_KEYWORD - // | MINUTES_KEYWORD - // | SECONDS_KEYWORD - // | SZABO_KEYWORD - // | WEEKS_KEYWORD - // | WEI_KEYWORD; + // «NumberUnit» = DAYS_KEYWORD + // | ETHER_KEYWORD + // | FINNEY_KEYWORD + // | HOURS_KEYWORD + // | MINUTES_KEYWORD + // | SECONDS_KEYWORD + // | SZABO_KEYWORD + // | WEEKS_KEYWORD + // | WEI_KEYWORD; #[allow(dead_code, non_snake_case)] fn number_unit__0_5_0(&self, stream: &mut Stream) -> ParserResult { @@ -5386,20 +5680,19 @@ impl Language { } running_result } - .with_kind(RuleKind::NumberUnit) } // (* v0.6.11 *) - // NumberUnit = DAYS_KEYWORD - // | ETHER_KEYWORD - // | FINNEY_KEYWORD - // | GWEI_KEYWORD - // | HOURS_KEYWORD - // | MINUTES_KEYWORD - // | SECONDS_KEYWORD - // | SZABO_KEYWORD - // | WEEKS_KEYWORD - // | WEI_KEYWORD; + // «NumberUnit» = DAYS_KEYWORD + // | ETHER_KEYWORD + // | FINNEY_KEYWORD + // | GWEI_KEYWORD + // | HOURS_KEYWORD + // | MINUTES_KEYWORD + // | SECONDS_KEYWORD + // | SZABO_KEYWORD + // | WEEKS_KEYWORD + // | WEI_KEYWORD; #[allow(dead_code, non_snake_case)] fn number_unit__0_6_11(&self, stream: &mut Stream) -> ParserResult { @@ -5488,18 +5781,17 @@ impl Language { } running_result } - .with_kind(RuleKind::NumberUnit) } // (* v0.7.0 *) - // NumberUnit = DAYS_KEYWORD - // | ETHER_KEYWORD - // | GWEI_KEYWORD - // | HOURS_KEYWORD - // | MINUTES_KEYWORD - // | SECONDS_KEYWORD - // | WEEKS_KEYWORD - // | WEI_KEYWORD; + // «NumberUnit» = DAYS_KEYWORD + // | ETHER_KEYWORD + // | GWEI_KEYWORD + // | HOURS_KEYWORD + // | MINUTES_KEYWORD + // | SECONDS_KEYWORD + // | WEEKS_KEYWORD + // | WEI_KEYWORD; #[allow(dead_code, non_snake_case)] fn number_unit__0_7_0(&self, stream: &mut Stream) -> ParserResult { @@ -5572,7 +5864,6 @@ impl Language { } running_result } - .with_kind(RuleKind::NumberUnit) } pub(crate) fn number_unit(&self, stream: &mut Stream) -> ParserResult { @@ -5588,7 +5879,7 @@ impl Language { } // (* v0.4.11 *) - // NumericExpression = (HEX_LITERAL | DECIMAL_LITERAL) NumberUnit?; + // NumericExpression = (HEX_LITERAL | DECIMAL_LITERAL) «NumberUnit»?; #[allow(dead_code, non_snake_case)] fn numeric_expression__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -5628,7 +5919,7 @@ impl Language { } // (* v0.5.0 *) - // NumericExpression = HEX_LITERAL | (DECIMAL_LITERAL NumberUnit?); + // NumericExpression = HEX_LITERAL | (DECIMAL_LITERAL «NumberUnit»?); #[allow(dead_code, non_snake_case)] fn numeric_expression__0_5_0(&self, stream: &mut Stream) -> ParserResult { @@ -5678,19 +5969,18 @@ impl Language { } } - // OrOperator = BAR_BAR; + // «OrOperator» = BAR_BAR; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn or_operator(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, &Self::bar_bar, TokenKind::BarBar) - .with_kind(RuleKind::OrOperator) } - // OrderComparisonOperator = LESS_THAN - // | GREATER_THAN - // | LESS_THAN_EQUAL - // | GREATER_THAN_EQUAL; + // «OrderComparisonOperator» = LESS_THAN + // | GREATER_THAN + // | LESS_THAN_EQUAL + // | GREATER_THAN_EQUAL; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -5732,10 +6022,9 @@ impl Language { } running_result } - .with_kind(RuleKind::OrderComparisonOperator) } - // OverrideSpecifier = OVERRIDE_KEYWORD (OPEN_PAREN IdentifierPath (COMMA IdentifierPath)* CLOSE_PAREN)?; + // OverrideSpecifier = OVERRIDE_KEYWORD (OPEN_PAREN IdentifierPathsList? CLOSE_PAREN)?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -5762,42 +6051,9 @@ impl Language { ) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result(self.identifier_path(stream)) - { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.identifier_path(stream), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.identifier_paths_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -5816,11 +6072,11 @@ impl Language { .with_kind(RuleKind::OverrideSpecifier) } - // ParameterDeclaration = TypeName DataLocation? IDENTIFIER?; + // Parameter = TypeName «DataLocation»? IDENTIFIER?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn parameter_declaration(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn parameter(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -5839,14 +6095,14 @@ impl Language { } running_result } - .with_kind(RuleKind::ParameterDeclaration) + .with_kind(RuleKind::Parameter) } - // ParameterList = OPEN_PAREN (ParameterDeclaration (COMMA ParameterDeclaration)*)? CLOSE_PAREN; + // ParametersDeclaration = OPEN_PAREN ParametersList? CLOSE_PAREN; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn parameter_list(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn parameters_declaration(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -5857,41 +6113,9 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result(self.parameter_declaration(stream)) - { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.parameter_declaration(stream), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.parameters_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -5903,23 +6127,96 @@ impl Language { } running_result } - .with_kind(RuleKind::ParameterList) + .with_kind(RuleKind::ParametersDeclaration) + } + + // ParametersList = Parameter (COMMA Parameter)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn parameters_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parameter(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.parameter(stream)); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::ParametersList) } - // PayableType = PAYABLE_KEYWORD; + // PathImport = ASCII_STRING_LITERAL (AS_KEYWORD IDENTIFIER)?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn payable_type(&self, stream: &mut Stream) -> ParserResult { - self.parse_token_with_trivia(stream, &Self::payable_keyword, TokenKind::PayableKeyword) - .with_kind(RuleKind::PayableType) + pub(crate) fn path_import(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, + )) { + break; + } + running_result.incorporate_sequence_result(transform_option_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::as_keyword, + TokenKind::AsKeyword, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )); + break; + } + running_result + })); + break; + } + running_result + } + .with_kind(RuleKind::PathImport) } - // PositionalArgumentList = Expression (COMMA Expression)*; + // PositionalArgumentsList = Expression (COMMA Expression)*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn positional_argument_list(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn positional_arguments_list(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -5951,10 +6248,10 @@ impl Language { } running_result } - .with_kind(RuleKind::PositionalArgumentList) + .with_kind(RuleKind::PositionalArgumentsList) } - // PragmaDirective = PRAGMA_KEYWORD (VersionPragma | ABICoderPragma | ExperimentalPragma) SEMICOLON; + // PragmaDirective = PRAGMA_KEYWORD (ABICoderPragma | ExperimentalPragma | VersionPragma) SEMICOLON; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -5979,19 +6276,19 @@ impl Language { let start_position = stream.position(); loop { if running_result - .incorporate_choice_result(self.version_pragma(stream)) + .incorporate_choice_result(self.abi_coder_pragma(stream)) { break; } stream.set_position(start_position); if running_result - .incorporate_choice_result(self.abi_coder_pragma(stream)) + .incorporate_choice_result(self.experimental_pragma(stream)) { break; } stream.set_position(start_position); running_result - .incorporate_choice_result(self.experimental_pragma(stream)); + .incorporate_choice_result(self.version_pragma(stream)); break; } running_result @@ -6015,14 +6312,14 @@ impl Language { } // (* v0.4.11 *) - // PrimaryExpression = NewExpression - // | TupleExpression - // | ArrayLiteral - // | BooleanLiteral - // | NumericExpression - // | StringExpression - // | ElementaryType - // | IDENTIFIER; + // «PrimaryExpression» = NewExpression + // | TupleExpression + // | ArrayExpression + // | «BooleanExpression» + // | NumericExpression + // | «StringExpression» + // | «ElementaryType» + // | IDENTIFIER; #[allow(dead_code, non_snake_case)] fn primary_expression__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -6038,11 +6335,11 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.array_literal(stream)) { + if running_result.incorporate_choice_result(self.array_expression(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.boolean_literal(stream)) { + if running_result.incorporate_choice_result(self.boolean_expression(stream)) { break; } stream.set_position(start_position); @@ -6067,19 +6364,18 @@ impl Language { } running_result } - .with_kind(RuleKind::PrimaryExpression) } // (* v0.5.3 *) - // PrimaryExpression = NewExpression - // | TupleExpression - // | TypeExpression - // | ArrayLiteral - // | BooleanLiteral - // | NumericExpression - // | StringExpression - // | ElementaryType - // | IDENTIFIER; + // «PrimaryExpression» = NewExpression + // | TupleExpression + // | TypeExpression + // | ArrayExpression + // | «BooleanExpression» + // | NumericExpression + // | «StringExpression» + // | «ElementaryType» + // | IDENTIFIER; #[allow(dead_code, non_snake_case)] fn primary_expression__0_5_3(&self, stream: &mut Stream) -> ParserResult { @@ -6099,11 +6395,11 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.array_literal(stream)) { + if running_result.incorporate_choice_result(self.array_expression(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.boolean_literal(stream)) { + if running_result.incorporate_choice_result(self.boolean_expression(stream)) { break; } stream.set_position(start_position); @@ -6128,7 +6424,6 @@ impl Language { } running_result } - .with_kind(RuleKind::PrimaryExpression) } pub(crate) fn primary_expression(&self, stream: &mut Stream) -> ParserResult { @@ -6140,11 +6435,11 @@ impl Language { } // (* v0.6.0 *) - // ReceiveFunctionAttribute = ModifierInvocation - // | OverrideSpecifier - // | EXTERNAL_KEYWORD - // | PAYABLE_KEYWORD - // | VIRTUAL_KEYWORD; + // «ReceiveFunctionAttribute» = ModifierInvocation + // | OverrideSpecifier + // | EXTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | VIRTUAL_KEYWORD; #[allow(dead_code, non_snake_case)] fn receive_function_attribute__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -6185,7 +6480,6 @@ impl Language { } running_result } - .with_kind(RuleKind::ReceiveFunctionAttribute) } #[allow(non_snake_case)] @@ -6207,7 +6501,41 @@ impl Language { } // (* v0.6.0 *) - // ReceiveFunctionDefinition = RECEIVE_KEYWORD ParameterList ReceiveFunctionAttribute* (SEMICOLON | Block); + // ReceiveFunctionAttributesList = «ReceiveFunctionAttribute»+; + + #[allow(dead_code, non_snake_case)] + fn receive_function_attributes_list__0_6_0(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result + .incorporate_one_or_more_result(self.receive_function_attribute(stream)) + { + } + running_result + } + .with_kind(RuleKind::ReceiveFunctionAttributesList) + } + + #[allow(non_snake_case)] + pub(crate) fn receive_function_attributes_list__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_6_0 { + Some(self.receive_function_attributes_list__0_6_0(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn receive_function_attributes_list(&self, stream: &mut Stream) -> ParserResult { + self.receive_function_attributes_list__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // (* v0.6.0 *) + // ReceiveFunctionDefinition = RECEIVE_KEYWORD ParametersDeclaration ReceiveFunctionAttributesList? (SEMICOLON | Block); #[allow(dead_code, non_snake_case)] fn receive_function_definition__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -6221,17 +6549,13 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(self.parameter_list(stream)) { + if !running_result.incorporate_sequence_result(self.parameters_declaration(stream)) + { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.receive_function_attribute(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.receive_function_attributes_list(stream), + )) { break; } running_result.incorporate_sequence_result({ @@ -6315,57 +6639,36 @@ impl Language { running_result } .with_kind(RuleKind::ReturnStatement) - } - - // RevertStatement = REVERT_KEYWORD IdentifierPath? ArgumentList SEMICOLON; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn revert_statement(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::revert_keyword, - TokenKind::RevertKeyword, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result(transform_option_result( - self.identifier_path(stream), - )) { - break; - } - running_result.incorporate_sequence_result(self.argument_list(stream)); - break; - } - running_result - }) { + } + + // ReturnsDeclaration = RETURNS_KEYWORD ParametersDeclaration; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn returns_declaration(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::returns_keyword, + TokenKind::ReturnsKeyword, + )) { break; } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::semicolon, - TokenKind::Semicolon, - )); + running_result.incorporate_sequence_result(self.parameters_declaration(stream)); break; } running_result } - .with_kind(RuleKind::RevertStatement) + .with_kind(RuleKind::ReturnsDeclaration) } - // SelectiveImport = OPEN_BRACE IDENTIFIER ImportAlias? (COMMA IDENTIFIER ImportAlias?)* CLOSE_BRACE FROM_KEYWORD ImportPath; + // RevertStatement = REVERT_KEYWORD IdentifierPath? ArgumentsDeclaration SEMICOLON; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn selective_import(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn revert_statement(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -6375,114 +6678,40 @@ impl Language { if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::open_brace, - TokenKind::OpenBrace, + &Self::revert_keyword, + TokenKind::RevertKeyword, ), ) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - transform_option_result(self.import_alias(stream)), - ); - break; - } - running_result - }) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - transform_option_result( - self.import_alias(stream), - ), - ); - break; - } - running_result - }); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.identifier_path(stream), + )) { break; } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_brace, - TokenKind::CloseBrace, - )); + running_result + .incorporate_sequence_result(self.arguments_declaration(stream)); break; } running_result }) { break; } - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::from_keyword, - TokenKind::FromKeyword, - )) { - break; - } - running_result.incorporate_sequence_result(self.import_path(stream)); + &Self::semicolon, + TokenKind::Semicolon, + )); break; } running_result } - .with_kind(RuleKind::SelectiveImport) + .with_kind(RuleKind::RevertStatement) } - // ShiftOperator = LESS_THAN_LESS_THAN - // | GREATER_THAN_GREATER_THAN - // | GREATER_THAN_GREATER_THAN_GREATER_THAN; + // «ShiftOperator» = LESS_THAN_LESS_THAN + // | GREATER_THAN_GREATER_THAN + // | GREATER_THAN_GREATER_THAN_GREATER_THAN; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -6516,104 +6745,225 @@ impl Language { } running_result } - .with_kind(RuleKind::ShiftOperator) } - // SimpleImport = ImportPath ImportAlias?; + // «SimpleStatement» = ExpressionStatement + // | VariableDeclarationStatement + // | TupleDeconstructionStatement; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn simple_statement(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result(self.expression_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result + .incorporate_choice_result(self.variable_declaration_statement(stream)) + { + break; + } + stream.set_position(start_position); + running_result + .incorporate_choice_result(self.tuple_deconstruction_statement(stream)); + break; + } + running_result + } + } + + // SourceUnit = SourceUnitMembersList? EndOfFileTrivia?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn simple_import(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn source_unit(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result(self.import_path(stream)) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.source_unit_members_list(stream), + )) { break; } running_result.incorporate_sequence_result(transform_option_result( - self.import_alias(stream), + self.end_of_file_trivia(stream), )); break; } running_result } - .with_kind(RuleKind::SimpleImport) + .with_kind(RuleKind::SourceUnit) } - // SimpleStatement = TupleDeconstructionStatement - // | VariableDeclarationStatement - // | ExpressionStatement; + // (* v0.4.11 *) + // «SourceUnitMember» = ContractDefinition + // | LibraryDefinition + // | InterfaceDefinition + // | StructDefinition + // | EnumDefinition + // | ConstantDefinition + // | FunctionDefinition + // | ErrorDefinition + // | ImportDirective + // | PragmaDirective + // | UsingDirective; - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn simple_statement(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code, non_snake_case)] + fn source_unit_member__0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result - .incorporate_choice_result(self.tuple_deconstruction_statement(stream)) - { + if running_result.incorporate_choice_result(self.contract_definition(stream)) { break; } stream.set_position(start_position); - if running_result - .incorporate_choice_result(self.variable_declaration_statement(stream)) - { + if running_result.incorporate_choice_result(self.library_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.interface_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.struct_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.enum_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.constant_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.function_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.error_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.import_directive(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.pragma_directive(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.expression_statement(stream)); + running_result.incorporate_choice_result(self.using_directive(stream)); break; } running_result } - .with_kind(RuleKind::SimpleStatement) } - // SourceUnit = (Directive | Definition)* EndOfFileTrivia?; + // (* v0.8.8 *) + // «SourceUnitMember» = ContractDefinition + // | LibraryDefinition + // | InterfaceDefinition + // | StructDefinition + // | EnumDefinition + // | ConstantDefinition + // | FunctionDefinition + // | ErrorDefinition + // | ImportDirective + // | PragmaDirective + // | UsingDirective + // | UserDefinedValueTypeDefinition; - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn source_unit(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code, non_snake_case)] + fn source_unit_member__0_8_8(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::r#match(vec![], vec![]); + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result(self.directive(stream)) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.definition(stream)); - break; - } - running_result - }) {} - running_result - }) { + if running_result.incorporate_choice_result(self.contract_definition(stream)) { break; } - running_result.incorporate_sequence_result(transform_option_result( - self.end_of_file_trivia(stream), - )); + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.library_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.interface_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.struct_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.enum_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.constant_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.function_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.error_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.import_directive(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.pragma_directive(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.using_directive(stream)) { + break; + } + stream.set_position(start_position); + running_result + .incorporate_choice_result(self.user_defined_value_type_definition(stream)); break; } running_result } - .with_kind(RuleKind::SourceUnit) + } + + pub(crate) fn source_unit_member(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_8_8 { + self.source_unit_member__0_8_8(stream) + } else { + self.source_unit_member__0_4_11(stream) + } + } + + // SourceUnitMembersList = «SourceUnitMember»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn source_unit_members_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.source_unit_member(stream)) {} + running_result + } + .with_kind(RuleKind::SourceUnitMembersList) } // (* v0.4.11 *) - // StateVariableAttribute = OverrideSpecifier - // | CONSTANT_KEYWORD - // | INTERNAL_KEYWORD - // | PRIVATE_KEYWORD - // | PUBLIC_KEYWORD; + // «StateVariableAttribute» = OverrideSpecifier + // | CONSTANT_KEYWORD + // | INTERNAL_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD; #[allow(dead_code, non_snake_case)] fn state_variable_attribute__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -6658,16 +7008,15 @@ impl Language { } running_result } - .with_kind(RuleKind::StateVariableAttribute) } // (* v0.6.5 *) - // StateVariableAttribute = OverrideSpecifier - // | CONSTANT_KEYWORD - // | IMMUTABLE_KEYWORD - // | INTERNAL_KEYWORD - // | PRIVATE_KEYWORD - // | PUBLIC_KEYWORD; + // «StateVariableAttribute» = OverrideSpecifier + // | CONSTANT_KEYWORD + // | IMMUTABLE_KEYWORD + // | INTERNAL_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD; #[allow(dead_code, non_snake_case)] fn state_variable_attribute__0_6_5(&self, stream: &mut Stream) -> ParserResult { @@ -6720,7 +7069,6 @@ impl Language { } running_result } - .with_kind(RuleKind::StateVariableAttribute) } pub(crate) fn state_variable_attribute(&self, stream: &mut Stream) -> ParserResult { @@ -6731,11 +7079,26 @@ impl Language { } } - // StateVariableDeclaration = TypeName StateVariableAttribute* IDENTIFIER (EQUAL Expression)? SEMICOLON; + // StateVariableAttributesList = «StateVariableAttribute»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn state_variable_attributes_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result + .incorporate_one_or_more_result(self.state_variable_attribute(stream)) + {} + running_result + } + .with_kind(RuleKind::StateVariableAttributesList) + } + + // StateVariableDefinition = TypeName StateVariableAttributesList? IDENTIFIER (EQUAL Expression)? SEMICOLON; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn state_variable_declaration(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn state_variable_definition(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -6745,15 +7108,11 @@ impl Language { if !running_result.incorporate_sequence_result(self.type_name(stream)) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result( - self.state_variable_attribute(stream), - ) {} - running_result - }) { - break; - } + if !running_result.incorporate_sequence_result(transform_option_result( + self.state_variable_attributes_list(stream), + )) { + break; + } if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, @@ -6795,23 +7154,14 @@ impl Language { } running_result } - .with_kind(RuleKind::StateVariableDeclaration) + .with_kind(RuleKind::StateVariableDefinition) } // (* v0.4.11 *) - // Statement = Block - // | SimpleStatement - // | IfStatement - // | ForStatement - // | WhileStatement - // | DoWhileStatement - // | ContinueStatement - // | BreakStatement - // | ReturnStatement - // | ThrowStatement - // | RevertStatement - // | DeleteStatement - // | AssemblyStatement; + // Statement = «SimpleStatement» + // | «ControlStatement» + // | AssemblyStatement + // | Block; #[allow(dead_code, non_snake_case)] fn statement__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -6819,55 +7169,19 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result(self.block(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.simple_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.if_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.for_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.do_while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.continue_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.break_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.return_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.throw_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.revert_statement(stream)) { + if running_result.incorporate_choice_result(self.control_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.delete_statement(stream)) { + if running_result.incorporate_choice_result(self.assembly_statement(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.assembly_statement(stream)); + running_result.incorporate_choice_result(self.block(stream)); break; } running_result @@ -6875,81 +7189,36 @@ impl Language { .with_kind(RuleKind::Statement) } - // (* v0.4.21 *) - // Statement = Block - // | SimpleStatement - // | IfStatement - // | ForStatement - // | WhileStatement - // | DoWhileStatement - // | ContinueStatement - // | BreakStatement - // | ReturnStatement - // | EmitStatement - // | ThrowStatement - // | RevertStatement - // | DeleteStatement - // | AssemblyStatement; + // (* v0.8.0 *) + // Statement = «SimpleStatement» + // | «ControlStatement» + // | AssemblyStatement + // | Block + // | UncheckedBlock; #[allow(dead_code, non_snake_case)] - fn statement__0_4_21(&self, stream: &mut Stream) -> ParserResult { + fn statement__0_8_0(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result(self.block(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.simple_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.if_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.for_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.do_while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.continue_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.break_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.return_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.emit_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.throw_statement(stream)) { + if running_result.incorporate_choice_result(self.control_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.revert_statement(stream)) { + if running_result.incorporate_choice_result(self.assembly_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.delete_statement(stream)) { + if running_result.incorporate_choice_result(self.block(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.assembly_statement(stream)); + running_result.incorporate_choice_result(self.unchecked_block(stream)); break; } running_result @@ -6957,179 +7226,29 @@ impl Language { .with_kind(RuleKind::Statement) } - // (* v0.5.0 *) - // Statement = Block - // | SimpleStatement - // | IfStatement - // | ForStatement - // | WhileStatement - // | DoWhileStatement - // | ContinueStatement - // | BreakStatement - // | ReturnStatement - // | EmitStatement - // | RevertStatement - // | DeleteStatement - // | AssemblyStatement; - - #[allow(dead_code, non_snake_case)] - fn statement__0_5_0(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result(self.block(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.simple_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.if_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.for_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.do_while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.continue_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.break_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.return_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.emit_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.revert_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.delete_statement(stream)) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.assembly_statement(stream)); - break; - } - running_result + pub(crate) fn statement(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_8_0 { + self.statement__0_8_0(stream) + } else { + self.statement__0_4_11(stream) } - .with_kind(RuleKind::Statement) } - // (* v0.6.0 *) - // Statement = Block - // | SimpleStatement - // | IfStatement - // | ForStatement - // | WhileStatement - // | DoWhileStatement - // | ContinueStatement - // | BreakStatement - // | TryStatement - // | ReturnStatement - // | EmitStatement - // | RevertStatement - // | DeleteStatement - // | AssemblyStatement; + // StatementsList = Statement+; - #[allow(dead_code, non_snake_case)] - fn statement__0_6_0(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn statements_list(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result(self.block(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.simple_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.if_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.for_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.do_while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.continue_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.break_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.try_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.return_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.emit_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.revert_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.delete_statement(stream)) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.assembly_statement(stream)); - break; - } + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.statement(stream)) {} running_result } - .with_kind(RuleKind::Statement) - } - - pub(crate) fn statement(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_6_0 { - self.statement__0_6_0(stream) - } else if self.version_is_equal_to_or_greater_than_0_5_0 { - self.statement__0_5_0(stream) - } else if self.version_is_equal_to_or_greater_than_0_4_21 { - self.statement__0_4_21(stream) - } else { - self.statement__0_4_11(stream) - } + .with_kind(RuleKind::StatementsList) } // (* v0.4.11 *) - // StringExpression = HEX_STRING_LITERAL+ | ASCII_STRING_LITERAL+; + // «StringExpression» = HexStringLiteralsList | AsciiStringLiteralsList; #[allow(dead_code, non_snake_case)] fn string_expression__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -7137,40 +7256,21 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result( - self.parse_token_with_trivia( - stream, - &Self::hex_string_literal, - TokenKind::HexStringLiteral, - ), - ) {} - running_result - }) { + if running_result.incorporate_choice_result(self.hex_string_literals_list(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result( - self.parse_token_with_trivia( - stream, - &Self::ascii_string_literal, - TokenKind::AsciiStringLiteral, - ), - ) {} - running_result - }); + running_result.incorporate_choice_result(self.ascii_string_literals_list(stream)); break; } running_result } - .with_kind(RuleKind::StringExpression) } // (* v0.7.0 *) - // StringExpression = HEX_STRING_LITERAL+ | ASCII_STRING_LITERAL+ | UNICODE_STRING_LITERAL+; + // «StringExpression» = HexStringLiteralsList + // | AsciiStringLiteralsList + // | UnicodeStringLiteralsList; #[allow(dead_code, non_snake_case)] fn string_expression__0_7_0(&self, stream: &mut Stream) -> ParserResult { @@ -7178,50 +7278,20 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result( - self.parse_token_with_trivia( - stream, - &Self::hex_string_literal, - TokenKind::HexStringLiteral, - ), - ) {} - running_result - }) { + if running_result.incorporate_choice_result(self.hex_string_literals_list(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result( - self.parse_token_with_trivia( - stream, - &Self::ascii_string_literal, - TokenKind::AsciiStringLiteral, - ), - ) {} - running_result - }) { + if running_result.incorporate_choice_result(self.ascii_string_literals_list(stream)) + { break; } stream.set_position(start_position); - running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result( - self.parse_token_with_trivia( - stream, - &Self::unicode_string_literal, - TokenKind::UnicodeStringLiteral, - ), - ) {} - running_result - }); + running_result.incorporate_choice_result(self.unicode_string_literals_list(stream)); break; } running_result } - .with_kind(RuleKind::StringExpression) } pub(crate) fn string_expression(&self, stream: &mut Stream) -> ParserResult { @@ -7232,7 +7302,7 @@ impl Language { } } - // StructDefinition = STRUCT_KEYWORD IDENTIFIER OPEN_BRACE StructMember+ CLOSE_BRACE; + // StructDefinition = STRUCT_KEYWORD IDENTIFIER OPEN_BRACE StructMembersList? CLOSE_BRACE; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -7266,14 +7336,9 @@ impl Language { ) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_one_or_more_result(self.struct_member(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.struct_members_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -7329,6 +7394,19 @@ impl Language { .with_kind(RuleKind::StructMember) } + // StructMembersList = StructMember+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn struct_members_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.struct_member(stream)) {} + running_result + } + .with_kind(RuleKind::StructMembersList) + } + // (* v0.4.11 *) // ThrowStatement = THROW_KEYWORD SEMICOLON; @@ -7409,7 +7487,7 @@ impl Language { } // (* v0.6.0 *) - // TryStatement = TRY_KEYWORD Expression (RETURNS_KEYWORD ParameterList)? Block CatchClause+; + // TryStatement = TRY_KEYWORD Expression ReturnsDeclaration? Block CatchClausesList; #[allow(dead_code, non_snake_case)] fn try_statement__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -7426,34 +7504,15 @@ impl Language { if !running_result.incorporate_sequence_result(self.expression(stream)) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::returns_keyword, - TokenKind::ReturnsKeyword, - ), - ) { - break; - } - running_result.incorporate_sequence_result(self.parameter_list(stream)); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.returns_declaration(stream), + )) { break; } if !running_result.incorporate_sequence_result(self.block(stream)) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result(self.catch_clause(stream)) { - } - running_result - }); + running_result.incorporate_sequence_result(self.catch_clauses_list(stream)); break; } running_result @@ -7479,15 +7538,72 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // TupleDeconstructionStatement = OPEN_PAREN (((TypeName DataLocation? IDENTIFIER) | (DataLocation? IDENTIFIER))? (COMMA ((TypeName DataLocation? IDENTIFIER) | (DataLocation? IDENTIFIER))?)*)? CLOSE_PAREN EQUAL Expression SEMICOLON; + // TupleDeconstructionStatement = OPEN_PAREN TupleMembersList? CLOSE_PAREN EQUAL Expression SEMICOLON; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn tuple_deconstruction_statement(&self, stream: &mut Stream) -> ParserResult { - { let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: open_paren , TokenKind :: OpenParen)) { break ; } if ! running_result . incorporate_sequence_result (transform_option_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (transform_option_result ({ let mut running_result = ParserResult :: no_match (vec ! []) ; let start_position = stream . position () ; loop { if running_result . incorporate_choice_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . type_name (stream)) { break ; } if ! running_result . incorporate_sequence_result (transform_option_result (self . data_location (stream))) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: identifier , TokenKind :: Identifier)) ; break ; } running_result }) { break ; } stream . set_position (start_position) ; running_result . incorporate_choice_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (transform_option_result (self . data_location (stream))) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: identifier , TokenKind :: Identifier)) ; break ; } running_result }) ; break ; } running_result })) { break ; } running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; while running_result . incorporate_zero_or_more_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: comma , TokenKind :: Comma)) { break ; } running_result . incorporate_sequence_result (transform_option_result ({ let mut running_result = ParserResult :: no_match (vec ! []) ; let start_position = stream . position () ; loop { if running_result . incorporate_choice_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . type_name (stream)) { break ; } if ! running_result . incorporate_sequence_result (transform_option_result (self . data_location (stream))) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: identifier , TokenKind :: Identifier)) ; break ; } running_result }) { break ; } stream . set_position (start_position) ; running_result . incorporate_choice_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (transform_option_result (self . data_location (stream))) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: identifier , TokenKind :: Identifier)) ; break ; } running_result }) ; break ; } running_result })) ; break ; } running_result }) { } running_result }) ; break ; } running_result })) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: close_paren , TokenKind :: CloseParen)) ; break ; } running_result }) { break ; } if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: equal , TokenKind :: Equal)) { break ; } running_result . incorporate_sequence_result (self . expression (stream)) ; break ; } running_result }) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: semicolon , TokenKind :: Semicolon)) ; break ; } running_result } . with_kind (RuleKind :: TupleDeconstructionStatement) + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::open_paren, + TokenKind::OpenParen, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result( + transform_option_result(self.tuple_members_list(stream)), + ) { + break; + } + running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::close_paren, + TokenKind::CloseParen, + ), + ); + break; + } + running_result + }) { + break; + } + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia(stream, &Self::equal, TokenKind::Equal), + ) { + break; + } + running_result.incorporate_sequence_result(self.expression(stream)); + break; + } + running_result + }) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::semicolon, + TokenKind::Semicolon, + )); + break; + } + running_result + } + .with_kind(RuleKind::TupleDeconstructionStatement) } - // TupleExpression = OPEN_PAREN Expression? (COMMA Expression?)* CLOSE_PAREN; + // TupleExpression = OPEN_PAREN TupleValuesList CLOSE_PAREN; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -7502,53 +7618,157 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result({ + if !running_result.incorporate_sequence_result(self.tuple_values_list(stream)) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_paren, + TokenKind::CloseParen, + )); + break; + } + running_result + } + .with_kind(RuleKind::TupleExpression) + } + + // TupleMember = ((TypeName «DataLocation»? IDENTIFIER) | («DataLocation»? IDENTIFIER))?; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn tuple_member(&self, stream: &mut Stream) -> ParserResult { + transform_option_result({ + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); loop { + if !running_result.incorporate_sequence_result(self.type_name(stream)) { + break; + } if !running_result.incorporate_sequence_result(transform_option_result( - self.expression(stream), + self.data_location(stream), )) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - transform_option_result(self.expression(stream)), - ); - break; - } - running_result - }) {} - running_result - }); + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )); break; } running_result }) { break; } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_paren, - TokenKind::CloseParen, - )); + stream.set_position(start_position); + running_result.incorporate_choice_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(transform_option_result( + self.data_location(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )); + break; + } + running_result + }); + break; + } + running_result + }) + .with_kind(RuleKind::TupleMember) + } + + // TupleMembersList = TupleMember (COMMA TupleMember)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn tuple_members_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.tuple_member(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.tuple_member(stream)); + break; + } + running_result + }) {} + running_result + }); break; } running_result } - .with_kind(RuleKind::TupleExpression) + .with_kind(RuleKind::TupleMembersList) + } + + // TupleValuesList = Expression? (COMMA Expression?)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn tuple_values_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result + .incorporate_sequence_result(transform_option_result(self.expression(stream))) + { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result(transform_option_result( + self.expression(stream), + )); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::TupleValuesList) } // (* v0.5.3 *) @@ -7615,8 +7835,8 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // TypeName = ArrayTypeName | FunctionType | MappingType | ElementaryType | IdentifierPath; - // ArrayTypeName = TypeName OPEN_BRACKET Expression? CLOSE_BRACKET; + // TypeName = ArrayTypeName | FunctionType | MappingType | «ElementaryType» | IdentifierPath; + // ArrayTypeName = TypeName «ArrayTypeNameOperator»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -7640,55 +7860,25 @@ impl Language { stream.set_position(start_position); if running_result .incorporate_choice_result(self.elementary_type(stream)) - { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.identifier_path(stream)); - break; - } - running_result - }; - if result.is_match() { - elements.push(result); - } else { - break result; - } - } - let result = loop { - let result = { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_bracket, - TokenKind::OpenBracket, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result(transform_option_result( - self.expression(stream), - )) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::close_bracket, - TokenKind::CloseBracket, - ), - ); + { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.identifier_path(stream)); break; } running_result + }; + if result.is_match() { + elements.push(result); + } else { + break result; } - .to_pratt_element_operator( - RuleKind::ArrayTypeName, - 1u8, - 255, - ); + } + let result = loop { + let result = self + .array_type_name_operator(stream) + .to_pratt_element_operator(RuleKind::ArrayTypeName, 1u8, 255); match result { ParserResult::PrattOperatorMatch(_) => elements.push(result), _ => break result, @@ -7731,7 +7921,7 @@ impl Language { .with_kind(RuleKind::TypeName) } - // UnaryPostfixOperator = PLUS_PLUS | MINUS_MINUS; + // «UnaryPostfixOperator» = PLUS_PLUS | MINUS_MINUS; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -7757,16 +7947,15 @@ impl Language { } running_result } - .with_kind(RuleKind::UnaryPostfixOperator) } // (* v0.4.11 *) - // UnaryPrefixOperator = PLUS_PLUS - // | MINUS_MINUS - // | TILDE - // | BANG - // | MINUS - // | PLUS; + // «UnaryPrefixOperator» = PLUS_PLUS + // | MINUS_MINUS + // | TILDE + // | BANG + // | MINUS + // | PLUS; #[allow(dead_code, non_snake_case)] fn unary_prefix_operator__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -7823,15 +8012,14 @@ impl Language { } running_result } - .with_kind(RuleKind::UnaryPrefixOperator) } // (* v0.5.0 *) - // UnaryPrefixOperator = PLUS_PLUS - // | MINUS_MINUS - // | TILDE - // | BANG - // | MINUS; + // «UnaryPrefixOperator» = PLUS_PLUS + // | MINUS_MINUS + // | TILDE + // | BANG + // | MINUS; #[allow(dead_code, non_snake_case)] fn unary_prefix_operator__0_5_0(&self, stream: &mut Stream) -> ParserResult { @@ -7880,7 +8068,6 @@ impl Language { } running_result } - .with_kind(RuleKind::UnaryPrefixOperator) } pub(crate) fn unary_prefix_operator(&self, stream: &mut Stream) -> ParserResult { @@ -7932,13 +8119,48 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } + // (* v0.7.0 *) + // UnicodeStringLiteralsList = UNICODE_STRING_LITERAL+; + + #[allow(dead_code, non_snake_case)] + fn unicode_string_literals_list__0_7_0(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.parse_token_with_trivia( + stream, + &Self::unicode_string_literal, + TokenKind::UnicodeStringLiteral, + )) {} + running_result + } + .with_kind(RuleKind::UnicodeStringLiteralsList) + } + + #[allow(non_snake_case)] + pub(crate) fn unicode_string_literals_list__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_7_0 { + Some(self.unicode_string_literals_list__0_7_0(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn unicode_string_literals_list(&self, stream: &mut Stream) -> ParserResult { + self.unicode_string_literals_list__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + // (* v0.4.11 *) - // UnnamedFunctionAttribute = ModifierInvocation - // | OverrideSpecifier - // | EXTERNAL_KEYWORD - // | PAYABLE_KEYWORD - // | PURE_KEYWORD - // | VIEW_KEYWORD; + // «UnnamedFunctionAttribute» = ModifierInvocation + // | OverrideSpecifier + // | EXTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | PURE_KEYWORD + // | VIEW_KEYWORD; #[allow(dead_code, non_snake_case)] fn unnamed_function_attribute__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -7987,7 +8209,6 @@ impl Language { } running_result } - .with_kind(RuleKind::UnnamedFunctionAttribute) } #[allow(non_snake_case)] @@ -8009,7 +8230,41 @@ impl Language { } // (* v0.4.11 *) - // UnnamedFunctionDefinition = FUNCTION_KEYWORD ParameterList UnnamedFunctionAttribute* (SEMICOLON | Block); + // UnnamedFunctionAttributesList = «UnnamedFunctionAttribute»+; + + #[allow(dead_code, non_snake_case)] + fn unnamed_function_attributes_list__0_4_11(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result + .incorporate_one_or_more_result(self.unnamed_function_attribute(stream)) + { + } + running_result + } + .with_kind(RuleKind::UnnamedFunctionAttributesList) + } + + #[allow(non_snake_case)] + pub(crate) fn unnamed_function_attributes_list__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_6_0 { + None + } else { + Some(self.unnamed_function_attributes_list__0_4_11(stream)) + } + } + + #[inline] + pub(crate) fn unnamed_function_attributes_list(&self, stream: &mut Stream) -> ParserResult { + self.unnamed_function_attributes_list__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // (* v0.4.11 *) + // UnnamedFunctionDefinition = FUNCTION_KEYWORD ParametersDeclaration UnnamedFunctionAttributesList? (SEMICOLON | Block); #[allow(dead_code, non_snake_case)] fn unnamed_function_definition__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -8023,17 +8278,13 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(self.parameter_list(stream)) { + if !running_result.incorporate_sequence_result(self.parameters_declaration(stream)) + { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.unnamed_function_attribute(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.unnamed_function_attributes_list(stream), + )) { break; } running_result.incorporate_sequence_result({ @@ -8070,33 +8321,234 @@ impl Language { } else { Some(self.unnamed_function_definition__0_4_11(stream)) } - } - - #[inline] - pub(crate) fn unnamed_function_definition(&self, stream: &mut Stream) -> ParserResult { - self.unnamed_function_definition__sparse_dispatch(stream) - .expect("Validation should have checked that references are valid between versions") + } + + #[inline] + pub(crate) fn unnamed_function_definition(&self, stream: &mut Stream) -> ParserResult { + self.unnamed_function_definition__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // (* v0.8.8 *) + // UserDefinedValueTypeDefinition = TYPE_KEYWORD IDENTIFIER IS_KEYWORD «ElementaryType» SEMICOLON; + + #[allow(dead_code, non_snake_case)] + fn user_defined_value_type_definition__0_8_8(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::type_keyword, + TokenKind::TypeKeyword, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::is_keyword, + TokenKind::IsKeyword, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.elementary_type(stream)); + break; + } + running_result + }) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::semicolon, + TokenKind::Semicolon, + )); + break; + } + running_result + } + .with_kind(RuleKind::UserDefinedValueTypeDefinition) + } + + #[allow(non_snake_case)] + pub(crate) fn user_defined_value_type_definition__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_8_8 { + Some(self.user_defined_value_type_definition__0_8_8(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn user_defined_value_type_definition(&self, stream: &mut Stream) -> ParserResult { + self.user_defined_value_type_definition__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // UsingDirective = USING_KEYWORD (UsingDirectivePath | UsingDirectiveDeconstruction) FOR_KEYWORD (ASTERISK | TypeName) GLOBAL_KEYWORD? SEMICOLON; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn using_directive(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::using_keyword, + TokenKind::UsingKeyword, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result + .incorporate_choice_result(self.using_directive_path(stream)) + { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result( + self.using_directive_deconstruction(stream), + ); + break; + } + running_result + }) { + break; + } + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::for_keyword, + TokenKind::ForKeyword, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result( + self.parse_token_with_trivia( + stream, + &Self::asterisk, + TokenKind::Asterisk, + ), + ) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.type_name(stream)); + break; + } + running_result + }) { + break; + } + running_result.incorporate_sequence_result(transform_option_result( + self.parse_token_with_trivia( + stream, + &Self::global_keyword, + TokenKind::GlobalKeyword, + ), + )); + break; + } + running_result + }) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::semicolon, + TokenKind::Semicolon, + )); + break; + } + running_result + } + .with_kind(RuleKind::UsingDirective) + } + + // UsingDirectiveDeconstruction = OPEN_BRACE UsingDirectiveSymbolsList CLOSE_BRACE; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn using_directive_deconstruction(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::open_brace, + TokenKind::OpenBrace, + )) { + break; + } + if !running_result + .incorporate_sequence_result(self.using_directive_symbols_list(stream)) + { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_brace, + TokenKind::CloseBrace, + )); + break; + } + running_result + } + .with_kind(RuleKind::UsingDirectiveDeconstruction) } // (* v0.8.19 *) - // UserDefinedOperator = AMPERSAND - // | BANG_EQUAL - // | BAR - // | CARET - // | EQUAL_EQUAL - // | GREATER_THAN - // | GREATER_THAN_EQUAL - // | LESS_THAN - // | LESS_THAN_EQUAL - // | MINUS - // | PERCENT - // | PLUS - // | SLASH - // | ASTERISK - // | TILDE; + // «UsingDirectiveOperator» = AMPERSAND + // | ASTERISK + // | BANG_EQUAL + // | BAR + // | CARET + // | EQUAL_EQUAL + // | GREATER_THAN + // | GREATER_THAN_EQUAL + // | LESS_THAN + // | LESS_THAN_EQUAL + // | MINUS + // | PERCENT + // | PLUS + // | SLASH + // | TILDE; #[allow(dead_code, non_snake_case)] - fn user_defined_operator__0_8_19(&self, stream: &mut Stream) -> ParserResult { + fn using_directive_operator__0_8_19(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); @@ -8109,6 +8561,14 @@ impl Language { break; } stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::asterisk, + TokenKind::Asterisk, + )) { + break; + } + stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::bang_equal, @@ -8205,14 +8665,6 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::asterisk, - TokenKind::Asterisk, - )) { - break; - } - stream.set_position(start_position); running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::tilde, @@ -8222,398 +8674,223 @@ impl Language { } running_result } - .with_kind(RuleKind::UserDefinedOperator) } #[allow(non_snake_case)] - pub(crate) fn user_defined_operator__sparse_dispatch( + pub(crate) fn using_directive_operator__sparse_dispatch( &self, stream: &mut Stream, ) -> Option { if self.version_is_equal_to_or_greater_than_0_8_19 { - Some(self.user_defined_operator__0_8_19(stream)) + Some(self.using_directive_operator__0_8_19(stream)) } else { None } } #[inline] - pub(crate) fn user_defined_operator(&self, stream: &mut Stream) -> ParserResult { - self.user_defined_operator__sparse_dispatch(stream) + pub(crate) fn using_directive_operator(&self, stream: &mut Stream) -> ParserResult { + self.using_directive_operator__sparse_dispatch(stream) .expect("Validation should have checked that references are valid between versions") } - // (* v0.8.8 *) - // UserDefinedValueTypeDefinition = TYPE_KEYWORD IDENTIFIER IS_KEYWORD ElementaryType SEMICOLON; + // UsingDirectivePath = IdentifierPath; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn using_directive_path(&self, stream: &mut Stream) -> ParserResult { + self.identifier_path(stream) + .with_kind(RuleKind::UsingDirectivePath) + } + + // (* v0.4.11 *) + // UsingDirectiveSymbol = IdentifierPath; #[allow(dead_code, non_snake_case)] - fn user_defined_value_type_definition__0_8_8(&self, stream: &mut Stream) -> ParserResult { + fn using_directive_symbol__0_4_11(&self, stream: &mut Stream) -> ParserResult { + self.identifier_path(stream) + .with_kind(RuleKind::UsingDirectiveSymbol) + } + + // (* v0.8.19 *) + // UsingDirectiveSymbol = IdentifierPath (AS_KEYWORD «UsingDirectiveOperator»)?; + + #[allow(dead_code, non_snake_case)] + fn using_directive_symbol__0_8_19(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result({ + if !running_result.incorporate_sequence_result(self.identifier_path(stream)) { + break; + } + running_result.incorporate_sequence_result(transform_option_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); loop { if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::type_keyword, - TokenKind::TypeKeyword, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::is_keyword, - TokenKind::IsKeyword, + &Self::as_keyword, + TokenKind::AsKeyword, ), ) { break; } - running_result.incorporate_sequence_result(self.elementary_type(stream)); + running_result + .incorporate_sequence_result(self.using_directive_operator(stream)); break; } running_result - }) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::semicolon, - TokenKind::Semicolon, - )); + })); break; } running_result } - .with_kind(RuleKind::UserDefinedValueTypeDefinition) + .with_kind(RuleKind::UsingDirectiveSymbol) } - #[allow(non_snake_case)] - pub(crate) fn user_defined_value_type_definition__sparse_dispatch( - &self, - stream: &mut Stream, - ) -> Option { - if self.version_is_equal_to_or_greater_than_0_8_8 { - Some(self.user_defined_value_type_definition__0_8_8(stream)) + pub(crate) fn using_directive_symbol(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_8_19 { + self.using_directive_symbol__0_8_19(stream) } else { - None + self.using_directive_symbol__0_4_11(stream) } } - #[inline] - pub(crate) fn user_defined_value_type_definition(&self, stream: &mut Stream) -> ParserResult { - self.user_defined_value_type_definition__sparse_dispatch(stream) - .expect("Validation should have checked that references are valid between versions") - } - - // (* v0.4.11 *) - // UsingDirective = USING_KEYWORD (IdentifierPath | (OPEN_BRACE IdentifierPath (COMMA IdentifierPath)* CLOSE_BRACE)) FOR_KEYWORD (ASTERISK | TypeName) GLOBAL_KEYWORD? SEMICOLON; + // UsingDirectiveSymbolsList = UsingDirectiveSymbol (COMMA UsingDirectiveSymbol)*; - #[allow(dead_code, non_snake_case)] - fn using_directive__0_4_11(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn using_directive_symbols_list(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result({ + if !running_result.incorporate_sequence_result(self.using_directive_symbol(stream)) + { + break; + } + running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::using_keyword, - TokenKind::UsingKeyword, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result - .incorporate_choice_result(self.identifier_path(stream)) - { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_brace, - TokenKind::OpenBrace, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.identifier_path(stream), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match( - vec![], - vec![], - ); - loop { - if !running_result - .incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result - .incorporate_sequence_result( - self.identifier_path( - stream, - ), - ); - break; - } - running_result - }) - { - } - running_result - }); - break; - } - running_result - }) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::close_brace, - TokenKind::CloseBrace, - ), - ); - break; - } - running_result - }); - break; - } - running_result - }) { - break; - } - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::for_keyword, - TokenKind::ForKeyword, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::asterisk, - TokenKind::Asterisk, - ), - ) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.type_name(stream)); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { break; } running_result - }) { + .incorporate_sequence_result(self.using_directive_symbol(stream)); break; } - running_result.incorporate_sequence_result(transform_option_result( - self.parse_token_with_trivia( - stream, - &Self::global_keyword, - TokenKind::GlobalKeyword, - ), - )); - break; - } + running_result + }) {} running_result - }) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::semicolon, - TokenKind::Semicolon, - )); + }); break; } running_result } - .with_kind(RuleKind::UsingDirective) - } - - // (* v0.8.19 *) - // UsingDirective = USING_KEYWORD (IdentifierPath | (OPEN_BRACE IdentifierPath (AS_KEYWORD UserDefinedOperator)? (COMMA IdentifierPath (AS_KEYWORD UserDefinedOperator)?)* CLOSE_BRACE)) FOR_KEYWORD (ASTERISK | TypeName) GLOBAL_KEYWORD? SEMICOLON; - - #[allow(dead_code, non_snake_case)] - fn using_directive__0_8_19(&self, stream: &mut Stream) -> ParserResult { - { let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: using_keyword , TokenKind :: UsingKeyword)) { break ; } if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: no_match (vec ! []) ; let start_position = stream . position () ; loop { if running_result . incorporate_choice_result (self . identifier_path (stream)) { break ; } stream . set_position (start_position) ; running_result . incorporate_choice_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: open_brace , TokenKind :: OpenBrace)) { break ; } if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . identifier_path (stream)) { break ; } running_result . incorporate_sequence_result (transform_option_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: as_keyword , TokenKind :: AsKeyword)) { break ; } running_result . incorporate_sequence_result (self . user_defined_operator (stream)) ; break ; } running_result })) ; break ; } running_result }) { break ; } running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; while running_result . incorporate_zero_or_more_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: comma , TokenKind :: Comma)) { break ; } running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . identifier_path (stream)) { break ; } running_result . incorporate_sequence_result (transform_option_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: as_keyword , TokenKind :: AsKeyword)) { break ; } running_result . incorporate_sequence_result (self . user_defined_operator (stream)) ; break ; } running_result })) ; break ; } running_result }) ; break ; } running_result }) { } running_result }) ; break ; } running_result }) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: close_brace , TokenKind :: CloseBrace)) ; break ; } running_result }) ; break ; } running_result }) { break ; } if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: for_keyword , TokenKind :: ForKeyword)) { break ; } if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: no_match (vec ! []) ; let start_position = stream . position () ; loop { if running_result . incorporate_choice_result (self . parse_token_with_trivia (stream , & Self :: asterisk , TokenKind :: Asterisk)) { break ; } stream . set_position (start_position) ; running_result . incorporate_choice_result (self . type_name (stream)) ; break ; } running_result }) { break ; } running_result . incorporate_sequence_result (transform_option_result (self . parse_token_with_trivia (stream , & Self :: global_keyword , TokenKind :: GlobalKeyword))) ; break ; } running_result }) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: semicolon , TokenKind :: Semicolon)) ; break ; } running_result } . with_kind (RuleKind :: UsingDirective) - } - - pub(crate) fn using_directive(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_8_19 { - self.using_directive__0_8_19(stream) - } else { - self.using_directive__0_4_11(stream) - } + .with_kind(RuleKind::UsingDirectiveSymbolsList) } // (* v0.4.11 *) - // VariableDeclarationStatement = ((TypeName DataLocation?) | VAR_KEYWORD) IDENTIFIER (EQUAL Expression)? SEMICOLON; + // VariableDeclaration = (VAR_KEYWORD | TypeName) «DataLocation»? IDENTIFIER; #[allow(dead_code, non_snake_case)] - fn variable_declaration_statement__0_4_11(&self, stream: &mut Stream) -> ParserResult { + fn variable_declaration__0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result(self.type_name(stream)) - { - break; - } - running_result.incorporate_sequence_result( - transform_option_result(self.data_location(stream)), - ); - break; - } - running_result - }) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::var_keyword, - TokenKind::VarKeyword, - ), - ); - break; - } - running_result - }) { - break; - } - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ) { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::var_keyword, + TokenKind::VarKeyword, + )) { break; } - running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::equal, - TokenKind::Equal, - ), - ) { - break; - } - running_result.incorporate_sequence_result(self.expression(stream)); - break; - } - running_result - })); + stream.set_position(start_position); + running_result.incorporate_choice_result(self.type_name(stream)); break; } running_result }) { break; } + if !running_result.incorporate_sequence_result(transform_option_result( + self.data_location(stream), + )) { + break; + } running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::semicolon, - TokenKind::Semicolon, + &Self::identifier, + TokenKind::Identifier, )); break; } running_result } - .with_kind(RuleKind::VariableDeclarationStatement) + .with_kind(RuleKind::VariableDeclaration) } // (* v0.5.0 *) - // VariableDeclarationStatement = TypeName DataLocation? IDENTIFIER (EQUAL Expression)? SEMICOLON; + // VariableDeclaration = TypeName «DataLocation»? IDENTIFIER; #[allow(dead_code, non_snake_case)] - fn variable_declaration_statement__0_5_0(&self, stream: &mut Stream) -> ParserResult { + fn variable_declaration__0_5_0(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.type_name(stream)) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.data_location(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )); + break; + } + running_result + } + .with_kind(RuleKind::VariableDeclaration) + } + + pub(crate) fn variable_declaration(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_5_0 { + self.variable_declaration__0_5_0(stream) + } else { + self.variable_declaration__0_4_11(stream) + } + } + + // VariableDeclarationStatement = VariableDeclaration (EQUAL Expression)? SEMICOLON; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn variable_declaration_statement(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { if !running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result(self.type_name(stream)) { - break; - } - if !running_result.incorporate_sequence_result(transform_option_result( - self.data_location(stream), - )) { - break; - } - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ) { + if !running_result + .incorporate_sequence_result(self.variable_declaration(stream)) + { break; } running_result.incorporate_sequence_result(transform_option_result({ @@ -8651,16 +8928,7 @@ impl Language { .with_kind(RuleKind::VariableDeclarationStatement) } - pub(crate) fn variable_declaration_statement(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_5_0 { - self.variable_declaration_statement__0_5_0(stream) - } else { - self.variable_declaration_statement__0_4_11(stream) - } - } - - // VersionPragma = SOLIDITY_KEYWORD VersionPragmaExpressionList; - // VersionPragmaExpressionList = «VersionPragmaExpression»+; + // VersionPragma = SOLIDITY_KEYWORD VersionPragmaExpressionsList; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -8675,14 +8943,8 @@ impl Language { )) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_one_or_more_result(self.version_pragma_expression(stream)) - { - } - running_result.with_kind(RuleKind::VersionPragmaExpressionList) - }); + running_result + .incorporate_sequence_result(self.version_pragma_expressions_list(stream)); break; } running_result @@ -8690,13 +8952,12 @@ impl Language { .with_kind(RuleKind::VersionPragma) } - // «VersionPragmaExpression» = VersionPragmaAlternatives - // | VersionPragmaRange - // | VersionPragmaComparator - // | VersionPragmaSpecifier; - // VersionPragmaAlternatives = «VersionPragmaExpression» BAR_BAR «VersionPragmaExpression»; - // VersionPragmaRange = «VersionPragmaExpression» MINUS «VersionPragmaExpression»; - // VersionPragmaComparator = (CARET | TILDE | EQUAL | LESS_THAN | GREATER_THAN | LESS_THAN_EQUAL | GREATER_THAN_EQUAL) «VersionPragmaExpression»; + // VersionPragmaExpression = VersionPragmaBinaryExpression + // | VersionPragmaUnaryExpression + // | VersionPragmaSpecifier; + // VersionPragmaBinaryExpression = VersionPragmaExpression «VersionPragmaOrOperator» VersionPragmaExpression; + // VersionPragmaBinaryExpression = VersionPragmaExpression «VersionPragmaRangeOperator» VersionPragmaExpression; + // VersionPragmaUnaryExpression = «VersionPragmaUnaryOperator» VersionPragmaExpression; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -8705,84 +8966,13 @@ impl Language { let mut elements: Vec = Vec::new(); let result = loop { let result = loop { - let result = { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::caret, - TokenKind::Caret, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::tilde, - TokenKind::Tilde, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::equal, - TokenKind::Equal, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::less_than, - TokenKind::LessThan, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::greater_than, - TokenKind::GreaterThan, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::less_than_equal, - TokenKind::LessThanEqual, - ), - ) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::greater_than_equal, - TokenKind::GreaterThanEqual, - )); - break; - } - running_result - } - .to_pratt_element_operator( - RuleKind::VersionPragmaComparator, - 255, - 5u8, - ); + let result = self + .version_pragma_unary_operator(stream) + .to_pratt_element_operator( + RuleKind::VersionPragmaUnaryExpression, + 255, + 5u8, + ); match result { ParserResult::PrattOperatorMatch(_) => elements.push(result), _ => break result, @@ -8806,9 +8996,9 @@ impl Language { let start_position = stream.position(); stream.set_position(start_position); let next_result = self - .parse_token_with_trivia(stream, &Self::bar_bar, TokenKind::BarBar) + .version_pragma_or_operator(stream) .to_pratt_element_operator( - RuleKind::VersionPragmaAlternatives, + RuleKind::VersionPragmaBinaryExpression, 1u8, 1u8 + 1, ); @@ -8821,8 +9011,12 @@ impl Language { } stream.set_position(start_position); let next_result = self - .parse_token_with_trivia(stream, &Self::minus, TokenKind::Minus) - .to_pratt_element_operator(RuleKind::VersionPragmaRange, 3u8, 3u8 + 1); + .version_pragma_range_operator(stream) + .to_pratt_element_operator( + RuleKind::VersionPragmaBinaryExpression, + 3u8, + 3u8 + 1, + ); match next_result { ParserResult::PrattOperatorMatch(_) => break next_result, ParserResult::Match(_) => unreachable!( @@ -8841,7 +9035,10 @@ impl Language { if elements.is_empty() { break result; } - reduce_pratt_elements(|children| children, &mut elements); + reduce_pratt_elements( + |children| vec![cst::Node::rule(RuleKind::VersionPragmaExpression, children)], + &mut elements, + ); if elements.len() != 1 { unreachable!( "Pratt parser failed to reduce to a single result: {:?}", @@ -8861,6 +9058,39 @@ impl Language { unreachable!("Pratt parser failed to reduce to a single match") } } + .with_kind(RuleKind::VersionPragmaExpression) + } + + // VersionPragmaExpressionsList = VersionPragmaExpression+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn version_pragma_expressions_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result + .incorporate_one_or_more_result(self.version_pragma_expression(stream)) + { + } + running_result + } + .with_kind(RuleKind::VersionPragmaExpressionsList) + } + + // «VersionPragmaOrOperator» = BAR_BAR; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn version_pragma_or_operator(&self, stream: &mut Stream) -> ParserResult { + self.parse_token_with_trivia(stream, &Self::bar_bar, TokenKind::BarBar) + } + + // «VersionPragmaRangeOperator» = MINUS; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn version_pragma_range_operator(&self, stream: &mut Stream) -> ParserResult { + self.parse_token_with_trivia(stream, &Self::minus, TokenKind::Minus) } // VersionPragmaSpecifier = VERSION_PRAGMA_VALUE (PERIOD VERSION_PRAGMA_VALUE)*; @@ -8878,38 +9108,112 @@ impl Language { )) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::period, - TokenKind::Period, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::version_pragma_value, - TokenKind::VersionPragmaValue, - ), - ); - break; - } - running_result - }) {} - running_result - }); + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::period, + TokenKind::Period, + ), + ) { + break; + } + running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::version_pragma_value, + TokenKind::VersionPragmaValue, + ), + ); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::VersionPragmaSpecifier) + } + + // «VersionPragmaUnaryOperator» = CARET + // | TILDE + // | EQUAL + // | LESS_THAN + // | GREATER_THAN + // | LESS_THAN_EQUAL + // | GREATER_THAN_EQUAL; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn version_pragma_unary_operator(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::caret, + TokenKind::Caret, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::tilde, + TokenKind::Tilde, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::equal, + TokenKind::Equal, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::less_than, + TokenKind::LessThan, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::greater_than, + TokenKind::GreaterThan, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::less_than_equal, + TokenKind::LessThanEqual, + )) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::greater_than_equal, + TokenKind::GreaterThanEqual, + )); break; } running_result } - .with_kind(RuleKind::VersionPragmaSpecifier) } // WhileStatement = WHILE_KEYWORD OPEN_PAREN Expression CLOSE_PAREN Statement; @@ -8961,7 +9265,7 @@ impl Language { .with_kind(RuleKind::WhileStatement) } - // YulAssignmentStatement = YulIdentifierPath (COMMA YulIdentifierPath)* COLON_EQUAL YulExpression; + // YulAssignmentStatement = YulIdentifierPathsList COLON_EQUAL YulExpression; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -8969,41 +9273,9 @@ impl Language { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result(self.yul_identifier_path(stream)) - { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.yul_identifier_path(stream), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - }) { + if !running_result + .incorporate_sequence_result(self.yul_identifier_paths_list(stream)) + { break; } if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -9021,7 +9293,7 @@ impl Language { .with_kind(RuleKind::YulAssignmentStatement) } - // YulBlock = OPEN_BRACE YulStatement* CLOSE_BRACE; + // YulBlock = OPEN_BRACE YulStatementsList? CLOSE_BRACE; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -9036,13 +9308,9 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result(self.yul_statement(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.yul_statements_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -9075,7 +9343,7 @@ impl Language { .with_kind(RuleKind::YulContinueStatement) } - // YulDeclarationStatement = LET_KEYWORD YulIdentifierPath (COMMA YulIdentifierPath)* (COLON_EQUAL YulExpression)?; + // YulDeclarationStatement = LET_KEYWORD YulIdentifierPathsList (COLON_EQUAL YulExpression)?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -9090,41 +9358,9 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result(self.yul_identifier_path(stream)) - { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.yul_identifier_path(stream), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - }) { + if !running_result + .incorporate_sequence_result(self.yul_identifier_paths_list(stream)) + { break; } running_result.incorporate_sequence_result(transform_option_result({ @@ -9151,8 +9387,8 @@ impl Language { .with_kind(RuleKind::YulDeclarationStatement) } - // YulExpression = YulFunctionCallExpression | YulLiteral | YulIdentifierPath; - // YulFunctionCallExpression = YulExpression OPEN_PAREN (YulExpression (COMMA YulExpression)*)? CLOSE_PAREN; + // YulExpression = YulFunctionCallExpression | «YulLiteral» | YulIdentifierPath; + // YulFunctionCallExpression = YulExpression «YulFunctionCallOperator»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -9182,75 +9418,9 @@ impl Language { } } let result = loop { - let result = { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_paren, - TokenKind::OpenParen, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result(transform_option_result( - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.yul_expression(stream), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.yul_expression(stream), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - }, - )) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::close_paren, - TokenKind::CloseParen, - ), - ); - break; - } - running_result - } - .to_pratt_element_operator( - RuleKind::YulFunctionCallExpression, - 1u8, - 255, - ); + let result = self + .yul_function_call_operator(stream) + .to_pratt_element_operator(RuleKind::YulFunctionCallExpression, 1u8, 255); match result { ParserResult::PrattOperatorMatch(_) => elements.push(result), _ => break result, @@ -9293,6 +9463,45 @@ impl Language { .with_kind(RuleKind::YulExpression) } + // YulExpressionsList = YulExpression (COMMA YulExpression)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_expressions_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.yul_expression(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.yul_expression(stream)); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::YulExpressionsList) + } + // YulForStatement = FOR_KEYWORD YulBlock YulExpression YulBlock YulBlock; #[allow(dead_code)] @@ -9325,9 +9534,38 @@ impl Language { .with_kind(RuleKind::YulForStatement) } - // YulFunctionDefinition = FUNCTION_KEYWORD YUL_IDENTIFIER OPEN_PAREN Arguments? CLOSE_PAREN (MINUS_GREATER_THAN Results)? YulBlock; - // Arguments = YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*; - // Results = YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*; + // «YulFunctionCallOperator» = OPEN_PAREN YulExpressionsList? CLOSE_PAREN; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_function_call_operator(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::open_paren, + TokenKind::OpenParen, + )) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.yul_expressions_list(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_paren, + TokenKind::CloseParen, + )); + break; + } + running_result + } + } + + // YulFunctionDefinition = FUNCTION_KEYWORD YUL_IDENTIFIER YulParametersDeclaration YulReturnsDeclaration? YulBlock; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -9349,150 +9587,118 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result({ + if !running_result + .incorporate_sequence_result(self.yul_parameters_declaration(stream)) + { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.yul_returns_declaration(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.yul_block(stream)); + break; + } + running_result + } + .with_kind(RuleKind::YulFunctionDefinition) + } + + // YulIdentifierPath = YUL_IDENTIFIER (PERIOD YUL_IDENTIFIER)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_identifier_path(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::yul_identifier, + TokenKind::YulIdentifier, + )) { + break; + } + running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_paren, - TokenKind::OpenParen, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::yul_identifier, - TokenKind::YulIdentifier, - ), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::yul_identifier, - TokenKind::YulIdentifier, - ), - ); - break; - } - running_result - }) {} - running_result - }); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::period, + TokenKind::Period, + ), + ) { break; } - running_result.with_kind(RuleKind::Arguments) - })) { + running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::yul_identifier, + TokenKind::YulIdentifier, + ), + ); break; } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_paren, - TokenKind::CloseParen, - )); - break; - } + running_result + }) {} running_result - }) { + }); + break; + } + running_result + } + .with_kind(RuleKind::YulIdentifierPath) + } + + // YulIdentifierPathsList = YulIdentifierPath (COMMA YulIdentifierPath)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_identifier_paths_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.yul_identifier_path(stream)) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ + running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::minus_greater_than, - TokenKind::MinusGreaterThan, - ), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::yul_identifier, - TokenKind::YulIdentifier, - ), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::yul_identifier, - TokenKind::YulIdentifier, - ), - ); - break; - } - running_result - }) {} - running_result - }); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { break; } - running_result.with_kind(RuleKind::Results) - }); - break; - } + running_result + .incorporate_sequence_result(self.yul_identifier_path(stream)); + break; + } + running_result + }) {} running_result - })) { - break; - } - running_result.incorporate_sequence_result(self.yul_block(stream)); + }); break; } running_result } - .with_kind(RuleKind::YulFunctionDefinition) + .with_kind(RuleKind::YulIdentifierPathsList) } - // YulIdentifierPath = YUL_IDENTIFIER (PERIOD YUL_IDENTIFIER)*; + // YulIdentifiersList = YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn yul_identifier_path(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn yul_identifiers_list(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -9511,8 +9717,8 @@ impl Language { if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::period, - TokenKind::Period, + &Self::comma, + TokenKind::Comma, ), ) { break; @@ -9534,7 +9740,7 @@ impl Language { } running_result } - .with_kind(RuleKind::YulIdentifierPath) + .with_kind(RuleKind::YulIdentifiersList) } // YulIfStatement = IF_KEYWORD YulExpression YulBlock; @@ -9590,11 +9796,12 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // YulLiteral = BooleanLiteral - // | YUL_HEX_LITERAL - // | YUL_DECIMAL_LITERAL - // | HEX_STRING_LITERAL - // | ASCII_STRING_LITERAL; + // «YulLiteral» = TRUE_KEYWORD + // | FALSE_KEYWORD + // | YUL_HEX_LITERAL + // | YUL_DECIMAL_LITERAL + // | HEX_STRING_LITERAL + // | ASCII_STRING_LITERAL; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -9603,7 +9810,19 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result(self.boolean_literal(stream)) { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::true_keyword, + TokenKind::TrueKeyword, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::false_keyword, + TokenKind::FalseKeyword, + )) { break; } stream.set_position(start_position); @@ -9640,7 +9859,61 @@ impl Language { } running_result } - .with_kind(RuleKind::YulLiteral) + } + + // YulParametersDeclaration = OPEN_PAREN YulIdentifiersList? CLOSE_PAREN; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_parameters_declaration(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::open_paren, + TokenKind::OpenParen, + )) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.yul_identifiers_list(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_paren, + TokenKind::CloseParen, + )); + break; + } + running_result + } + .with_kind(RuleKind::YulParametersDeclaration) + } + + // YulReturnsDeclaration = MINUS_GREATER_THAN YulIdentifiersList; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_returns_declaration(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::minus_greater_than, + TokenKind::MinusGreaterThan, + )) { + break; + } + running_result.incorporate_sequence_result(self.yul_identifiers_list(stream)); + break; + } + running_result + } + .with_kind(RuleKind::YulReturnsDeclaration) } // (* v0.4.11 *) @@ -9782,7 +10055,85 @@ impl Language { } } - // YulSwitchStatement = SWITCH_KEYWORD YulExpression (((CASE_KEYWORD YulLiteral) | DEFAULT_KEYWORD) YulBlock)+; + // YulStatementsList = YulStatement+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_statements_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.yul_statement(stream)) {} + running_result + } + .with_kind(RuleKind::YulStatementsList) + } + + // YulSwitchCase = (DEFAULT_KEYWORD | (CASE_KEYWORD «YulLiteral»)) YulBlock; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_switch_case(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::default_keyword, + TokenKind::DefaultKeyword, + )) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::case_keyword, + TokenKind::CaseKeyword, + ), + ) { + break; + } + running_result + .incorporate_sequence_result(self.yul_literal(stream)); + break; + } + running_result + }); + break; + } + running_result + }) { + break; + } + running_result.incorporate_sequence_result(self.yul_block(stream)); + break; + } + running_result + } + .with_kind(RuleKind::YulSwitchCase) + } + + // YulSwitchCasesList = YulSwitchCase+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_switch_cases_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.yul_switch_case(stream)) {} + running_result + } + .with_kind(RuleKind::YulSwitchCasesList) + } + + // YulSwitchStatement = SWITCH_KEYWORD YulExpression YulSwitchCasesList; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -9800,58 +10151,7 @@ impl Language { if !running_result.incorporate_sequence_result(self.yul_expression(stream)) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::case_keyword, - TokenKind::CaseKeyword, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.yul_literal(stream), - ); - break; - } - running_result - }) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::default_keyword, - TokenKind::DefaultKeyword, - ), - ); - break; - } - running_result - }) { - break; - } - running_result.incorporate_sequence_result(self.yul_block(stream)); - break; - } - running_result - }) {} - running_result - }); + running_result.incorporate_sequence_result(self.yul_switch_cases_list(stream)); break; } running_result diff --git a/crates/solidity/outputs/cargo/crate/src/generated/scanners.rs b/crates/solidity/outputs/cargo/crate/src/generated/scanners.rs index 557899db71..df72dfa83c 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/scanners.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/scanners.rs @@ -127,14 +127,14 @@ impl Language { ) } - // ASCII_ESCAPE = "n" - // | "r" - // | "t" - // | "'" - // | '"' - // | "\\" - // | "\n" - // | "\r"; + // «ASCII_ESCAPE» = "n" + // | "r" + // | "t" + // | "'" + // | '"' + // | "\\" + // | "\n" + // | "\r"; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -149,15 +149,23 @@ impl Language { || c == 't') } - // ASCII_STRING_LITERAL = SINGLE_QUOTED_ASCII_STRING_LITERAL | DOUBLE_QUOTED_ASCII_STRING_LITERAL; + // ASCII_STRING_LITERAL = «SINGLE_QUOTED_ASCII_STRING_LITERAL» | «DOUBLE_QUOTED_ASCII_STRING_LITERAL»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn ascii_string_literal(&self, stream: &mut Stream) -> bool { - scan_choice!( + scan_not_followed_by!( stream, - self.single_quoted_ascii_string_literal(stream), - self.double_quoted_ascii_string_literal(stream) + scan_choice!( + stream, + self.single_quoted_ascii_string_literal(stream), + self.double_quoted_ascii_string_literal(stream) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } @@ -282,10 +290,10 @@ impl Language { } // (* v0.4.11 *) - // BYTE_TYPE = "byte"; + // BYTE_KEYWORD = "byte"; #[allow(dead_code, non_snake_case)] - fn byte_type__0_4_11(&self, stream: &mut Stream) -> bool { + fn byte_keyword__0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, scan_chars!(stream, 'b', 'y', 't', 'e'), @@ -298,17 +306,17 @@ impl Language { } #[allow(non_snake_case)] - pub(crate) fn byte_type__sparse_dispatch(&self, stream: &mut Stream) -> Option { + pub(crate) fn byte_keyword__sparse_dispatch(&self, stream: &mut Stream) -> Option { if self.version_is_equal_to_or_greater_than_0_8_0 { None } else { - Some(self.byte_type__0_4_11(stream)) + Some(self.byte_keyword__0_4_11(stream)) } } #[inline] - pub(crate) fn byte_type(&self, stream: &mut Stream) -> bool { - self.byte_type__sparse_dispatch(stream) + pub(crate) fn byte_keyword(&self, stream: &mut Stream) -> bool { + self.byte_keyword__sparse_dispatch(stream) .expect("Validation should have checked that references are valid between versions") } @@ -549,7 +557,24 @@ impl Language { ) } - // DECIMAL_EXPONENT = ("e" | "E") "-"? DECIMAL_NUMBER; + // «DECIMAL_DIGITS» = "0"…"9"+ ("_" "0"…"9"+)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn decimal_digits(&self, stream: &mut Stream) -> bool { + scan_sequence!( + scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))), + scan_zero_or_more!( + stream, + scan_sequence!( + scan_chars!(stream, '_'), + scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))) + ) + ) + ) + } + + // «DECIMAL_EXPONENT» = ("e" | "E") "-"? «DECIMAL_DIGITS»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -557,52 +582,68 @@ impl Language { scan_sequence!( scan_predicate!(stream, |c| c == 'E' || c == 'e'), scan_optional!(stream, scan_chars!(stream, '-')), - self.decimal_number(stream) + self.decimal_digits(stream) ) } // (* v0.4.11 *) - // DECIMAL_LITERAL = ((DECIMAL_NUMBER ("." DECIMAL_NUMBER?)?) | ("." DECIMAL_NUMBER)) DECIMAL_EXPONENT?; + // DECIMAL_LITERAL = ((«DECIMAL_DIGITS» ("." «DECIMAL_DIGITS»?)?) | ("." «DECIMAL_DIGITS»)) «DECIMAL_EXPONENT»?; #[allow(dead_code, non_snake_case)] fn decimal_literal__0_4_11(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_choice!( - stream, - scan_sequence!( - self.decimal_number(stream), - scan_optional!( - stream, - scan_sequence!( - scan_chars!(stream, '.'), - scan_optional!(stream, self.decimal_number(stream)) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_choice!( + stream, + scan_sequence!( + self.decimal_digits(stream), + scan_optional!( + stream, + scan_sequence!( + scan_chars!(stream, '.'), + scan_optional!(stream, self.decimal_digits(stream)) + ) ) - ) + ), + scan_sequence!(scan_chars!(stream, '.'), self.decimal_digits(stream)) ), - scan_sequence!(scan_chars!(stream, '.'), self.decimal_number(stream)) + scan_optional!(stream, self.decimal_exponent(stream)) ), - scan_optional!(stream, self.decimal_exponent(stream)) + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } // (* v0.5.0 *) - // DECIMAL_LITERAL = ((DECIMAL_NUMBER ("." DECIMAL_NUMBER)?) | ("." DECIMAL_NUMBER)) DECIMAL_EXPONENT?; + // DECIMAL_LITERAL = ((«DECIMAL_DIGITS» ("." «DECIMAL_DIGITS»)?) | ("." «DECIMAL_DIGITS»)) «DECIMAL_EXPONENT»?; #[allow(dead_code, non_snake_case)] fn decimal_literal__0_5_0(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_choice!( - stream, - scan_sequence!( - self.decimal_number(stream), - scan_optional!( - stream, - scan_sequence!(scan_chars!(stream, '.'), self.decimal_number(stream)) - ) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_choice!( + stream, + scan_sequence!( + self.decimal_digits(stream), + scan_optional!( + stream, + scan_sequence!(scan_chars!(stream, '.'), self.decimal_digits(stream)) + ) + ), + scan_sequence!(scan_chars!(stream, '.'), self.decimal_digits(stream)) ), - scan_sequence!(scan_chars!(stream, '.'), self.decimal_number(stream)) + scan_optional!(stream, self.decimal_exponent(stream)) ), - scan_optional!(stream, self.decimal_exponent(stream)) + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } @@ -614,23 +655,6 @@ impl Language { } } - // DECIMAL_NUMBER = "0"…"9"+ ("_" "0"…"9"+)*; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn decimal_number(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))), - scan_zero_or_more!( - stream, - scan_sequence!( - scan_chars!(stream, '_'), - scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))) - ) - ) - ) - } - // DEFAULT_KEYWORD = "default"; #[allow(dead_code)] @@ -679,7 +703,7 @@ impl Language { ) } - // DOUBLE_QUOTED_ASCII_STRING_LITERAL = '"' (ESCAPE_SEQUENCE | (" "…"~" - ('"' | "\\")))* '"'; + // «DOUBLE_QUOTED_ASCII_STRING_LITERAL» = '"' («ESCAPE_SEQUENCE» | (" "…"~" - ('"' | "\\")))* '"'; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -700,8 +724,21 @@ impl Language { ) } + // «DOUBLE_QUOTED_HEX_STRING_LITERAL» = "hex" '"' «HEX_STRING_CONTENTS»? '"'; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn double_quoted_hex_string_literal(&self, stream: &mut Stream) -> bool { + scan_sequence!( + scan_chars!(stream, 'h', 'e', 'x'), + scan_chars!(stream, '"'), + scan_optional!(stream, self.hex_string_contents(stream)), + scan_chars!(stream, '"') + ) + } + // (* v0.7.0 *) - // DOUBLE_QUOTED_UNICODE_STRING_LITERAL = 'unicode"' (ESCAPE_SEQUENCE | !('"' | "\\" | "\n" | "\r"))* '"'; + // «DOUBLE_QUOTED_UNICODE_STRING_LITERAL» = 'unicode"' («ESCAPE_SEQUENCE» | !('"' | "\\" | "\n" | "\r"))* '"'; #[allow(dead_code, non_snake_case)] fn double_quoted_unicode_string_literal__0_7_0(&self, stream: &mut Stream) -> bool { @@ -855,7 +892,7 @@ impl Language { ) } - // ESCAPE_SEQUENCE = "\\" (ASCII_ESCAPE | HEX_BYTE_ESCAPE | UNICODE_ESCAPE); + // «ESCAPE_SEQUENCE» = "\\" («ASCII_ESCAPE» | «HEX_BYTE_ESCAPE» | «UNICODE_ESCAPE»); #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -903,14 +940,6 @@ impl Language { ) } - // EVMASM = '"evmasm"'; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn evmasm(&self, stream: &mut Stream) -> bool { - scan_chars!(stream, '"', 'e', 'v', 'm', 'a', 's', 'm', '"') - } - // EXPERIMENTAL_KEYWORD = "experimental"; #[allow(dead_code)] @@ -1006,7 +1035,7 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // FIXED_BYTES_TYPE = "bytes" ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" | "18" | "19" | "20" | "21" | "22" | "23" | "24" | "25" | "26" | "27" | "28" | "29" | "30" | "31" | "32"); + // FIXED_BYTES_TYPE = "bytes" «FIXED_BYTES_TYPE_SIZE»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -1039,6 +1068,71 @@ impl Language { ) } + // «FIXED_BYTES_TYPE_SIZE» = "1" + // | "2" + // | "3" + // | "4" + // | "5" + // | "6" + // | "7" + // | "8" + // | "9" + // | "10" + // | "11" + // | "12" + // | "13" + // | "14" + // | "15" + // | "16" + // | "17" + // | "18" + // | "19" + // | "20" + // | "21" + // | "22" + // | "23" + // | "24" + // | "25" + // | "26" + // | "27" + // | "28" + // | "29" + // | "30" + // | "31" + // | "32"; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn fixed_bytes_type_size(&self, stream: &mut Stream) -> bool { + scan_trie!( + stream, + ['4' | '5' | '6' | '7' | '8' | '9'], + '1' + scan_trie!( + stream, + EMPTY, + ['0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'] + ), + '2' + scan_trie!( + stream, + EMPTY, + ['0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'] + ), + '3' + scan_trie!(stream, EMPTY, ['0' | '1' | '2']) + ) + } + + // «FIXED_TYPE_SIZE» = "0"…"9"+ "x" "0"…"9"+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn fixed_type_size(&self, stream: &mut Stream) -> bool { + scan_sequence!( + scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))), + scan_chars!(stream, 'x'), + scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))) + ) + } + // FOR_KEYWORD = "for"; #[allow(dead_code)] @@ -1194,7 +1288,7 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // HEX_BYTE_ESCAPE = "x" «HEX_CHARACTER» «HEX_CHARACTER»; + // «HEX_BYTE_ESCAPE» = "x" «HEX_CHARACTER» «HEX_CHARACTER»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -1221,31 +1315,38 @@ impl Language { } // (* v0.4.11 *) - // HEX_LITERAL = "0" ("x" | "X") «HEX_CHARACTER»+ ("_" «HEX_CHARACTER»+)*; + // HEX_LITERAL = ("0x" | "0X") «HEX_CHARACTER»+ ("_" «HEX_CHARACTER»+)*; #[allow(dead_code, non_snake_case)] fn hex_literal__0_4_11(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_chars!(stream, '0'), - scan_predicate!(stream, |c| c == 'X' || c == 'x'), - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')) - ), - scan_zero_or_more!( - stream, - scan_sequence!( - scan_chars!(stream, '_'), - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_sequence!(scan_chars!(stream, '0'), scan_trie!(stream, ['X' | 'x'])), + scan_one_or_more!( + stream, + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')) + ), + scan_zero_or_more!( + stream, + scan_sequence!( + scan_chars!(stream, '_'), + scan_one_or_more!( + stream, + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')) + ) ) ) - ) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } @@ -1254,26 +1355,34 @@ impl Language { #[allow(dead_code, non_snake_case)] fn hex_literal__0_5_0(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_chars!(stream, '0', 'x'), - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')) - ), - scan_zero_or_more!( - stream, - scan_sequence!( - scan_chars!(stream, '_'), - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_chars!(stream, '0', 'x'), + scan_one_or_more!( + stream, + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')) + ), + scan_zero_or_more!( + stream, + scan_sequence!( + scan_chars!(stream, '_'), + scan_one_or_more!( + stream, + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')) + ) ) ) - ) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } @@ -1285,29 +1394,53 @@ impl Language { } } - // HEX_STRING_LITERAL = "hex" (('"' POSSIBLY_SEPARATED_PAIRS_OF_HEX_DIGITS? '"') | ("'" POSSIBLY_SEPARATED_PAIRS_OF_HEX_DIGITS? "'")); + // «HEX_STRING_CONTENTS» = «HEX_CHARACTER» «HEX_CHARACTER» ("_"? «HEX_CHARACTER» «HEX_CHARACTER»)*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn hex_string_literal(&self, stream: &mut Stream) -> bool { + pub(crate) fn hex_string_contents(&self, stream: &mut Stream) -> bool { scan_sequence!( - scan_chars!(stream, 'h', 'e', 'x'), - scan_choice!( + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')), + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')), + scan_zero_or_more!( stream, scan_sequence!( - scan_chars!(stream, '"'), - scan_optional!(stream, self.possibly_separated_pairs_of_hex_digits(stream)), - scan_chars!(stream, '"') - ), - scan_sequence!( - scan_chars!(stream, '\''), - scan_optional!(stream, self.possibly_separated_pairs_of_hex_digits(stream)), - scan_chars!(stream, '\'') + scan_optional!(stream, scan_chars!(stream, '_')), + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')), + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')) ) ) ) } + // HEX_STRING_LITERAL = «SINGLE_QUOTED_HEX_STRING_LITERAL» | «DOUBLE_QUOTED_HEX_STRING_LITERAL»; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn hex_string_literal(&self, stream: &mut Stream) -> bool { + scan_not_followed_by!( + stream, + scan_choice!( + stream, + self.single_quoted_hex_string_literal(stream), + self.double_quoted_hex_string_literal(stream) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) + ) + } + // HOURS_KEYWORD = "hours"; #[allow(dead_code)] @@ -1324,200 +1457,134 @@ impl Language { ) } - // IDENTIFIER = RAW_IDENTIFIER - (NOT_AN_IDENTIFIER_IN_ANY_VERSION | NOT_AN_IDENTIFIER_IN_SOME_VERSIONS | FIXED_BYTES_TYPE | SIGNED_FIXED_TYPE | UNSIGNED_FIXED_TYPE | SIGNED_INTEGER_TYPE | UNSIGNED_INTEGER_TYPE); + // (* v0.4.11 *) + // IDENTIFIER = «RAW_IDENTIFIER» - («KEYWORD_IN_ANY_VERSION» | «KEYWORD_IN_SOME_VERSION» | «RESERVED_WORD_IN_ANY_VERSION»); - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn identifier(&self, stream: &mut Stream) -> bool { + #[allow(dead_code, non_snake_case)] + fn identifier__0_4_11(&self, stream: &mut Stream) -> bool { scan_difference!( stream, self.raw_identifier(stream), scan_choice!( stream, + self.keyword_in_any_version(stream), + self.keyword_in_some_version(stream), scan_trie!( stream, 'a' + scan_trie!( stream, 'b' + scan_chars!(stream, 's', 't', 'r', 'a', 'c', 't'), - 'd' + scan_chars!(stream, 'd', 'r', 'e', 's', 's'), - 'f' + scan_chars!(stream, 't', 'e', 'r'), - 'n' + scan_chars!(stream, 'o', 'n', 'y', 'm', 'o', 'u', 's'), - 's' + scan_trie!( + 'f' + scan_chars!(stream, 't', 'e', 'r') + ), + 'b' + scan_chars!(stream, 'y', 't', 'e'), + 'c' + scan_chars!(stream, 'a', 't', 'c', 'h'), + 'f' + scan_sequence!( + scan_chars!(stream, 'i', 'n'), + scan_trie!( stream, - EMPTY, - 's' + scan_chars!(stream, 'e', 'm', 'b', 'l', 'y') + 'a' + scan_chars!(stream, 'l'), + 'n' + scan_chars!(stream, 'e', 'y') ) ), - 'b' + scan_trie!( + 'h' + scan_chars!(stream, 'e', 'x'), + 'i' + scan_sequence!( + scan_chars!(stream, 'n'), + scan_trie!(stream, EMPTY, 'l' + scan_chars!(stream, 'i', 'n', 'e')) + ), + 'm' + scan_chars!(stream, 'a', 't', 'c', 'h'), + 'n' + scan_chars!(stream, 'u', 'l', 'l'), + 'o' + scan_chars!(stream, 'f'), + 'r' + scan_chars!(stream, 'e', 'l', 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e'), + 's' + scan_trie!( stream, - 'o' + scan_chars!(stream, 'o', 'l'), - 'r' + scan_chars!(stream, 'e', 'a', 'k'), - 'y' + scan_chars!(stream, 't', 'e') + 't' + scan_chars!(stream, 'a', 't', 'i', 'c'), + 'z' + scan_chars!(stream, 'a', 'b', 'o') ), - 'c' + scan_trie!( + 't' + scan_trie!( stream, - 'a' + scan_trie!( - stream, - 's' + scan_chars!(stream, 'e'), - 't' + scan_chars!(stream, 'c', 'h') - ), - 'o' + scan_sequence!( - scan_chars!(stream, 'n'), - scan_trie!( - stream, - 's' + scan_chars!(stream, 't', 'a', 'n', 't'), - 't' + scan_trie!( - stream, - 'i' + scan_chars!(stream, 'n', 'u', 'e'), - 'r' + scan_chars!(stream, 'a', 'c', 't') - ) - ) + 'h' + scan_chars!(stream, 'r', 'o', 'w'), + 'r' + scan_chars!(stream, 'y'), + 'y' + scan_sequence!( + scan_chars!(stream, 'p', 'e'), + scan_trie!(stream, EMPTY, 'o' + scan_chars!(stream, 'f')) ) ), - 'd' + scan_trie!( + 'v' + scan_chars!(stream, 'a', 'r'), + 'y' + scan_chars!(stream, 'e', 'a', 'r', 's') + ) + ) + ) + } + + // (* v0.5.0 *) + // IDENTIFIER = «RAW_IDENTIFIER» - («KEYWORD_IN_ANY_VERSION» | «KEYWORD_IN_SOME_VERSION» | «RESERVED_WORD_IN_ANY_VERSION» | «RESERVED_WORD_IN_SOME_VERSION»); + + #[allow(dead_code, non_snake_case)] + fn identifier__0_5_0(&self, stream: &mut Stream) -> bool { + scan_difference!( + stream, + self.raw_identifier(stream), + scan_choice!( + stream, + self.keyword_in_any_version(stream), + self.keyword_in_some_version(stream), + scan_trie!( + stream, + 'a' + scan_trie!( stream, - ['o'], - 'a' + scan_chars!(stream, 'y', 's'), - 'e' + scan_trie!( + 'b' + scan_chars!(stream, 's', 't', 'r', 'a', 'c', 't'), + 'f' + scan_chars!(stream, 't', 'e', 'r') + ), + 'b' + scan_chars!(stream, 'y', 't', 'e'), + 'c' + scan_chars!(stream, 'a', 't', 'c', 'h'), + 'f' + scan_sequence!( + scan_chars!(stream, 'i', 'n'), + scan_trie!( stream, - 'f' + scan_chars!(stream, 'a', 'u', 'l', 't'), - 'l' + scan_chars!(stream, 'e', 't', 'e') + 'a' + scan_chars!(stream, 'l'), + 'n' + scan_chars!(stream, 'e', 'y') ) ), - 'e' + scan_trie!( - stream, - 'l' + scan_chars!(stream, 's', 'e'), - 'n' + scan_chars!(stream, 'u', 'm'), - 't' + scan_chars!(stream, 'h', 'e', 'r'), - 'v' + scan_chars!(stream, 'e', 'n', 't'), - 'x' + scan_chars!(stream, 't', 'e', 'r', 'n', 'a', 'l') + 'h' + scan_chars!(stream, 'e', 'x'), + 'i' + scan_sequence!( + scan_chars!(stream, 'n'), + scan_trie!(stream, EMPTY, 'l' + scan_chars!(stream, 'i', 'n', 'e')) ), - 'f' + scan_trie!( + 'm' + scan_chars!(stream, 'a', 't', 'c', 'h'), + 'n' + scan_chars!(stream, 'u', 'l', 'l'), + 'o' + scan_chars!(stream, 'f'), + 'r' + scan_chars!(stream, 'e', 'l', 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e'), + 's' + scan_trie!( stream, - 'a' + scan_chars!(stream, 'l', 's', 'e'), - 'i' + scan_chars!(stream, 'n', 'a', 'l'), - 'o' + scan_chars!(stream, 'r'), - 'u' + scan_chars!(stream, 'n', 'c', 't', 'i', 'o', 'n') + 't' + scan_chars!(stream, 'a', 't', 'i', 'c'), + 'z' + scan_chars!(stream, 'a', 'b', 'o') ), - 'h' + scan_trie!( + 't' + scan_trie!( stream, - 'e' + scan_chars!(stream, 'x'), - 'o' + scan_chars!(stream, 'u', 'r', 's') - ), - 'i' + scan_trie!( - stream, - ['f' | 's'], - 'm' + scan_chars!(stream, 'p', 'o', 'r', 't'), - 'n' + scan_trie!( - stream, - EMPTY, - 'd' + scan_chars!(stream, 'e', 'x', 'e', 'd'), - 'l' + scan_chars!(stream, 'i', 'n', 'e'), - 't' + scan_sequence!( - scan_chars!(stream, 'e', 'r'), - scan_trie!( - stream, - 'f' + scan_chars!(stream, 'a', 'c', 'e'), - 'n' + scan_chars!(stream, 'a', 'l') - ) - ) - ) - ), - 'l' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 't'), - 'i' + scan_chars!(stream, 'b', 'r', 'a', 'r', 'y') - ), - 'm' + scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 'p' + scan_chars!(stream, 'p', 'i', 'n', 'g'), - 't' + scan_chars!(stream, 'c', 'h') - ), - 'e' + scan_chars!(stream, 'm', 'o', 'r', 'y'), - 'i' + scan_chars!(stream, 'n', 'u', 't', 'e', 's'), - 'o' + scan_chars!(stream, 'd', 'i', 'f', 'i', 'e', 'r') - ), - 'n' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'w'), - 'u' + scan_chars!(stream, 'l', 'l') - ), - 'o' + scan_chars!(stream, 'f'), - 'p' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'y', 'a', 'b', 'l', 'e'), - 'r' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'g', 'm', 'a'), - 'i' + scan_chars!(stream, 'v', 'a', 't', 'e') - ), - 'u' + scan_trie!( - stream, - 'b' + scan_chars!(stream, 'l', 'i', 'c'), - 'r' + scan_chars!(stream, 'e') - ) - ), - 'r' + scan_sequence!( - scan_chars!(stream, 'e'), - scan_trie!( - stream, - 'l' + scan_chars!(stream, 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e'), - 't' + scan_sequence!( - scan_chars!(stream, 'u', 'r', 'n'), - scan_trie!(stream, EMPTY, ['s']) - ) - ) - ), - 's' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'c', 'o', 'n', 'd', 's'), - 't' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 't', 'i', 'c'), - 'o' + scan_chars!(stream, 'r', 'a', 'g', 'e'), - 'r' + scan_trie!( - stream, - 'i' + scan_chars!(stream, 'n', 'g'), - 'u' + scan_chars!(stream, 'c', 't') - ) - ), - 'w' + scan_chars!(stream, 'i', 't', 'c', 'h') - ), - 't' + scan_trie!( - stream, - 'h' + scan_chars!(stream, 'r', 'o', 'w'), - 'r' + scan_trie!(stream, ['y'], 'u' + scan_chars!(stream, 'e')), - 'y' + scan_sequence!( - scan_chars!(stream, 'p', 'e'), - scan_trie!(stream, EMPTY, 'o' + scan_chars!(stream, 'f')) - ) - ), - 'u' + scan_chars!(stream, 's', 'i', 'n', 'g'), - 'v' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'r'), - 'i' + scan_chars!(stream, 'e', 'w') - ), - 'w' + scan_trie!( - stream, - 'e' + scan_trie!(stream, ['i'], 'e' + scan_chars!(stream, 'k', 's')), - 'h' + scan_chars!(stream, 'i', 'l', 'e') + 'h' + scan_chars!(stream, 'r', 'o', 'w'), + 'r' + scan_chars!(stream, 'y'), + 'y' + scan_sequence!( + scan_chars!(stream, 'p', 'e'), + scan_trie!(stream, EMPTY, 'o' + scan_chars!(stream, 'f')) + ) ), + 'v' + scan_chars!(stream, 'a', 'r'), 'y' + scan_chars!(stream, 'e', 'a', 'r', 's') ), - self.not_an_identifier_in_some_versions(stream), - self.fixed_bytes_type(stream), - self.signed_fixed_type(stream), - self.unsigned_fixed_type(stream), - self.signed_integer_type(stream), - self.unsigned_integer_type(stream) + self.reserved_word_in_some_version(stream) ) ) } - // IDENTIFIER_PART = IDENTIFIER_START | "0"…"9"; + pub(crate) fn identifier(&self, stream: &mut Stream) -> bool { + if self.version_is_equal_to_or_greater_than_0_5_0 { + self.identifier__0_5_0(stream) + } else { + self.identifier__0_4_11(stream) + } + } + + // «IDENTIFIER_PART» = «IDENTIFIER_START» | "0"…"9"; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -1529,7 +1596,7 @@ impl Language { || ('a' <= c && c <= 'z')) } - // IDENTIFIER_START = "_" | "$" | "a"…"z" | "A"…"Z"; + // «IDENTIFIER_START» = "_" | "$" | "a"…"z" | "A"…"Z"; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -1619,6 +1686,76 @@ impl Language { ) } + // «INTEGER_TYPE_SIZE» = "8" + // | "16" + // | "24" + // | "32" + // | "40" + // | "48" + // | "56" + // | "64" + // | "72" + // | "80" + // | "88" + // | "96" + // | "104" + // | "112" + // | "120" + // | "128" + // | "136" + // | "144" + // | "152" + // | "160" + // | "168" + // | "176" + // | "184" + // | "192" + // | "200" + // | "208" + // | "216" + // | "224" + // | "232" + // | "240" + // | "248" + // | "256"; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn integer_type_size(&self, stream: &mut Stream) -> bool { + scan_trie!( + stream, + '1' + scan_trie!( + stream, + '0' + scan_chars!(stream, '4'), + '1' + scan_chars!(stream, '2'), + '2' + scan_trie!(stream, ['0' | '8']), + '3' + scan_chars!(stream, '6'), + '4' + scan_chars!(stream, '4'), + '5' + scan_chars!(stream, '2'), + '6' + scan_trie!(stream, EMPTY, ['0' | '8']), + '7' + scan_chars!(stream, '6'), + '8' + scan_chars!(stream, '4'), + '9' + scan_chars!(stream, '2') + ), + '2' + scan_trie!( + stream, + '0' + scan_trie!(stream, ['0' | '8']), + '1' + scan_chars!(stream, '6'), + '2' + scan_chars!(stream, '4'), + '3' + scan_chars!(stream, '2'), + '4' + scan_trie!(stream, EMPTY, ['0' | '8']), + '5' + scan_chars!(stream, '6') + ), + '3' + scan_chars!(stream, '2'), + '4' + scan_trie!(stream, ['0' | '8']), + '5' + scan_chars!(stream, '6'), + '6' + scan_chars!(stream, '4'), + '7' + scan_chars!(stream, '2'), + '8' + scan_trie!(stream, EMPTY, ['0' | '8']), + '9' + scan_chars!(stream, '6') + ) + } + // INTERFACE_KEYWORD = "interface"; #[allow(dead_code)] @@ -1667,6 +1804,370 @@ impl Language { ) } + // «KEYWORD_IN_ANY_VERSION» = FIXED_BYTES_TYPE + // | SIGNED_FIXED_TYPE + // | UNSIGNED_FIXED_TYPE + // | SIGNED_INTEGER_TYPE + // | UNSIGNED_INTEGER_TYPE + // | ADDRESS_KEYWORD + // | ANONYMOUS_KEYWORD + // | AS_KEYWORD + // | ASSEMBLY_KEYWORD + // | BOOL_KEYWORD + // | BREAK_KEYWORD + // | CASE_KEYWORD + // | CONSTANT_KEYWORD + // | CONTINUE_KEYWORD + // | CONTRACT_KEYWORD + // | DAYS_KEYWORD + // | DEFAULT_KEYWORD + // | DELETE_KEYWORD + // | DO_KEYWORD + // | ELSE_KEYWORD + // | ENUM_KEYWORD + // | ETHER_KEYWORD + // | EVENT_KEYWORD + // | EXTERNAL_KEYWORD + // | FALSE_KEYWORD + // | FOR_KEYWORD + // | FUNCTION_KEYWORD + // | HOURS_KEYWORD + // | IF_KEYWORD + // | IMPORT_KEYWORD + // | INDEXED_KEYWORD + // | INTERFACE_KEYWORD + // | INTERNAL_KEYWORD + // | IS_KEYWORD + // | LET_KEYWORD + // | LIBRARY_KEYWORD + // | MAPPING_KEYWORD + // | MEMORY_KEYWORD + // | MINUTES_KEYWORD + // | MODIFIER_KEYWORD + // | NEW_KEYWORD + // | PAYABLE_KEYWORD + // | PRAGMA_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD + // | PURE_KEYWORD + // | RETURN_KEYWORD + // | RETURNS_KEYWORD + // | SECONDS_KEYWORD + // | STORAGE_KEYWORD + // | STRING_KEYWORD + // | STRUCT_KEYWORD + // | SWITCH_KEYWORD + // | TRUE_KEYWORD + // | USING_KEYWORD + // | VIEW_KEYWORD + // | WEEKS_KEYWORD + // | WEI_KEYWORD + // | WHILE_KEYWORD; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn keyword_in_any_version(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.fixed_bytes_type(stream), + self.signed_fixed_type(stream), + self.unsigned_fixed_type(stream), + self.signed_integer_type(stream), + self.unsigned_integer_type(stream), + self.address_keyword(stream), + self.anonymous_keyword(stream), + self.as_keyword(stream), + self.assembly_keyword(stream), + self.bool_keyword(stream), + self.break_keyword(stream), + self.case_keyword(stream), + self.constant_keyword(stream), + self.continue_keyword(stream), + self.contract_keyword(stream), + self.days_keyword(stream), + self.default_keyword(stream), + self.delete_keyword(stream), + self.do_keyword(stream), + self.else_keyword(stream), + self.enum_keyword(stream), + self.ether_keyword(stream), + self.event_keyword(stream), + self.external_keyword(stream), + self.false_keyword(stream), + self.for_keyword(stream), + self.function_keyword(stream), + self.hours_keyword(stream), + self.if_keyword(stream), + self.import_keyword(stream), + self.indexed_keyword(stream), + self.interface_keyword(stream), + self.internal_keyword(stream), + self.is_keyword(stream), + self.let_keyword(stream), + self.library_keyword(stream), + self.mapping_keyword(stream), + self.memory_keyword(stream), + self.minutes_keyword(stream), + self.modifier_keyword(stream), + self.new_keyword(stream), + self.payable_keyword(stream), + self.pragma_keyword(stream), + self.private_keyword(stream), + self.public_keyword(stream), + self.pure_keyword(stream), + self.return_keyword(stream), + self.returns_keyword(stream), + self.seconds_keyword(stream), + self.storage_keyword(stream), + self.string_keyword(stream), + self.struct_keyword(stream), + self.switch_keyword(stream), + self.true_keyword(stream), + self.using_keyword(stream), + self.view_keyword(stream), + self.weeks_keyword(stream), + self.wei_keyword(stream), + self.while_keyword(stream) + ) + } + + // (* v0.4.11 *) + // «KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + // | FINNEY_KEYWORD + // | SZABO_KEYWORD + // | THROW_KEYWORD + // | VAR_KEYWORD + // | YEARS_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_4_11(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.byte_keyword(stream), + self.finney_keyword(stream), + self.szabo_keyword(stream), + self.throw_keyword(stream), + self.var_keyword(stream), + self.years_keyword(stream) + ) + } + + // (* v0.5.0 *) + // «KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + // | FINNEY_KEYWORD + // | SZABO_KEYWORD + // | CALLDATA_KEYWORD + // | CONSTRUCTOR_KEYWORD + // | EMIT_KEYWORD + // | OVERRIDE_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_5_0(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.byte_keyword(stream), + self.finney_keyword(stream), + self.szabo_keyword(stream), + self.calldata_keyword(stream), + self.constructor_keyword(stream), + self.emit_keyword(stream), + self.override_keyword(stream) + ) + } + + // (* v0.5.3 *) + // «KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + // | FINNEY_KEYWORD + // | SZABO_KEYWORD + // | CALLDATA_KEYWORD + // | CONSTRUCTOR_KEYWORD + // | EMIT_KEYWORD + // | OVERRIDE_KEYWORD + // | TYPE_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_5_3(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.byte_keyword(stream), + self.finney_keyword(stream), + self.szabo_keyword(stream), + self.calldata_keyword(stream), + self.constructor_keyword(stream), + self.emit_keyword(stream), + self.override_keyword(stream), + self.type_keyword(stream) + ) + } + + // (* v0.6.0 *) + // «KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + // | FINNEY_KEYWORD + // | SZABO_KEYWORD + // | CALLDATA_KEYWORD + // | CONSTRUCTOR_KEYWORD + // | EMIT_KEYWORD + // | OVERRIDE_KEYWORD + // | TYPE_KEYWORD + // | ABSTRACT_KEYWORD + // | CATCH_KEYWORD + // | FALLBACK_KEYWORD + // | RECEIVE_KEYWORD + // | TRY_KEYWORD + // | VIRTUAL_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_6_0(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.byte_keyword(stream), + self.finney_keyword(stream), + self.szabo_keyword(stream), + self.calldata_keyword(stream), + self.constructor_keyword(stream), + self.emit_keyword(stream), + self.override_keyword(stream), + self.type_keyword(stream), + self.abstract_keyword(stream), + self.catch_keyword(stream), + self.fallback_keyword(stream), + self.receive_keyword(stream), + self.try_keyword(stream), + self.virtual_keyword(stream) + ) + } + + // (* v0.6.5 *) + // «KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + // | FINNEY_KEYWORD + // | SZABO_KEYWORD + // | CALLDATA_KEYWORD + // | CONSTRUCTOR_KEYWORD + // | EMIT_KEYWORD + // | OVERRIDE_KEYWORD + // | TYPE_KEYWORD + // | ABSTRACT_KEYWORD + // | CATCH_KEYWORD + // | FALLBACK_KEYWORD + // | RECEIVE_KEYWORD + // | TRY_KEYWORD + // | VIRTUAL_KEYWORD + // | IMMUTABLE_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_6_5(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.byte_keyword(stream), + self.finney_keyword(stream), + self.szabo_keyword(stream), + self.calldata_keyword(stream), + self.constructor_keyword(stream), + self.emit_keyword(stream), + self.override_keyword(stream), + self.type_keyword(stream), + self.abstract_keyword(stream), + self.catch_keyword(stream), + self.fallback_keyword(stream), + self.receive_keyword(stream), + self.try_keyword(stream), + self.virtual_keyword(stream), + self.immutable_keyword(stream) + ) + } + + // (* v0.7.0 *) + // «KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + // | CALLDATA_KEYWORD + // | CONSTRUCTOR_KEYWORD + // | EMIT_KEYWORD + // | OVERRIDE_KEYWORD + // | TYPE_KEYWORD + // | ABSTRACT_KEYWORD + // | CATCH_KEYWORD + // | FALLBACK_KEYWORD + // | RECEIVE_KEYWORD + // | TRY_KEYWORD + // | VIRTUAL_KEYWORD + // | IMMUTABLE_KEYWORD + // | GWEI_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_7_0(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.byte_keyword(stream), + self.calldata_keyword(stream), + self.constructor_keyword(stream), + self.emit_keyword(stream), + self.override_keyword(stream), + self.type_keyword(stream), + self.abstract_keyword(stream), + self.catch_keyword(stream), + self.fallback_keyword(stream), + self.receive_keyword(stream), + self.try_keyword(stream), + self.virtual_keyword(stream), + self.immutable_keyword(stream), + self.gwei_keyword(stream) + ) + } + + // (* v0.8.0 *) + // «KEYWORD_IN_SOME_VERSION» = CALLDATA_KEYWORD + // | CONSTRUCTOR_KEYWORD + // | EMIT_KEYWORD + // | OVERRIDE_KEYWORD + // | TYPE_KEYWORD + // | ABSTRACT_KEYWORD + // | CATCH_KEYWORD + // | FALLBACK_KEYWORD + // | RECEIVE_KEYWORD + // | TRY_KEYWORD + // | VIRTUAL_KEYWORD + // | IMMUTABLE_KEYWORD + // | GWEI_KEYWORD + // | UNCHECKED_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_8_0(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.calldata_keyword(stream), + self.constructor_keyword(stream), + self.emit_keyword(stream), + self.override_keyword(stream), + self.type_keyword(stream), + self.abstract_keyword(stream), + self.catch_keyword(stream), + self.fallback_keyword(stream), + self.receive_keyword(stream), + self.try_keyword(stream), + self.virtual_keyword(stream), + self.immutable_keyword(stream), + self.gwei_keyword(stream), + self.unchecked_keyword(stream) + ) + } + + pub(crate) fn keyword_in_some_version(&self, stream: &mut Stream) -> bool { + if self.version_is_equal_to_or_greater_than_0_8_0 { + self.keyword_in_some_version__0_8_0(stream) + } else if self.version_is_equal_to_or_greater_than_0_7_0 { + self.keyword_in_some_version__0_7_0(stream) + } else if self.version_is_equal_to_or_greater_than_0_6_5 { + self.keyword_in_some_version__0_6_5(stream) + } else if self.version_is_equal_to_or_greater_than_0_6_0 { + self.keyword_in_some_version__0_6_0(stream) + } else if self.version_is_equal_to_or_greater_than_0_5_3 { + self.keyword_in_some_version__0_5_3(stream) + } else if self.version_is_equal_to_or_greater_than_0_5_0 { + self.keyword_in_some_version__0_5_0(stream) + } else { + self.keyword_in_some_version__0_4_11(stream) + } + } + // (* v0.6.0 *) // LEAVE_KEYWORD = "leave"; @@ -1879,571 +2380,33 @@ impl Language { scan_chars!(stream, '/', '*'), scan_zero_or_more!( stream, - scan_choice!( - stream, - scan_predicate!(stream, |c| c != '*'), - scan_sequence!( - scan_chars!(stream, '*'), - scan_predicate!(stream, |c| c != '/') - ) - ) - ), - scan_chars!(stream, '*', '/') - ) - } - - // NEW_KEYWORD = "new"; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn new_keyword(&self, stream: &mut Stream) -> bool { - scan_not_followed_by!( - stream, - scan_chars!(stream, 'n', 'e', 'w'), - scan_predicate!(stream, |c| c == '$' - || ('0' <= c && c <= '9') - || ('A' <= c && c <= 'Z') - || c == '_' - || ('a' <= c && c <= 'z')) - ) - } - - // NOT_AN_IDENTIFIER_IN_ANY_VERSION = "abstract" - // | "address" - // | "after" - // | "anonymous" - // | "as" - // | "assembly" - // | "bool" - // | "break" - // | "byte" - // | "case" - // | "catch" - // | "constant" - // | "continue" - // | "contract" - // | "days" - // | "default" - // | "delete" - // | "do" - // | "else" - // | "enum" - // | "ether" - // | "event" - // | "external" - // | "false" - // | "final" - // | "for" - // | "function" - // | "hex" - // | "hours" - // | "if" - // | "import" - // | "in" - // | "indexed" - // | "inline" - // | "interface" - // | "internal" - // | "is" - // | "let" - // | "library" - // | "mapping" - // | "match" - // | "memory" - // | "minutes" - // | "modifier" - // | "new" - // | "null" - // | "of" - // | "payable" - // | "pragma" - // | "private" - // | "public" - // | "pure" - // | "relocatable" - // | "return" - // | "returns" - // | "seconds" - // | "static" - // | "storage" - // | "string" - // | "struct" - // | "switch" - // | "throw" - // | "true" - // | "try" - // | "type" - // | "typeof" - // | "using" - // | "var" - // | "view" - // | "weeks" - // | "wei" - // | "while" - // | "years"; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn not_an_identifier_in_any_version(&self, stream: &mut Stream) -> bool { - scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 'b' + scan_chars!(stream, 's', 't', 'r', 'a', 'c', 't'), - 'd' + scan_chars!(stream, 'd', 'r', 'e', 's', 's'), - 'f' + scan_chars!(stream, 't', 'e', 'r'), - 'n' + scan_chars!(stream, 'o', 'n', 'y', 'm', 'o', 'u', 's'), - 's' + scan_trie!( - stream, - EMPTY, - 's' + scan_chars!(stream, 'e', 'm', 'b', 'l', 'y') - ) - ), - 'b' + scan_trie!( - stream, - 'o' + scan_chars!(stream, 'o', 'l'), - 'r' + scan_chars!(stream, 'e', 'a', 'k'), - 'y' + scan_chars!(stream, 't', 'e') - ), - 'c' + scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 's' + scan_chars!(stream, 'e'), - 't' + scan_chars!(stream, 'c', 'h') - ), - 'o' + scan_sequence!( - scan_chars!(stream, 'n'), - scan_trie!( - stream, - 's' + scan_chars!(stream, 't', 'a', 'n', 't'), - 't' + scan_trie!( - stream, - 'i' + scan_chars!(stream, 'n', 'u', 'e'), - 'r' + scan_chars!(stream, 'a', 'c', 't') - ) - ) - ) - ), - 'd' + scan_trie!( - stream, - ['o'], - 'a' + scan_chars!(stream, 'y', 's'), - 'e' + scan_trie!( - stream, - 'f' + scan_chars!(stream, 'a', 'u', 'l', 't'), - 'l' + scan_chars!(stream, 'e', 't', 'e') - ) - ), - 'e' + scan_trie!( - stream, - 'l' + scan_chars!(stream, 's', 'e'), - 'n' + scan_chars!(stream, 'u', 'm'), - 't' + scan_chars!(stream, 'h', 'e', 'r'), - 'v' + scan_chars!(stream, 'e', 'n', 't'), - 'x' + scan_chars!(stream, 't', 'e', 'r', 'n', 'a', 'l') - ), - 'f' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'l', 's', 'e'), - 'i' + scan_chars!(stream, 'n', 'a', 'l'), - 'o' + scan_chars!(stream, 'r'), - 'u' + scan_chars!(stream, 'n', 'c', 't', 'i', 'o', 'n') - ), - 'h' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'x'), - 'o' + scan_chars!(stream, 'u', 'r', 's') - ), - 'i' + scan_trie!( - stream, - ['f' | 's'], - 'm' + scan_chars!(stream, 'p', 'o', 'r', 't'), - 'n' + scan_trie!( - stream, - EMPTY, - 'd' + scan_chars!(stream, 'e', 'x', 'e', 'd'), - 'l' + scan_chars!(stream, 'i', 'n', 'e'), - 't' + scan_sequence!( - scan_chars!(stream, 'e', 'r'), - scan_trie!( - stream, - 'f' + scan_chars!(stream, 'a', 'c', 'e'), - 'n' + scan_chars!(stream, 'a', 'l') - ) - ) - ) - ), - 'l' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 't'), - 'i' + scan_chars!(stream, 'b', 'r', 'a', 'r', 'y') - ), - 'm' + scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 'p' + scan_chars!(stream, 'p', 'i', 'n', 'g'), - 't' + scan_chars!(stream, 'c', 'h') - ), - 'e' + scan_chars!(stream, 'm', 'o', 'r', 'y'), - 'i' + scan_chars!(stream, 'n', 'u', 't', 'e', 's'), - 'o' + scan_chars!(stream, 'd', 'i', 'f', 'i', 'e', 'r') - ), - 'n' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'w'), - 'u' + scan_chars!(stream, 'l', 'l') - ), - 'o' + scan_chars!(stream, 'f'), - 'p' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'y', 'a', 'b', 'l', 'e'), - 'r' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'g', 'm', 'a'), - 'i' + scan_chars!(stream, 'v', 'a', 't', 'e') - ), - 'u' + scan_trie!( - stream, - 'b' + scan_chars!(stream, 'l', 'i', 'c'), - 'r' + scan_chars!(stream, 'e') - ) - ), - 'r' + scan_sequence!( - scan_chars!(stream, 'e'), - scan_trie!( - stream, - 'l' + scan_chars!(stream, 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e'), - 't' + scan_sequence!( - scan_chars!(stream, 'u', 'r', 'n'), - scan_trie!(stream, EMPTY, ['s']) - ) - ) - ), - 's' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'c', 'o', 'n', 'd', 's'), - 't' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 't', 'i', 'c'), - 'o' + scan_chars!(stream, 'r', 'a', 'g', 'e'), - 'r' + scan_trie!( - stream, - 'i' + scan_chars!(stream, 'n', 'g'), - 'u' + scan_chars!(stream, 'c', 't') - ) - ), - 'w' + scan_chars!(stream, 'i', 't', 'c', 'h') - ), - 't' + scan_trie!( - stream, - 'h' + scan_chars!(stream, 'r', 'o', 'w'), - 'r' + scan_trie!(stream, ['y'], 'u' + scan_chars!(stream, 'e')), - 'y' + scan_sequence!( - scan_chars!(stream, 'p', 'e'), - scan_trie!(stream, EMPTY, 'o' + scan_chars!(stream, 'f')) - ) - ), - 'u' + scan_chars!(stream, 's', 'i', 'n', 'g'), - 'v' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'r'), - 'i' + scan_chars!(stream, 'e', 'w') - ), - 'w' + scan_trie!( - stream, - 'e' + scan_trie!(stream, ['i'], 'e' + scan_chars!(stream, 'k', 's')), - 'h' + scan_chars!(stream, 'i', 'l', 'e') - ), - 'y' + scan_chars!(stream, 'e', 'a', 'r', 's') - ) - } - - // (* v0.4.11 *) - // NOT_AN_IDENTIFIER_IN_SOME_VERSIONS = "finney" | "szabo"; - - #[allow(dead_code, non_snake_case)] - fn not_an_identifier_in_some_versions__0_4_11(&self, stream: &mut Stream) -> bool { - scan_trie!( - stream, - 'f' + scan_chars!(stream, 'i', 'n', 'n', 'e', 'y'), - 's' + scan_chars!(stream, 'z', 'a', 'b', 'o') - ) - } - - // (* v0.5.0 *) - // NOT_AN_IDENTIFIER_IN_SOME_VERSIONS = "finney" - // | "szabo" - // | "alias" - // | "apply" - // | "auto" - // | "calldata" - // | "constructor" - // | "copyof" - // | "define" - // | "emit" - // | "immutable" - // | "implements" - // | "macro" - // | "mutable" - // | "override" - // | "partial" - // | "promise" - // | "reference" - // | "sealed" - // | "sizeof" - // | "supports" - // | "typedef" - // | "unchecked"; - - #[allow(dead_code, non_snake_case)] - fn not_an_identifier_in_some_versions__0_5_0(&self, stream: &mut Stream) -> bool { - scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 'l' + scan_chars!(stream, 'i', 'a', 's'), - 'p' + scan_chars!(stream, 'p', 'l', 'y'), - 'u' + scan_chars!(stream, 't', 'o') - ), - 'c' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'l', 'l', 'd', 'a', 't', 'a'), - 'o' + scan_trie!( - stream, - 'n' + scan_chars!(stream, 's', 't', 'r', 'u', 'c', 't', 'o', 'r'), - 'p' + scan_chars!(stream, 'y', 'o', 'f') - ) - ), - 'd' + scan_chars!(stream, 'e', 'f', 'i', 'n', 'e'), - 'e' + scan_chars!(stream, 'm', 'i', 't'), - 'f' + scan_chars!(stream, 'i', 'n', 'n', 'e', 'y'), - 'i' + scan_sequence!( - scan_chars!(stream, 'm'), - scan_trie!( - stream, - 'm' + scan_chars!(stream, 'u', 't', 'a', 'b', 'l', 'e'), - 'p' + scan_chars!(stream, 'l', 'e', 'm', 'e', 'n', 't', 's') - ) - ), - 'm' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'c', 'r', 'o'), - 'u' + scan_chars!(stream, 't', 'a', 'b', 'l', 'e') - ), - 'o' + scan_chars!(stream, 'v', 'e', 'r', 'r', 'i', 'd', 'e'), - 'p' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'r', 't', 'i', 'a', 'l'), - 'r' + scan_chars!(stream, 'o', 'm', 'i', 's', 'e') - ), - 'r' + scan_chars!(stream, 'e', 'f', 'e', 'r', 'e', 'n', 'c', 'e'), - 's' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'a', 'l', 'e', 'd'), - 'i' + scan_chars!(stream, 'z', 'e', 'o', 'f'), - 'u' + scan_chars!(stream, 'p', 'p', 'o', 'r', 't', 's'), - 'z' + scan_chars!(stream, 'a', 'b', 'o') - ), - 't' + scan_chars!(stream, 'y', 'p', 'e', 'd', 'e', 'f'), - 'u' + scan_chars!(stream, 'n', 'c', 'h', 'e', 'c', 'k', 'e', 'd') - ) - } - - // (* v0.6.0 *) - // NOT_AN_IDENTIFIER_IN_SOME_VERSIONS = "finney" - // | "szabo" - // | "alias" - // | "apply" - // | "auto" - // | "calldata" - // | "constructor" - // | "copyof" - // | "define" - // | "emit" - // | "immutable" - // | "implements" - // | "macro" - // | "mutable" - // | "override" - // | "partial" - // | "promise" - // | "reference" - // | "sealed" - // | "sizeof" - // | "supports" - // | "typedef" - // | "unchecked" - // | "fallback" - // | "receive" - // | "virtual"; - - #[allow(dead_code, non_snake_case)] - fn not_an_identifier_in_some_versions__0_6_0(&self, stream: &mut Stream) -> bool { - scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 'l' + scan_chars!(stream, 'i', 'a', 's'), - 'p' + scan_chars!(stream, 'p', 'l', 'y'), - 'u' + scan_chars!(stream, 't', 'o') - ), - 'c' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'l', 'l', 'd', 'a', 't', 'a'), - 'o' + scan_trie!( - stream, - 'n' + scan_chars!(stream, 's', 't', 'r', 'u', 'c', 't', 'o', 'r'), - 'p' + scan_chars!(stream, 'y', 'o', 'f') - ) - ), - 'd' + scan_chars!(stream, 'e', 'f', 'i', 'n', 'e'), - 'e' + scan_chars!(stream, 'm', 'i', 't'), - 'f' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'l', 'l', 'b', 'a', 'c', 'k'), - 'i' + scan_chars!(stream, 'n', 'n', 'e', 'y') - ), - 'i' + scan_sequence!( - scan_chars!(stream, 'm'), - scan_trie!( - stream, - 'm' + scan_chars!(stream, 'u', 't', 'a', 'b', 'l', 'e'), - 'p' + scan_chars!(stream, 'l', 'e', 'm', 'e', 'n', 't', 's') - ) - ), - 'm' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'c', 'r', 'o'), - 'u' + scan_chars!(stream, 't', 'a', 'b', 'l', 'e') - ), - 'o' + scan_chars!(stream, 'v', 'e', 'r', 'r', 'i', 'd', 'e'), - 'p' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'r', 't', 'i', 'a', 'l'), - 'r' + scan_chars!(stream, 'o', 'm', 'i', 's', 'e') - ), - 'r' + scan_sequence!( - scan_chars!(stream, 'e'), - scan_trie!( - stream, - 'c' + scan_chars!(stream, 'e', 'i', 'v', 'e'), - 'f' + scan_chars!(stream, 'e', 'r', 'e', 'n', 'c', 'e') - ) - ), - 's' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'a', 'l', 'e', 'd'), - 'i' + scan_chars!(stream, 'z', 'e', 'o', 'f'), - 'u' + scan_chars!(stream, 'p', 'p', 'o', 'r', 't', 's'), - 'z' + scan_chars!(stream, 'a', 'b', 'o') - ), - 't' + scan_chars!(stream, 'y', 'p', 'e', 'd', 'e', 'f'), - 'u' + scan_chars!(stream, 'n', 'c', 'h', 'e', 'c', 'k', 'e', 'd'), - 'v' + scan_chars!(stream, 'i', 'r', 't', 'u', 'a', 'l') - ) - } - - // (* v0.7.0 *) - // NOT_AN_IDENTIFIER_IN_SOME_VERSIONS = "alias" - // | "apply" - // | "auto" - // | "calldata" - // | "constructor" - // | "copyof" - // | "define" - // | "emit" - // | "immutable" - // | "implements" - // | "macro" - // | "mutable" - // | "override" - // | "partial" - // | "promise" - // | "reference" - // | "sealed" - // | "sizeof" - // | "supports" - // | "typedef" - // | "unchecked" - // | "fallback" - // | "receive" - // | "virtual" - // | "gwei"; - - #[allow(dead_code, non_snake_case)] - fn not_an_identifier_in_some_versions__0_7_0(&self, stream: &mut Stream) -> bool { - scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 'l' + scan_chars!(stream, 'i', 'a', 's'), - 'p' + scan_chars!(stream, 'p', 'l', 'y'), - 'u' + scan_chars!(stream, 't', 'o') - ), - 'c' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'l', 'l', 'd', 'a', 't', 'a'), - 'o' + scan_trie!( - stream, - 'n' + scan_chars!(stream, 's', 't', 'r', 'u', 'c', 't', 'o', 'r'), - 'p' + scan_chars!(stream, 'y', 'o', 'f') - ) - ), - 'd' + scan_chars!(stream, 'e', 'f', 'i', 'n', 'e'), - 'e' + scan_chars!(stream, 'm', 'i', 't'), - 'f' + scan_chars!(stream, 'a', 'l', 'l', 'b', 'a', 'c', 'k'), - 'g' + scan_chars!(stream, 'w', 'e', 'i'), - 'i' + scan_sequence!( - scan_chars!(stream, 'm'), - scan_trie!( - stream, - 'm' + scan_chars!(stream, 'u', 't', 'a', 'b', 'l', 'e'), - 'p' + scan_chars!(stream, 'l', 'e', 'm', 'e', 'n', 't', 's') - ) - ), - 'm' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'c', 'r', 'o'), - 'u' + scan_chars!(stream, 't', 'a', 'b', 'l', 'e') - ), - 'o' + scan_chars!(stream, 'v', 'e', 'r', 'r', 'i', 'd', 'e'), - 'p' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'r', 't', 'i', 'a', 'l'), - 'r' + scan_chars!(stream, 'o', 'm', 'i', 's', 'e') - ), - 'r' + scan_sequence!( - scan_chars!(stream, 'e'), - scan_trie!( + scan_choice!( stream, - 'c' + scan_chars!(stream, 'e', 'i', 'v', 'e'), - 'f' + scan_chars!(stream, 'e', 'r', 'e', 'n', 'c', 'e') + scan_predicate!(stream, |c| c != '*'), + scan_sequence!( + scan_chars!(stream, '*'), + scan_predicate!(stream, |c| c != '/') + ) ) ), - 's' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'a', 'l', 'e', 'd'), - 'i' + scan_chars!(stream, 'z', 'e', 'o', 'f'), - 'u' + scan_chars!(stream, 'p', 'p', 'o', 'r', 't', 's') - ), - 't' + scan_chars!(stream, 'y', 'p', 'e', 'd', 'e', 'f'), - 'u' + scan_chars!(stream, 'n', 'c', 'h', 'e', 'c', 'k', 'e', 'd'), - 'v' + scan_chars!(stream, 'i', 'r', 't', 'u', 'a', 'l') + scan_chars!(stream, '*', '/') ) } - pub(crate) fn not_an_identifier_in_some_versions(&self, stream: &mut Stream) -> bool { - if self.version_is_equal_to_or_greater_than_0_7_0 { - self.not_an_identifier_in_some_versions__0_7_0(stream) - } else if self.version_is_equal_to_or_greater_than_0_6_0 { - self.not_an_identifier_in_some_versions__0_6_0(stream) - } else if self.version_is_equal_to_or_greater_than_0_5_0 { - self.not_an_identifier_in_some_versions__0_5_0(stream) - } else { - self.not_an_identifier_in_some_versions__0_4_11(stream) - } + // NEW_KEYWORD = "new"; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn new_keyword(&self, stream: &mut Stream) -> bool { + scan_not_followed_by!( + stream, + scan_chars!(stream, 'n', 'e', 'w'), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) + ) } // OPEN_BRACE = "{"; @@ -2554,33 +2517,6 @@ impl Language { scan_chars!(stream, '+', '+') } - // POSSIBLY_SEPARATED_PAIRS_OF_HEX_DIGITS = «HEX_CHARACTER» «HEX_CHARACTER» ("_"? «HEX_CHARACTER» «HEX_CHARACTER»)*; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn possibly_separated_pairs_of_hex_digits(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')), - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')), - scan_zero_or_more!( - stream, - scan_sequence!( - scan_optional!(stream, scan_chars!(stream, '_')), - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')), - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')) - ) - ) - ) - } - // PRAGMA_KEYWORD = "pragma"; #[allow(dead_code)] @@ -2653,7 +2589,7 @@ impl Language { scan_chars!(stream, '?') } - // RAW_IDENTIFIER = IDENTIFIER_START IDENTIFIER_PART*; + // «RAW_IDENTIFIER» = «IDENTIFIER_START» «IDENTIFIER_PART»*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2690,6 +2626,145 @@ impl Language { ) } + // «RESERVED_WORD_IN_ANY_VERSION» = "abstract" + // | "after" + // | "byte" + // | "catch" + // | "final" + // | "finney" + // | "hex" + // | "in" + // | "inline" + // | "match" + // | "null" + // | "of" + // | "relocatable" + // | "static" + // | "szabo" + // | "throw" + // | "try" + // | "type" + // | "typeof" + // | "var" + // | "years"; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn reserved_word_in_any_version(&self, stream: &mut Stream) -> bool { + scan_trie!( + stream, + 'a' + scan_trie!( + stream, + 'b' + scan_chars!(stream, 's', 't', 'r', 'a', 'c', 't'), + 'f' + scan_chars!(stream, 't', 'e', 'r') + ), + 'b' + scan_chars!(stream, 'y', 't', 'e'), + 'c' + scan_chars!(stream, 'a', 't', 'c', 'h'), + 'f' + scan_sequence!( + scan_chars!(stream, 'i', 'n'), + scan_trie!( + stream, + 'a' + scan_chars!(stream, 'l'), + 'n' + scan_chars!(stream, 'e', 'y') + ) + ), + 'h' + scan_chars!(stream, 'e', 'x'), + 'i' + scan_sequence!( + scan_chars!(stream, 'n'), + scan_trie!(stream, EMPTY, 'l' + scan_chars!(stream, 'i', 'n', 'e')) + ), + 'm' + scan_chars!(stream, 'a', 't', 'c', 'h'), + 'n' + scan_chars!(stream, 'u', 'l', 'l'), + 'o' + scan_chars!(stream, 'f'), + 'r' + scan_chars!(stream, 'e', 'l', 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e'), + 's' + scan_trie!( + stream, + 't' + scan_chars!(stream, 'a', 't', 'i', 'c'), + 'z' + scan_chars!(stream, 'a', 'b', 'o') + ), + 't' + scan_trie!( + stream, + 'h' + scan_chars!(stream, 'r', 'o', 'w'), + 'r' + scan_chars!(stream, 'y'), + 'y' + scan_sequence!( + scan_chars!(stream, 'p', 'e'), + scan_trie!(stream, EMPTY, 'o' + scan_chars!(stream, 'f')) + ) + ), + 'v' + scan_chars!(stream, 'a', 'r'), + 'y' + scan_chars!(stream, 'e', 'a', 'r', 's') + ) + } + + // (* v0.5.0 *) + // «RESERVED_WORD_IN_SOME_VERSION» = "alias" + // | "apply" + // | "auto" + // | "copyof" + // | "define" + // | "implements" + // | "macro" + // | "mutable" + // | "partial" + // | "promise" + // | "reference" + // | "sealed" + // | "sizeof" + // | "supports" + // | "typedef"; + + #[allow(dead_code, non_snake_case)] + fn reserved_word_in_some_version__0_5_0(&self, stream: &mut Stream) -> bool { + scan_trie!( + stream, + 'a' + scan_trie!( + stream, + 'l' + scan_chars!(stream, 'i', 'a', 's'), + 'p' + scan_chars!(stream, 'p', 'l', 'y'), + 'u' + scan_chars!(stream, 't', 'o') + ), + 'c' + scan_chars!(stream, 'o', 'p', 'y', 'o', 'f'), + 'd' + scan_chars!(stream, 'e', 'f', 'i', 'n', 'e'), + 'i' + scan_chars!(stream, 'm', 'p', 'l', 'e', 'm', 'e', 'n', 't', 's'), + 'm' + scan_trie!( + stream, + 'a' + scan_chars!(stream, 'c', 'r', 'o'), + 'u' + scan_chars!(stream, 't', 'a', 'b', 'l', 'e') + ), + 'p' + scan_trie!( + stream, + 'a' + scan_chars!(stream, 'r', 't', 'i', 'a', 'l'), + 'r' + scan_chars!(stream, 'o', 'm', 'i', 's', 'e') + ), + 'r' + scan_chars!(stream, 'e', 'f', 'e', 'r', 'e', 'n', 'c', 'e'), + 's' + scan_trie!( + stream, + 'e' + scan_chars!(stream, 'a', 'l', 'e', 'd'), + 'i' + scan_chars!(stream, 'z', 'e', 'o', 'f'), + 'u' + scan_chars!(stream, 'p', 'p', 'o', 'r', 't', 's') + ), + 't' + scan_chars!(stream, 'y', 'p', 'e', 'd', 'e', 'f') + ) + } + + #[allow(non_snake_case)] + pub(crate) fn reserved_word_in_some_version__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_5_0 { + Some(self.reserved_word_in_some_version__0_5_0(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn reserved_word_in_some_version(&self, stream: &mut Stream) -> bool { + self.reserved_word_in_some_version__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + // RETURN_KEYWORD = "return"; #[allow(dead_code)] @@ -2762,7 +2837,7 @@ impl Language { scan_chars!(stream, ';') } - // SIGNED_FIXED_TYPE = "fixed" ("0"…"9"+ "x" "0"…"9"+)?; + // SIGNED_FIXED_TYPE = "fixed" «FIXED_TYPE_SIZE»?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2771,20 +2846,7 @@ impl Language { stream, scan_sequence!( scan_chars!(stream, 'f', 'i', 'x', 'e', 'd'), - scan_optional!( - stream, - scan_sequence!( - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9')) - ), - scan_chars!(stream, 'x'), - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9')) - ) - ) - ) + scan_optional!(stream, self.fixed_type_size(stream)) ), scan_predicate!(stream, |c| c == '$' || ('0' <= c && c <= '9') @@ -2794,7 +2856,7 @@ impl Language { ) } - // SIGNED_INTEGER_TYPE = "int" ("8" | "16" | "24" | "32" | "40" | "48" | "56" | "64" | "72" | "80" | "88" | "96" | "104" | "112" | "120" | "128" | "136" | "144" | "152" | "160" | "168" | "176" | "184" | "192" | "200" | "208" | "216" | "224" | "232" | "240" | "248" | "256")?; + // SIGNED_INTEGER_TYPE = "int" «INTEGER_TYPE_SIZE»?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2858,7 +2920,7 @@ impl Language { ) } - // SINGLE_QUOTED_ASCII_STRING_LITERAL = "'" (ESCAPE_SEQUENCE | (" "…"~" - ("'" | "\\")))* "'"; + // «SINGLE_QUOTED_ASCII_STRING_LITERAL» = "'" («ESCAPE_SEQUENCE» | (" "…"~" - ("'" | "\\")))* "'"; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2879,8 +2941,21 @@ impl Language { ) } + // «SINGLE_QUOTED_HEX_STRING_LITERAL» = "hex" "'" «HEX_STRING_CONTENTS»? "'"; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn single_quoted_hex_string_literal(&self, stream: &mut Stream) -> bool { + scan_sequence!( + scan_chars!(stream, 'h', 'e', 'x'), + scan_chars!(stream, '\''), + scan_optional!(stream, self.hex_string_contents(stream)), + scan_chars!(stream, '\'') + ) + } + // (* v0.7.0 *) - // SINGLE_QUOTED_UNICODE_STRING_LITERAL = "unicode'" (ESCAPE_SEQUENCE | !("'" | "\\" | "\n" | "\r"))* "'"; + // «SINGLE_QUOTED_UNICODE_STRING_LITERAL» = "unicode'" («ESCAPE_SEQUENCE» | !("'" | "\\" | "\n" | "\r"))* "'"; #[allow(dead_code, non_snake_case)] fn single_quoted_unicode_string_literal__0_7_0(&self, stream: &mut Stream) -> bool { @@ -3191,7 +3266,7 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // UNICODE_ESCAPE = "u" «HEX_CHARACTER» «HEX_CHARACTER» «HEX_CHARACTER» «HEX_CHARACTER»; + // «UNICODE_ESCAPE» = "u" «HEX_CHARACTER» «HEX_CHARACTER» «HEX_CHARACTER» «HEX_CHARACTER»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -3214,14 +3289,22 @@ impl Language { } // (* v0.7.0 *) - // UNICODE_STRING_LITERAL = SINGLE_QUOTED_UNICODE_STRING_LITERAL | DOUBLE_QUOTED_UNICODE_STRING_LITERAL; + // UNICODE_STRING_LITERAL = «SINGLE_QUOTED_UNICODE_STRING_LITERAL» | «DOUBLE_QUOTED_UNICODE_STRING_LITERAL»; #[allow(dead_code, non_snake_case)] fn unicode_string_literal__0_7_0(&self, stream: &mut Stream) -> bool { - scan_choice!( + scan_not_followed_by!( stream, - self.single_quoted_unicode_string_literal(stream), - self.double_quoted_unicode_string_literal(stream) + scan_choice!( + stream, + self.single_quoted_unicode_string_literal(stream), + self.double_quoted_unicode_string_literal(stream) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } @@ -3243,20 +3326,76 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // UNSIGNED_FIXED_TYPE = "u" SIGNED_FIXED_TYPE; + // UNSIGNED_FIXED_TYPE = "ufixed" «FIXED_TYPE_SIZE»?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn unsigned_fixed_type(&self, stream: &mut Stream) -> bool { - scan_sequence!(scan_chars!(stream, 'u'), self.signed_fixed_type(stream)) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_chars!(stream, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_optional!(stream, self.fixed_type_size(stream)) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) + ) } - // UNSIGNED_INTEGER_TYPE = "u" SIGNED_INTEGER_TYPE; + // UNSIGNED_INTEGER_TYPE = "uint" «INTEGER_TYPE_SIZE»?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn unsigned_integer_type(&self, stream: &mut Stream) -> bool { - scan_sequence!(scan_chars!(stream, 'u'), self.signed_integer_type(stream)) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_chars!(stream, 'u', 'i', 'n', 't'), + scan_optional!( + stream, + scan_trie!( + stream, + '1' + scan_trie!( + stream, + '0' + scan_chars!(stream, '4'), + '1' + scan_chars!(stream, '2'), + '2' + scan_trie!(stream, ['0' | '8']), + '3' + scan_chars!(stream, '6'), + '4' + scan_chars!(stream, '4'), + '5' + scan_chars!(stream, '2'), + '6' + scan_trie!(stream, EMPTY, ['0' | '8']), + '7' + scan_chars!(stream, '6'), + '8' + scan_chars!(stream, '4'), + '9' + scan_chars!(stream, '2') + ), + '2' + scan_trie!( + stream, + '0' + scan_trie!(stream, ['0' | '8']), + '1' + scan_chars!(stream, '6'), + '2' + scan_chars!(stream, '4'), + '3' + scan_chars!(stream, '2'), + '4' + scan_trie!(stream, EMPTY, ['0' | '8']), + '5' + scan_chars!(stream, '6') + ), + '3' + scan_chars!(stream, '2'), + '4' + scan_trie!(stream, ['0' | '8']), + '5' + scan_chars!(stream, '6'), + '6' + scan_chars!(stream, '4'), + '7' + scan_chars!(stream, '2'), + '8' + scan_trie!(stream, EMPTY, ['0' | '8']), + '9' + scan_chars!(stream, '6') + ) + ) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) + ) } // USING_KEYWORD = "using"; @@ -3459,13 +3598,21 @@ impl Language { #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn yul_decimal_literal(&self, stream: &mut Stream) -> bool { - scan_choice!( + scan_not_followed_by!( stream, - scan_chars!(stream, '0'), - scan_sequence!( - scan_predicate!(stream, |c| ('1' <= c && c <= '9')), - scan_zero_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))) - ) + scan_choice!( + stream, + scan_chars!(stream, '0'), + scan_sequence!( + scan_predicate!(stream, |c| ('1' <= c && c <= '9')), + scan_zero_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))) + ) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } @@ -3474,18 +3621,26 @@ impl Language { #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn yul_hex_literal(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_chars!(stream, '0', 'x'), - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')) - ) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_chars!(stream, '0', 'x'), + scan_one_or_more!( + stream, + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')) + ) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } - // YUL_IDENTIFIER = RAW_IDENTIFIER - (YUL_KEYWORD | YUL_RESERVED_KEYWORD); + // YUL_IDENTIFIER = «RAW_IDENTIFIER» - («YUL_KEYWORD» | «YUL_RESERVED_WORD»); #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -3502,17 +3657,17 @@ impl Language { } // (* v0.4.11 *) - // YUL_KEYWORD = BREAK_KEYWORD - // | CASE_KEYWORD - // | CONTINUE_KEYWORD - // | DEFAULT_KEYWORD - // | FALSE_KEYWORD - // | FOR_KEYWORD - // | FUNCTION_KEYWORD - // | IF_KEYWORD - // | LET_KEYWORD - // | SWITCH_KEYWORD - // | TRUE_KEYWORD; + // «YUL_KEYWORD» = BREAK_KEYWORD + // | CASE_KEYWORD + // | CONTINUE_KEYWORD + // | DEFAULT_KEYWORD + // | FALSE_KEYWORD + // | FOR_KEYWORD + // | FUNCTION_KEYWORD + // | IF_KEYWORD + // | LET_KEYWORD + // | SWITCH_KEYWORD + // | TRUE_KEYWORD; #[allow(dead_code, non_snake_case)] fn yul_keyword__0_4_11(&self, stream: &mut Stream) -> bool { @@ -3533,18 +3688,18 @@ impl Language { } // (* v0.6.0 *) - // YUL_KEYWORD = BREAK_KEYWORD - // | CASE_KEYWORD - // | CONTINUE_KEYWORD - // | DEFAULT_KEYWORD - // | FALSE_KEYWORD - // | FOR_KEYWORD - // | FUNCTION_KEYWORD - // | IF_KEYWORD - // | LEAVE_KEYWORD - // | LET_KEYWORD - // | SWITCH_KEYWORD - // | TRUE_KEYWORD; + // «YUL_KEYWORD» = BREAK_KEYWORD + // | CASE_KEYWORD + // | CONTINUE_KEYWORD + // | DEFAULT_KEYWORD + // | FALSE_KEYWORD + // | FOR_KEYWORD + // | FUNCTION_KEYWORD + // | IF_KEYWORD + // | LEAVE_KEYWORD + // | LET_KEYWORD + // | SWITCH_KEYWORD + // | TRUE_KEYWORD; #[allow(dead_code, non_snake_case)] fn yul_keyword__0_6_0(&self, stream: &mut Stream) -> bool { @@ -3573,11 +3728,11 @@ impl Language { } } - // YUL_RESERVED_KEYWORD = "hex"; + // «YUL_RESERVED_WORD» = "hex"; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn yul_reserved_keyword(&self, stream: &mut Stream) -> bool { + pub(crate) fn yul_reserved_word(&self, stream: &mut Stream) -> bool { scan_chars!(stream, 'h', 'e', 'x') } } diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/AsciiStringLiteralsList.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/AsciiStringLiteralsList.rs new file mode 100644 index 0000000000..b4a4236c8d --- /dev/null +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/AsciiStringLiteralsList.rs @@ -0,0 +1,14 @@ +// This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +use crate::cst_output::runner::run; +use anyhow::Result; + +#[test] +fn multiple() -> Result<()> { + return run("AsciiStringLiteralsList", "multiple"); +} + +#[test] +fn single() -> Result<()> { + return run("AsciiStringLiteralsList", "single"); +} diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/ContractDefinition.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/ContractDefinition.rs index 6fe4e30690..a93b19a5b9 100644 --- a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/ContractDefinition.rs +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/ContractDefinition.rs @@ -13,6 +13,79 @@ fn empty_contract() -> Result<()> { return run("ContractDefinition", "empty_contract"); } +#[test] +fn inheritence_specifier() -> Result<()> { + return run("ContractDefinition", "inheritence_specifier"); +} + +#[test] +fn member_constructor_definition() -> Result<()> { + return run("ContractDefinition", "member_constructor_definition"); +} + +#[test] +fn member_enum_definition() -> Result<()> { + return run("ContractDefinition", "member_enum_definition"); +} + +#[test] +fn member_error_definition() -> Result<()> { + return run("ContractDefinition", "member_error_definition"); +} + +#[test] +fn member_event_definition() -> Result<()> { + return run("ContractDefinition", "member_event_definition"); +} + +#[test] +fn member_fallback_function_definition() -> Result<()> { + return run("ContractDefinition", "member_fallback_function_definition"); +} + +#[test] +fn member_function_definition() -> Result<()> { + return run("ContractDefinition", "member_function_definition"); +} + +#[test] +fn member_modifier_definition() -> Result<()> { + return run("ContractDefinition", "member_modifier_definition"); +} + +#[test] +fn member_receive_function_definition() -> Result<()> { + return run("ContractDefinition", "member_receive_function_definition"); +} + +#[test] +fn member_state_variable_declaration() -> Result<()> { + return run("ContractDefinition", "member_state_variable_declaration"); +} + +#[test] +fn member_struct_definition() -> Result<()> { + return run("ContractDefinition", "member_struct_definition"); +} + +#[test] +fn member_unnamed_function_definition() -> Result<()> { + return run("ContractDefinition", "member_unnamed_function_definition"); +} + +#[test] +fn member_user_defined_value_type_definition() -> Result<()> { + return run( + "ContractDefinition", + "member_user_defined_value_type_definition", + ); +} + +#[test] +fn member_using_directive() -> Result<()> { + return run("ContractDefinition", "member_using_directive"); +} + #[test] fn missing_field_type() -> Result<()> { return run("ContractDefinition", "missing_field_type"); diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/ElementaryType.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/ElementaryType.rs deleted file mode 100644 index 26857867a8..0000000000 --- a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/ElementaryType.rs +++ /dev/null @@ -1,9 +0,0 @@ -// This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -use crate::cst_output::runner::run; -use anyhow::Result; - -#[test] -fn byte() -> Result<()> { - return run("ElementaryType", "byte"); -} diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/HexStringLiteralsList.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/HexStringLiteralsList.rs new file mode 100644 index 0000000000..de95d6f40c --- /dev/null +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/HexStringLiteralsList.rs @@ -0,0 +1,14 @@ +// This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +use crate::cst_output::runner::run; +use anyhow::Result; + +#[test] +fn multiple() -> Result<()> { + return run("HexStringLiteralsList", "multiple"); +} + +#[test] +fn single() -> Result<()> { + return run("HexStringLiteralsList", "single"); +} diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/ImportDirective.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/ImportDirective.rs index 47d7ac9a27..3f9120185b 100644 --- a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/ImportDirective.rs +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/ImportDirective.rs @@ -4,26 +4,26 @@ use crate::cst_output::runner::run; use anyhow::Result; #[test] -fn asterisk_import() -> Result<()> { - return run("ImportDirective", "asterisk_import"); +fn destructure_import_multiple() -> Result<()> { + return run("ImportDirective", "destructure_import_multiple"); } #[test] -fn selective_import_multiple() -> Result<()> { - return run("ImportDirective", "selective_import_multiple"); +fn destructure_import_single() -> Result<()> { + return run("ImportDirective", "destructure_import_single"); } #[test] -fn selective_import_single() -> Result<()> { - return run("ImportDirective", "selective_import_single"); +fn named_import() -> Result<()> { + return run("ImportDirective", "named_import"); } #[test] -fn simple_import() -> Result<()> { - return run("ImportDirective", "simple_import"); +fn path_import() -> Result<()> { + return run("ImportDirective", "path_import"); } #[test] -fn simple_import_with_alias() -> Result<()> { - return run("ImportDirective", "simple_import_with_alias"); +fn path_import_with_alias() -> Result<()> { + return run("ImportDirective", "path_import_with_alias"); } diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/PragmaDirective.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/PragmaDirective.rs new file mode 100644 index 0000000000..783a8832be --- /dev/null +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/PragmaDirective.rs @@ -0,0 +1,19 @@ +// This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +use crate::cst_output::runner::run; +use anyhow::Result; + +#[test] +fn abi_coder() -> Result<()> { + return run("PragmaDirective", "abi_coder"); +} + +#[test] +fn experimental() -> Result<()> { + return run("PragmaDirective", "experimental"); +} + +#[test] +fn version() -> Result<()> { + return run("PragmaDirective", "version"); +} diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/SourceUnit.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/SourceUnit.rs index 10349db1c6..69e7db61d2 100644 --- a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/SourceUnit.rs +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/SourceUnit.rs @@ -13,6 +13,11 @@ fn end_of_file_trivia() -> Result<()> { return run("SourceUnit", "end_of_file_trivia"); } +#[test] +fn everything() -> Result<()> { + return run("SourceUnit", "everything"); +} + #[test] fn partial_definition() -> Result<()> { return run("SourceUnit", "partial_definition"); diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/StringExpression.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/StringExpression.rs deleted file mode 100644 index 2e6ee066b1..0000000000 --- a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/StringExpression.rs +++ /dev/null @@ -1,34 +0,0 @@ -// This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -use crate::cst_output::runner::run; -use anyhow::Result; - -#[test] -fn ascii_multiple() -> Result<()> { - return run("StringExpression", "ascii_multiple"); -} - -#[test] -fn ascii_single() -> Result<()> { - return run("StringExpression", "ascii_single"); -} - -#[test] -fn hex_multiple() -> Result<()> { - return run("StringExpression", "hex_multiple"); -} - -#[test] -fn hex_single() -> Result<()> { - return run("StringExpression", "hex_single"); -} - -#[test] -fn unicode_multiple() -> Result<()> { - return run("StringExpression", "unicode_multiple"); -} - -#[test] -fn unicode_single() -> Result<()> { - return run("StringExpression", "unicode_single"); -} diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/UnicodeStringLiteralsList.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/UnicodeStringLiteralsList.rs new file mode 100644 index 0000000000..50391d5c99 --- /dev/null +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/UnicodeStringLiteralsList.rs @@ -0,0 +1,14 @@ +// This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +use crate::cst_output::runner::run; +use anyhow::Result; + +#[test] +fn multiple() -> Result<()> { + return run("UnicodeStringLiteralsList", "multiple"); +} + +#[test] +fn single() -> Result<()> { + return run("UnicodeStringLiteralsList", "single"); +} diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/UsingDirective.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/UsingDirective.rs index b4070f6c1b..e54b32a00f 100644 --- a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/UsingDirective.rs +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/UsingDirective.rs @@ -4,6 +4,21 @@ use crate::cst_output::runner::run; use anyhow::Result; #[test] -fn user_defined_operator() -> Result<()> { - return run("UsingDirective", "user_defined_operator"); +fn destructure_multiple() -> Result<()> { + return run("UsingDirective", "destructure_multiple"); +} + +#[test] +fn destructure_single() -> Result<()> { + return run("UsingDirective", "destructure_single"); +} + +#[test] +fn path_named() -> Result<()> { + return run("UsingDirective", "path_named"); +} + +#[test] +fn path_unnamed() -> Result<()> { + return run("UsingDirective", "path_unnamed"); } diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/UsingDirectiveSymbol.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/UsingDirectiveSymbol.rs new file mode 100644 index 0000000000..aad35a72e3 --- /dev/null +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/UsingDirectiveSymbol.rs @@ -0,0 +1,24 @@ +// This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +use crate::cst_output::runner::run; +use anyhow::Result; + +#[test] +fn identifier_path() -> Result<()> { + return run("UsingDirectiveSymbol", "identifier_path"); +} + +#[test] +fn identifier_path_as_operator() -> Result<()> { + return run("UsingDirectiveSymbol", "identifier_path_as_operator"); +} + +#[test] +fn single_id() -> Result<()> { + return run("UsingDirectiveSymbol", "single_id"); +} + +#[test] +fn single_id_as_operator() -> Result<()> { + return run("UsingDirectiveSymbol", "single_id_as_operator"); +} diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/mod.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/mod.rs index 7d619d00f8..648642454c 100644 --- a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/mod.rs +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/mod.rs @@ -1,5 +1,7 @@ // This file is generated automatically by infrastructure scripts. Please don't edit by hand. +#[allow(non_snake_case)] +mod AsciiStringLiteralsList; #[allow(non_snake_case)] mod Block; #[allow(non_snake_case)] @@ -11,8 +13,6 @@ mod DecimalLiteral; #[allow(non_snake_case)] mod DeleteStatement; #[allow(non_snake_case)] -mod ElementaryType; -#[allow(non_snake_case)] mod EnumDefinition; #[allow(non_snake_case)] mod Expression; @@ -27,6 +27,8 @@ mod HexLiteral; #[allow(non_snake_case)] mod HexStringLiteral; #[allow(non_snake_case)] +mod HexStringLiteralsList; +#[allow(non_snake_case)] mod Identifier; #[allow(non_snake_case)] mod ImportDirective; @@ -41,6 +43,8 @@ mod NewExpression; #[allow(non_snake_case)] mod NumericExpression; #[allow(non_snake_case)] +mod PragmaDirective; +#[allow(non_snake_case)] mod ReceiveFunctionDefinition; #[allow(non_snake_case)] mod SignedIntegerType; @@ -51,16 +55,18 @@ mod SourceUnit; #[allow(non_snake_case)] mod Statement; #[allow(non_snake_case)] -mod StringExpression; -#[allow(non_snake_case)] mod TupleDeconstructionStatement; #[allow(non_snake_case)] mod TupleExpression; #[allow(non_snake_case)] +mod UnicodeStringLiteralsList; +#[allow(non_snake_case)] mod UnsignedIntegerType; #[allow(non_snake_case)] mod UsingDirective; #[allow(non_snake_case)] +mod UsingDirectiveSymbol; +#[allow(non_snake_case)] mod VariableDeclarationStatement; #[allow(non_snake_case)] mod VersionPragma; diff --git a/crates/solidity/outputs/npm/crate/src/generated/kinds.rs b/crates/solidity/outputs/npm/crate/src/generated/kinds.rs index e60f437c22..59a834982c 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/kinds.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/kinds.rs @@ -23,7 +23,6 @@ pub enum TokenKind { AmpersandEqual, AnonymousKeyword, AsKeyword, - AsciiEscape, AsciiStringLiteral, AssemblyKeyword, Asterisk, @@ -36,7 +35,7 @@ pub enum TokenKind { BarEqual, BoolKeyword, BreakKeyword, - ByteType, + ByteKeyword, CalldataKeyword, Caret, CaretEqual, @@ -53,14 +52,10 @@ pub enum TokenKind { ContinueKeyword, ContractKeyword, DaysKeyword, - DecimalExponent, DecimalLiteral, - DecimalNumber, DefaultKeyword, DeleteKeyword, DoKeyword, - DoubleQuotedAsciiStringLiteral, - DoubleQuotedUnicodeStringLiteral, ElseKeyword, EmitKeyword, EndOfLine, @@ -69,10 +64,8 @@ pub enum TokenKind { EqualEqual, EqualGreaterThan, ErrorKeyword, - EscapeSequence, EtherKeyword, EventKeyword, - Evmasm, ExperimentalKeyword, ExternalKeyword, FallbackKeyword, @@ -90,13 +83,10 @@ pub enum TokenKind { GreaterThanGreaterThanGreaterThan, GreaterThanGreaterThanGreaterThanEqual, GweiKeyword, - HexByteEscape, HexLiteral, HexStringLiteral, HoursKeyword, Identifier, - IdentifierPart, - IdentifierStart, IfKeyword, ImmutableKeyword, ImportKeyword, @@ -121,8 +111,6 @@ pub enum TokenKind { ModifierKeyword, MultilineComment, NewKeyword, - NotAnIdentifierInAnyVersion, - NotAnIdentifierInSomeVersions, OpenBrace, OpenBracket, OpenParen, @@ -134,13 +122,11 @@ pub enum TokenKind { Plus, PlusEqual, PlusPlus, - PossiblySeparatedPairsOfHexDigits, PragmaKeyword, PrivateKeyword, PublicKeyword, PureKeyword, QuestionMark, - RawIdentifier, ReceiveKeyword, ReturnKeyword, ReturnsKeyword, @@ -150,8 +136,6 @@ pub enum TokenKind { SignedFixedType, SignedIntegerType, SingleLineComment, - SingleQuotedAsciiStringLiteral, - SingleQuotedUnicodeStringLiteral, Slash, SlashEqual, SolidityKeyword, @@ -166,7 +150,6 @@ pub enum TokenKind { TryKeyword, TypeKeyword, UncheckedKeyword, - UnicodeEscape, UnicodeStringLiteral, UnsignedFixedType, UnsignedIntegerType, @@ -183,8 +166,6 @@ pub enum TokenKind { YulDecimalLiteral, YulHexLiteral, YulIdentifier, - YulKeyword, - YulReservedKeyword, } #[napi(string_enum)] #[derive( @@ -198,146 +179,132 @@ pub enum TokenKind { )] pub enum RuleKind { ABICoderPragma, - AddSubExpression, - AddSubOperator, AddressType, - AndExpression, - AndOperator, - ArgumentList, - Arguments, - ArrayLiteral, + ArgumentsDeclaration, + ArrayExpression, ArrayTypeName, - AssemblyFlags, + ArrayValuesList, + AsciiStringLiteralsList, + AssemblyFlagsList, AssemblyStatement, - AssignmentExpression, - AssignmentOperator, - AsteriskImport, - BitAndExpression, - BitAndOperator, - BitOrExpression, - BitOrOperator, - BitXOrExpression, - BitXOrOperator, + BinaryExpression, Block, - BooleanLiteral, BreakStatement, CatchClause, + CatchClauseError, + CatchClausesList, ConditionalExpression, - ConditionalOperator, ConstantDefinition, - ConstructorAttribute, + ConstructorAttributesList, ConstructorDefinition, ContinueStatement, - ContractBodyElements, ContractDefinition, - DataLocation, - Definition, + ContractMembersList, + DeconstructionImport, + DeconstructionImportSymbol, + DeconstructionImportSymbolsList, DeleteStatement, - Directive, DoWhileStatement, - ElementaryType, EmitStatement, EndOfFileTrivia, EnumDefinition, - EqualityComparisonExpression, - EqualityComparisonOperator, ErrorDefinition, ErrorParameter, + ErrorParametersList, EventDefinition, EventParameter, + EventParametersList, ExperimentalPragma, - ExponentiationExpression, - ExponentiationOperator, Expression, ExpressionStatement, - FallbackFunctionAttribute, + FallbackFunctionAttributesList, FallbackFunctionDefinition, ForStatement, - FunctionAttribute, + FunctionAttributesList, FunctionCallExpression, - FunctionCallOperator, FunctionCallOptions, FunctionDefinition, FunctionType, + FunctionTypeAttributesList, + HexStringLiteralsList, IdentifierPath, + IdentifierPathsList, + IdentifiersList, IfStatement, - ImportAlias, ImportDirective, - ImportPath, IndexAccessExpression, - IndexAccessOperator, InheritanceSpecifier, - InheritanceSpecifierList, + InheritanceType, + InheritanceTypesList, InterfaceDefinition, + InterfaceMembersList, LeadingTrivia, LibraryDefinition, + LibraryMembersList, MappingKeyType, MappingType, MappingValueType, MemberAccessExpression, - MemberAccessOperator, - ModifierAttribute, + ModifierAttributesList, ModifierDefinition, ModifierInvocation, - MulDivModExpression, - MulDivModOperator, NamedArgument, - NamedArgumentList, + NamedArgumentsDeclaration, + NamedArgumentsList, + NamedImport, NewExpression, - NumberUnit, NumericExpression, - OrExpression, - OrOperator, - OrderComparisonExpression, - OrderComparisonOperator, OverrideSpecifier, - ParameterDeclaration, - ParameterList, - PayableType, - PositionalArgumentList, + Parameter, + ParametersDeclaration, + ParametersList, + PathImport, + PositionalArgumentsList, PragmaDirective, - PrimaryExpression, - ReceiveFunctionAttribute, + ReceiveFunctionAttributesList, ReceiveFunctionDefinition, - Results, ReturnStatement, + ReturnsDeclaration, RevertStatement, - SelectiveImport, - ShiftExpression, - ShiftOperator, - SimpleImport, - SimpleStatement, SourceUnit, - StateVariableAttribute, - StateVariableDeclaration, + SourceUnitMembersList, + StateVariableAttributesList, + StateVariableDefinition, Statement, - StringExpression, + StatementsList, StructDefinition, StructMember, + StructMembersList, ThrowStatement, TrailingTrivia, TryStatement, TupleDeconstructionStatement, TupleExpression, + TupleMember, + TupleMembersList, + TupleValuesList, TypeExpression, TypeName, UnaryPostfixExpression, - UnaryPostfixOperator, UnaryPrefixExpression, - UnaryPrefixOperator, UncheckedBlock, - UnnamedFunctionAttribute, + UnicodeStringLiteralsList, + UnnamedFunctionAttributesList, UnnamedFunctionDefinition, - UserDefinedOperator, UserDefinedValueTypeDefinition, UsingDirective, + UsingDirectiveDeconstruction, + UsingDirectivePath, + UsingDirectiveSymbol, + UsingDirectiveSymbolsList, + VariableDeclaration, VariableDeclarationStatement, VersionPragma, - VersionPragmaAlternatives, - VersionPragmaComparator, - VersionPragmaExpressionList, - VersionPragmaRange, + VersionPragmaBinaryExpression, + VersionPragmaExpression, + VersionPragmaExpressionsList, VersionPragmaSpecifier, + VersionPragmaUnaryExpression, WhileStatement, YulAssignmentStatement, YulBlock, @@ -345,14 +312,21 @@ pub enum RuleKind { YulContinueStatement, YulDeclarationStatement, YulExpression, + YulExpressionsList, YulForStatement, YulFunctionCallExpression, YulFunctionDefinition, YulIdentifierPath, + YulIdentifierPathsList, + YulIdentifiersList, YulIfStatement, YulLeaveStatement, - YulLiteral, + YulParametersDeclaration, + YulReturnsDeclaration, YulStatement, + YulStatementsList, + YulSwitchCase, + YulSwitchCasesList, YulSwitchStatement, } #[napi(string_enum)] @@ -369,46 +343,41 @@ pub enum ProductionKind { ABICoderPragma, AbicoderKeyword, AbstractKeyword, - AddSubOperator, AddressKeyword, AddressType, Ampersand, AmpersandAmpersand, AmpersandEqual, - AndOperator, AnonymousKeyword, - ArgumentList, - ArrayLiteral, + ArgumentsDeclaration, + ArrayExpression, + ArrayValuesList, AsKeyword, - AsciiEscape, AsciiStringLiteral, - AssemblyFlags, + AsciiStringLiteralsList, + AssemblyFlagsList, AssemblyKeyword, AssemblyStatement, - AssignmentOperator, Asterisk, AsteriskAsterisk, AsteriskEqual, - AsteriskImport, Bang, BangEqual, Bar, BarBar, BarEqual, - BitAndOperator, - BitOrOperator, - BitXOrOperator, Block, BoolKeyword, - BooleanLiteral, BreakKeyword, BreakStatement, - ByteType, + ByteKeyword, CalldataKeyword, Caret, CaretEqual, CaseKeyword, CatchClause, + CatchClauseError, + CatchClausesList, CatchKeyword, CloseBrace, CloseBracket, @@ -416,31 +385,26 @@ pub enum ProductionKind { Colon, ColonEqual, Comma, - ConditionalOperator, ConstantDefinition, ConstantKeyword, - ConstructorAttribute, + ConstructorAttributesList, ConstructorDefinition, ConstructorKeyword, ContinueKeyword, ContinueStatement, ContractDefinition, ContractKeyword, - DataLocation, + ContractMembersList, DaysKeyword, - DecimalExponent, DecimalLiteral, - DecimalNumber, + DeconstructionImport, + DeconstructionImportSymbol, + DeconstructionImportSymbolsList, DefaultKeyword, - Definition, DeleteKeyword, DeleteStatement, - Directive, DoKeyword, DoWhileStatement, - DoubleQuotedAsciiStringLiteral, - DoubleQuotedUnicodeStringLiteral, - ElementaryType, ElseKeyword, EmitKeyword, EmitStatement, @@ -451,23 +415,21 @@ pub enum ProductionKind { Equal, EqualEqual, EqualGreaterThan, - EqualityComparisonOperator, ErrorDefinition, ErrorKeyword, ErrorParameter, - EscapeSequence, + ErrorParametersList, EtherKeyword, EventDefinition, EventKeyword, EventParameter, - Evmasm, + EventParametersList, ExperimentalKeyword, ExperimentalPragma, - ExponentiationOperator, Expression, ExpressionStatement, ExternalKeyword, - FallbackFunctionAttribute, + FallbackFunctionAttributesList, FallbackFunctionDefinition, FallbackKeyword, FalseKeyword, @@ -476,12 +438,12 @@ pub enum ProductionKind { ForKeyword, ForStatement, FromKeyword, - FunctionAttribute, - FunctionCallOperator, + FunctionAttributesList, FunctionCallOptions, FunctionDefinition, FunctionKeyword, FunctionType, + FunctionTypeAttributesList, GlobalKeyword, GreaterThan, GreaterThanEqual, @@ -490,27 +452,26 @@ pub enum ProductionKind { GreaterThanGreaterThanGreaterThan, GreaterThanGreaterThanGreaterThanEqual, GweiKeyword, - HexByteEscape, HexLiteral, HexStringLiteral, + HexStringLiteralsList, HoursKeyword, Identifier, - IdentifierPart, IdentifierPath, - IdentifierStart, + IdentifierPathsList, + IdentifiersList, IfKeyword, IfStatement, ImmutableKeyword, - ImportAlias, ImportDirective, ImportKeyword, - ImportPath, - IndexAccessOperator, IndexedKeyword, InheritanceSpecifier, - InheritanceSpecifierList, + InheritanceType, + InheritanceTypesList, InterfaceDefinition, InterfaceKeyword, + InterfaceMembersList, InternalKeyword, IsKeyword, LeadingTrivia, @@ -522,90 +483,81 @@ pub enum ProductionKind { LetKeyword, LibraryDefinition, LibraryKeyword, + LibraryMembersList, MappingKeyType, MappingKeyword, MappingType, MappingValueType, - MemberAccessOperator, MemoryKeyword, Minus, MinusEqual, MinusGreaterThan, MinusMinus, MinutesKeyword, - ModifierAttribute, + ModifierAttributesList, ModifierDefinition, ModifierInvocation, ModifierKeyword, - MulDivModOperator, MultilineComment, NamedArgument, - NamedArgumentList, + NamedArgumentsDeclaration, + NamedArgumentsList, + NamedImport, NewExpression, NewKeyword, - NotAnIdentifierInAnyVersion, - NotAnIdentifierInSomeVersions, - NumberUnit, NumericExpression, OpenBrace, OpenBracket, OpenParen, - OrOperator, - OrderComparisonOperator, OverrideKeyword, OverrideSpecifier, - ParameterDeclaration, - ParameterList, + Parameter, + ParametersDeclaration, + ParametersList, + PathImport, PayableKeyword, - PayableType, Percent, PercentEqual, Period, Plus, PlusEqual, PlusPlus, - PositionalArgumentList, - PossiblySeparatedPairsOfHexDigits, + PositionalArgumentsList, PragmaDirective, PragmaKeyword, - PrimaryExpression, PrivateKeyword, PublicKeyword, PureKeyword, QuestionMark, - RawIdentifier, - ReceiveFunctionAttribute, + ReceiveFunctionAttributesList, ReceiveFunctionDefinition, ReceiveKeyword, ReturnKeyword, ReturnStatement, + ReturnsDeclaration, ReturnsKeyword, RevertKeyword, RevertStatement, SecondsKeyword, - SelectiveImport, Semicolon, - ShiftOperator, SignedFixedType, SignedIntegerType, - SimpleImport, - SimpleStatement, SingleLineComment, - SingleQuotedAsciiStringLiteral, - SingleQuotedUnicodeStringLiteral, Slash, SlashEqual, SolidityKeyword, SourceUnit, - StateVariableAttribute, - StateVariableDeclaration, + SourceUnitMembersList, + StateVariableAttributesList, + StateVariableDefinition, Statement, + StatementsList, StorageKeyword, - StringExpression, StringKeyword, StructDefinition, StructKeyword, StructMember, + StructMembersList, SwitchKeyword, SzaboKeyword, ThrowKeyword, @@ -617,26 +569,33 @@ pub enum ProductionKind { TryStatement, TupleDeconstructionStatement, TupleExpression, + TupleMember, + TupleMembersList, + TupleValuesList, TypeExpression, TypeKeyword, TypeName, - UnaryPostfixOperator, - UnaryPrefixOperator, UncheckedBlock, UncheckedKeyword, - UnicodeEscape, UnicodeStringLiteral, - UnnamedFunctionAttribute, + UnicodeStringLiteralsList, + UnnamedFunctionAttributesList, UnnamedFunctionDefinition, UnsignedFixedType, UnsignedIntegerType, - UserDefinedOperator, UserDefinedValueTypeDefinition, UsingDirective, + UsingDirectiveDeconstruction, + UsingDirectivePath, + UsingDirectiveSymbol, + UsingDirectiveSymbolsList, UsingKeyword, VarKeyword, + VariableDeclaration, VariableDeclarationStatement, VersionPragma, + VersionPragmaExpression, + VersionPragmaExpressionsList, VersionPragmaSpecifier, VersionPragmaValue, ViewKeyword, @@ -654,16 +613,21 @@ pub enum ProductionKind { YulDecimalLiteral, YulDeclarationStatement, YulExpression, + YulExpressionsList, YulForStatement, YulFunctionDefinition, YulHexLiteral, YulIdentifier, YulIdentifierPath, + YulIdentifierPathsList, + YulIdentifiersList, YulIfStatement, - YulKeyword, YulLeaveStatement, - YulLiteral, - YulReservedKeyword, + YulParametersDeclaration, + YulReturnsDeclaration, YulStatement, + YulStatementsList, + YulSwitchCase, + YulSwitchCasesList, YulSwitchStatement, } diff --git a/crates/solidity/outputs/npm/crate/src/generated/language.rs b/crates/solidity/outputs/npm/crate/src/generated/language.rs index eb2befd219..7c071f537c 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/language.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/language.rs @@ -139,9 +139,6 @@ impl Language { ProductionKind::AsKeyword => { Language::as_keyword.scan(self, input, TokenKind::AsKeyword) } - ProductionKind::AsciiEscape => { - Language::ascii_escape.scan(self, input, TokenKind::AsciiEscape) - } ProductionKind::AsciiStringLiteral => { Language::ascii_string_literal.scan(self, input, TokenKind::AsciiStringLiteral) } @@ -168,8 +165,8 @@ impl Language { ProductionKind::BreakKeyword => { Language::break_keyword.scan(self, input, TokenKind::BreakKeyword) } - ProductionKind::ByteType => { - Language::byte_type__sparse_dispatch.scan(self, input, TokenKind::ByteType) + ProductionKind::ByteKeyword => { + Language::byte_keyword__sparse_dispatch.scan(self, input, TokenKind::ByteKeyword) } ProductionKind::CalldataKeyword => Language::calldata_keyword__sparse_dispatch.scan( self, @@ -214,15 +211,9 @@ impl Language { ProductionKind::DaysKeyword => { Language::days_keyword.scan(self, input, TokenKind::DaysKeyword) } - ProductionKind::DecimalExponent => { - Language::decimal_exponent.scan(self, input, TokenKind::DecimalExponent) - } ProductionKind::DecimalLiteral => { Language::decimal_literal.scan(self, input, TokenKind::DecimalLiteral) } - ProductionKind::DecimalNumber => { - Language::decimal_number.scan(self, input, TokenKind::DecimalNumber) - } ProductionKind::DefaultKeyword => { Language::default_keyword.scan(self, input, TokenKind::DefaultKeyword) } @@ -232,20 +223,6 @@ impl Language { ProductionKind::DoKeyword => { Language::do_keyword.scan(self, input, TokenKind::DoKeyword) } - ProductionKind::DoubleQuotedAsciiStringLiteral => { - Language::double_quoted_ascii_string_literal.scan( - self, - input, - TokenKind::DoubleQuotedAsciiStringLiteral, - ) - } - ProductionKind::DoubleQuotedUnicodeStringLiteral => { - Language::double_quoted_unicode_string_literal__sparse_dispatch.scan( - self, - input, - TokenKind::DoubleQuotedUnicodeStringLiteral, - ) - } ProductionKind::ElseKeyword => { Language::else_keyword.scan(self, input, TokenKind::ElseKeyword) } @@ -268,16 +245,12 @@ impl Language { ProductionKind::ErrorKeyword => { Language::error_keyword.scan(self, input, TokenKind::ErrorKeyword) } - ProductionKind::EscapeSequence => { - Language::escape_sequence.scan(self, input, TokenKind::EscapeSequence) - } ProductionKind::EtherKeyword => { Language::ether_keyword.scan(self, input, TokenKind::EtherKeyword) } ProductionKind::EventKeyword => { Language::event_keyword.scan(self, input, TokenKind::EventKeyword) } - ProductionKind::Evmasm => Language::evmasm.scan(self, input, TokenKind::Evmasm), ProductionKind::ExperimentalKeyword => { Language::experimental_keyword.scan(self, input, TokenKind::ExperimentalKeyword) } @@ -345,9 +318,6 @@ impl Language { ProductionKind::GweiKeyword => { Language::gwei_keyword__sparse_dispatch.scan(self, input, TokenKind::GweiKeyword) } - ProductionKind::HexByteEscape => { - Language::hex_byte_escape.scan(self, input, TokenKind::HexByteEscape) - } ProductionKind::HexLiteral => { Language::hex_literal.scan(self, input, TokenKind::HexLiteral) } @@ -360,12 +330,6 @@ impl Language { ProductionKind::Identifier => { Language::identifier.scan(self, input, TokenKind::Identifier) } - ProductionKind::IdentifierPart => { - Language::identifier_part.scan(self, input, TokenKind::IdentifierPart) - } - ProductionKind::IdentifierStart => { - Language::identifier_start.scan(self, input, TokenKind::IdentifierStart) - } ProductionKind::IfKeyword => { Language::if_keyword.scan(self, input, TokenKind::IfKeyword) } @@ -438,20 +402,6 @@ impl Language { ProductionKind::NewKeyword => { Language::new_keyword.scan(self, input, TokenKind::NewKeyword) } - ProductionKind::NotAnIdentifierInAnyVersion => { - Language::not_an_identifier_in_any_version.scan( - self, - input, - TokenKind::NotAnIdentifierInAnyVersion, - ) - } - ProductionKind::NotAnIdentifierInSomeVersions => { - Language::not_an_identifier_in_some_versions.scan( - self, - input, - TokenKind::NotAnIdentifierInSomeVersions, - ) - } ProductionKind::OpenBrace => { Language::open_brace.scan(self, input, TokenKind::OpenBrace) } @@ -477,13 +427,6 @@ impl Language { Language::plus_equal.scan(self, input, TokenKind::PlusEqual) } ProductionKind::PlusPlus => Language::plus_plus.scan(self, input, TokenKind::PlusPlus), - ProductionKind::PossiblySeparatedPairsOfHexDigits => { - Language::possibly_separated_pairs_of_hex_digits.scan( - self, - input, - TokenKind::PossiblySeparatedPairsOfHexDigits, - ) - } ProductionKind::PragmaKeyword => { Language::pragma_keyword.scan(self, input, TokenKind::PragmaKeyword) } @@ -499,9 +442,6 @@ impl Language { ProductionKind::QuestionMark => { Language::question_mark.scan(self, input, TokenKind::QuestionMark) } - ProductionKind::RawIdentifier => { - Language::raw_identifier.scan(self, input, TokenKind::RawIdentifier) - } ProductionKind::ReceiveKeyword => { Language::receive_keyword.scan(self, input, TokenKind::ReceiveKeyword) } @@ -529,20 +469,6 @@ impl Language { ProductionKind::SingleLineComment => { Language::single_line_comment.scan(self, input, TokenKind::SingleLineComment) } - ProductionKind::SingleQuotedAsciiStringLiteral => { - Language::single_quoted_ascii_string_literal.scan( - self, - input, - TokenKind::SingleQuotedAsciiStringLiteral, - ) - } - ProductionKind::SingleQuotedUnicodeStringLiteral => { - Language::single_quoted_unicode_string_literal__sparse_dispatch.scan( - self, - input, - TokenKind::SingleQuotedUnicodeStringLiteral, - ) - } ProductionKind::Slash => Language::slash.scan(self, input, TokenKind::Slash), ProductionKind::SlashEqual => { Language::slash_equal.scan(self, input, TokenKind::SlashEqual) @@ -583,9 +509,6 @@ impl Language { input, TokenKind::UncheckedKeyword, ), - ProductionKind::UnicodeEscape => { - Language::unicode_escape.scan(self, input, TokenKind::UnicodeEscape) - } ProductionKind::UnicodeStringLiteral => { Language::unicode_string_literal__sparse_dispatch.scan( self, @@ -640,157 +563,167 @@ impl Language { ProductionKind::YulIdentifier => { Language::yul_identifier.scan(self, input, TokenKind::YulIdentifier) } - ProductionKind::YulKeyword => { - Language::yul_keyword.scan(self, input, TokenKind::YulKeyword) - } - ProductionKind::YulReservedKeyword => { - Language::yul_reserved_keyword.scan(self, input, TokenKind::YulReservedKeyword) - } ProductionKind::ABICoderPragma => Language::abi_coder_pragma.parse(self, input), - ProductionKind::AddSubOperator => Language::add_sub_operator.parse(self, input), ProductionKind::AddressType => Language::address_type.parse(self, input), - ProductionKind::AndOperator => Language::and_operator.parse(self, input), - ProductionKind::ArgumentList => Language::argument_list.parse(self, input), - ProductionKind::ArrayLiteral => Language::array_literal.parse(self, input), - ProductionKind::AssemblyFlags => Language::assembly_flags.parse(self, input), + ProductionKind::ArgumentsDeclaration => { + Language::arguments_declaration.parse(self, input) + } + ProductionKind::ArrayExpression => Language::array_expression.parse(self, input), + ProductionKind::ArrayValuesList => Language::array_values_list.parse(self, input), + ProductionKind::AsciiStringLiteralsList => { + Language::ascii_string_literals_list.parse(self, input) + } + ProductionKind::AssemblyFlagsList => Language::assembly_flags_list.parse(self, input), ProductionKind::AssemblyStatement => Language::assembly_statement.parse(self, input), - ProductionKind::AssignmentOperator => Language::assignment_operator.parse(self, input), - ProductionKind::AsteriskImport => Language::asterisk_import.parse(self, input), - ProductionKind::BitAndOperator => Language::bit_and_operator.parse(self, input), - ProductionKind::BitOrOperator => Language::bit_or_operator.parse(self, input), - ProductionKind::BitXOrOperator => Language::bit_x_or_operator.parse(self, input), ProductionKind::Block => Language::block.parse(self, input), - ProductionKind::BooleanLiteral => Language::boolean_literal.parse(self, input), ProductionKind::BreakStatement => Language::break_statement.parse(self, input), ProductionKind::CatchClause => { Language::catch_clause__sparse_dispatch.parse(self, input) } - ProductionKind::ConditionalOperator => { - Language::conditional_operator.parse(self, input) + ProductionKind::CatchClauseError => { + Language::catch_clause_error__sparse_dispatch.parse(self, input) + } + ProductionKind::CatchClausesList => { + Language::catch_clauses_list__sparse_dispatch.parse(self, input) } ProductionKind::ConstantDefinition => Language::constant_definition.parse(self, input), - ProductionKind::ConstructorAttribute => { - Language::constructor_attribute__sparse_dispatch.parse(self, input) + ProductionKind::ConstructorAttributesList => { + Language::constructor_attributes_list__sparse_dispatch.parse(self, input) } ProductionKind::ConstructorDefinition => { Language::constructor_definition__sparse_dispatch.parse(self, input) } ProductionKind::ContinueStatement => Language::continue_statement.parse(self, input), ProductionKind::ContractDefinition => Language::contract_definition.parse(self, input), - ProductionKind::DataLocation => Language::data_location.parse(self, input), - ProductionKind::Definition => Language::definition.parse(self, input), + ProductionKind::ContractMembersList => { + Language::contract_members_list.parse(self, input) + } + ProductionKind::DeconstructionImport => { + Language::deconstruction_import.parse(self, input) + } + ProductionKind::DeconstructionImportSymbol => { + Language::deconstruction_import_symbol.parse(self, input) + } + ProductionKind::DeconstructionImportSymbolsList => { + Language::deconstruction_import_symbols_list.parse(self, input) + } ProductionKind::DeleteStatement => Language::delete_statement.parse(self, input), - ProductionKind::Directive => Language::directive.parse(self, input), ProductionKind::DoWhileStatement => Language::do_while_statement.parse(self, input), - ProductionKind::ElementaryType => Language::elementary_type.parse(self, input), ProductionKind::EmitStatement => { Language::emit_statement__sparse_dispatch.parse(self, input) } ProductionKind::EndOfFileTrivia => Language::end_of_file_trivia.parse(self, input), ProductionKind::EnumDefinition => Language::enum_definition.parse(self, input), - ProductionKind::EqualityComparisonOperator => { - Language::equality_comparison_operator.parse(self, input) - } ProductionKind::ErrorDefinition => Language::error_definition.parse(self, input), ProductionKind::ErrorParameter => Language::error_parameter.parse(self, input), + ProductionKind::ErrorParametersList => { + Language::error_parameters_list.parse(self, input) + } ProductionKind::EventDefinition => Language::event_definition.parse(self, input), ProductionKind::EventParameter => Language::event_parameter.parse(self, input), - ProductionKind::ExperimentalPragma => Language::experimental_pragma.parse(self, input), - ProductionKind::ExponentiationOperator => { - Language::exponentiation_operator.parse(self, input) + ProductionKind::EventParametersList => { + Language::event_parameters_list.parse(self, input) } + ProductionKind::ExperimentalPragma => Language::experimental_pragma.parse(self, input), ProductionKind::Expression => Language::expression.parse(self, input), ProductionKind::ExpressionStatement => { Language::expression_statement.parse(self, input) } - ProductionKind::FallbackFunctionAttribute => { - Language::fallback_function_attribute__sparse_dispatch.parse(self, input) + ProductionKind::FallbackFunctionAttributesList => { + Language::fallback_function_attributes_list__sparse_dispatch.parse(self, input) } ProductionKind::FallbackFunctionDefinition => { Language::fallback_function_definition__sparse_dispatch.parse(self, input) } ProductionKind::ForStatement => Language::for_statement.parse(self, input), - ProductionKind::FunctionAttribute => Language::function_attribute.parse(self, input), - ProductionKind::FunctionCallOperator => { - Language::function_call_operator.parse(self, input) + ProductionKind::FunctionAttributesList => { + Language::function_attributes_list.parse(self, input) } ProductionKind::FunctionCallOptions => { Language::function_call_options__sparse_dispatch.parse(self, input) } ProductionKind::FunctionDefinition => Language::function_definition.parse(self, input), ProductionKind::FunctionType => Language::function_type.parse(self, input), + ProductionKind::FunctionTypeAttributesList => { + Language::function_type_attributes_list.parse(self, input) + } + ProductionKind::HexStringLiteralsList => { + Language::hex_string_literals_list.parse(self, input) + } ProductionKind::IdentifierPath => Language::identifier_path.parse(self, input), + ProductionKind::IdentifierPathsList => { + Language::identifier_paths_list.parse(self, input) + } + ProductionKind::IdentifiersList => Language::identifiers_list.parse(self, input), ProductionKind::IfStatement => Language::if_statement.parse(self, input), - ProductionKind::ImportAlias => Language::import_alias.parse(self, input), ProductionKind::ImportDirective => Language::import_directive.parse(self, input), - ProductionKind::ImportPath => Language::import_path.parse(self, input), - ProductionKind::IndexAccessOperator => { - Language::index_access_operator.parse(self, input) - } ProductionKind::InheritanceSpecifier => { Language::inheritance_specifier.parse(self, input) } - ProductionKind::InheritanceSpecifierList => { - Language::inheritance_specifier_list.parse(self, input) + ProductionKind::InheritanceType => Language::inheritance_type.parse(self, input), + ProductionKind::InheritanceTypesList => { + Language::inheritance_types_list.parse(self, input) } ProductionKind::InterfaceDefinition => { Language::interface_definition.parse(self, input) } + ProductionKind::InterfaceMembersList => { + Language::interface_members_list.parse(self, input) + } ProductionKind::LeadingTrivia => Language::leading_trivia.parse(self, input), ProductionKind::LibraryDefinition => Language::library_definition.parse(self, input), + ProductionKind::LibraryMembersList => Language::library_members_list.parse(self, input), ProductionKind::MappingKeyType => Language::mapping_key_type.parse(self, input), ProductionKind::MappingType => Language::mapping_type.parse(self, input), ProductionKind::MappingValueType => Language::mapping_value_type.parse(self, input), - ProductionKind::MemberAccessOperator => { - Language::member_access_operator.parse(self, input) + ProductionKind::ModifierAttributesList => { + Language::modifier_attributes_list.parse(self, input) } - ProductionKind::ModifierAttribute => Language::modifier_attribute.parse(self, input), ProductionKind::ModifierDefinition => Language::modifier_definition.parse(self, input), ProductionKind::ModifierInvocation => Language::modifier_invocation.parse(self, input), - ProductionKind::MulDivModOperator => Language::mul_div_mod_operator.parse(self, input), ProductionKind::NamedArgument => Language::named_argument.parse(self, input), - ProductionKind::NamedArgumentList => Language::named_argument_list.parse(self, input), + ProductionKind::NamedArgumentsDeclaration => { + Language::named_arguments_declaration.parse(self, input) + } + ProductionKind::NamedArgumentsList => Language::named_arguments_list.parse(self, input), + ProductionKind::NamedImport => Language::named_import.parse(self, input), ProductionKind::NewExpression => Language::new_expression.parse(self, input), - ProductionKind::NumberUnit => Language::number_unit.parse(self, input), ProductionKind::NumericExpression => Language::numeric_expression.parse(self, input), - ProductionKind::OrOperator => Language::or_operator.parse(self, input), - ProductionKind::OrderComparisonOperator => { - Language::order_comparison_operator.parse(self, input) - } ProductionKind::OverrideSpecifier => Language::override_specifier.parse(self, input), - ProductionKind::ParameterDeclaration => { - Language::parameter_declaration.parse(self, input) + ProductionKind::Parameter => Language::parameter.parse(self, input), + ProductionKind::ParametersDeclaration => { + Language::parameters_declaration.parse(self, input) } - ProductionKind::ParameterList => Language::parameter_list.parse(self, input), - ProductionKind::PayableType => Language::payable_type.parse(self, input), - ProductionKind::PositionalArgumentList => { - Language::positional_argument_list.parse(self, input) + ProductionKind::ParametersList => Language::parameters_list.parse(self, input), + ProductionKind::PathImport => Language::path_import.parse(self, input), + ProductionKind::PositionalArgumentsList => { + Language::positional_arguments_list.parse(self, input) } ProductionKind::PragmaDirective => Language::pragma_directive.parse(self, input), - ProductionKind::PrimaryExpression => Language::primary_expression.parse(self, input), - ProductionKind::ReceiveFunctionAttribute => { - Language::receive_function_attribute__sparse_dispatch.parse(self, input) + ProductionKind::ReceiveFunctionAttributesList => { + Language::receive_function_attributes_list__sparse_dispatch.parse(self, input) } ProductionKind::ReceiveFunctionDefinition => { Language::receive_function_definition__sparse_dispatch.parse(self, input) } ProductionKind::ReturnStatement => Language::return_statement.parse(self, input), + ProductionKind::ReturnsDeclaration => Language::returns_declaration.parse(self, input), ProductionKind::RevertStatement => Language::revert_statement.parse(self, input), - ProductionKind::SelectiveImport => Language::selective_import.parse(self, input), - ProductionKind::ShiftOperator => Language::shift_operator.parse(self, input), - ProductionKind::SimpleImport => Language::simple_import.parse(self, input), - ProductionKind::SimpleStatement => Language::simple_statement.parse(self, input), ProductionKind::SourceUnit => Language::source_unit.parse(self, input), - ProductionKind::StateVariableAttribute => { - Language::state_variable_attribute.parse(self, input) + ProductionKind::SourceUnitMembersList => { + Language::source_unit_members_list.parse(self, input) } - ProductionKind::StateVariableDeclaration => { - Language::state_variable_declaration.parse(self, input) + ProductionKind::StateVariableAttributesList => { + Language::state_variable_attributes_list.parse(self, input) + } + ProductionKind::StateVariableDefinition => { + Language::state_variable_definition.parse(self, input) } ProductionKind::Statement => Language::statement.parse(self, input), - ProductionKind::StringExpression => Language::string_expression.parse(self, input), + ProductionKind::StatementsList => Language::statements_list.parse(self, input), ProductionKind::StructDefinition => Language::struct_definition.parse(self, input), ProductionKind::StructMember => Language::struct_member.parse(self, input), + ProductionKind::StructMembersList => Language::struct_members_list.parse(self, input), ProductionKind::ThrowStatement => { Language::throw_statement__sparse_dispatch.parse(self, input) } @@ -802,36 +735,52 @@ impl Language { Language::tuple_deconstruction_statement.parse(self, input) } ProductionKind::TupleExpression => Language::tuple_expression.parse(self, input), + ProductionKind::TupleMember => Language::tuple_member.parse(self, input), + ProductionKind::TupleMembersList => Language::tuple_members_list.parse(self, input), + ProductionKind::TupleValuesList => Language::tuple_values_list.parse(self, input), ProductionKind::TypeExpression => { Language::type_expression__sparse_dispatch.parse(self, input) } ProductionKind::TypeName => Language::type_name.parse(self, input), - ProductionKind::UnaryPostfixOperator => { - Language::unary_postfix_operator.parse(self, input) - } - ProductionKind::UnaryPrefixOperator => { - Language::unary_prefix_operator.parse(self, input) - } ProductionKind::UncheckedBlock => { Language::unchecked_block__sparse_dispatch.parse(self, input) } - ProductionKind::UnnamedFunctionAttribute => { - Language::unnamed_function_attribute__sparse_dispatch.parse(self, input) + ProductionKind::UnicodeStringLiteralsList => { + Language::unicode_string_literals_list__sparse_dispatch.parse(self, input) + } + ProductionKind::UnnamedFunctionAttributesList => { + Language::unnamed_function_attributes_list__sparse_dispatch.parse(self, input) } ProductionKind::UnnamedFunctionDefinition => { Language::unnamed_function_definition__sparse_dispatch.parse(self, input) } - ProductionKind::UserDefinedOperator => { - Language::user_defined_operator__sparse_dispatch.parse(self, input) - } ProductionKind::UserDefinedValueTypeDefinition => { Language::user_defined_value_type_definition__sparse_dispatch.parse(self, input) } ProductionKind::UsingDirective => Language::using_directive.parse(self, input), + ProductionKind::UsingDirectiveDeconstruction => { + Language::using_directive_deconstruction.parse(self, input) + } + ProductionKind::UsingDirectivePath => Language::using_directive_path.parse(self, input), + ProductionKind::UsingDirectiveSymbol => { + Language::using_directive_symbol.parse(self, input) + } + ProductionKind::UsingDirectiveSymbolsList => { + Language::using_directive_symbols_list.parse(self, input) + } + ProductionKind::VariableDeclaration => { + Language::variable_declaration.parse(self, input) + } ProductionKind::VariableDeclarationStatement => { Language::variable_declaration_statement.parse(self, input) } ProductionKind::VersionPragma => Language::version_pragma.parse(self, input), + ProductionKind::VersionPragmaExpression => { + Language::version_pragma_expression.parse(self, input) + } + ProductionKind::VersionPragmaExpressionsList => { + Language::version_pragma_expressions_list.parse(self, input) + } ProductionKind::VersionPragmaSpecifier => { Language::version_pragma_specifier.parse(self, input) } @@ -848,17 +797,32 @@ impl Language { Language::yul_declaration_statement.parse(self, input) } ProductionKind::YulExpression => Language::yul_expression.parse(self, input), + ProductionKind::YulExpressionsList => Language::yul_expressions_list.parse(self, input), ProductionKind::YulForStatement => Language::yul_for_statement.parse(self, input), ProductionKind::YulFunctionDefinition => { Language::yul_function_definition.parse(self, input) } ProductionKind::YulIdentifierPath => Language::yul_identifier_path.parse(self, input), + ProductionKind::YulIdentifierPathsList => { + Language::yul_identifier_paths_list.parse(self, input) + } + ProductionKind::YulIdentifiersList => Language::yul_identifiers_list.parse(self, input), ProductionKind::YulIfStatement => Language::yul_if_statement.parse(self, input), ProductionKind::YulLeaveStatement => { Language::yul_leave_statement__sparse_dispatch.parse(self, input) } - ProductionKind::YulLiteral => Language::yul_literal.parse(self, input), + ProductionKind::YulParametersDeclaration => { + Language::yul_parameters_declaration.parse(self, input) + } + ProductionKind::YulReturnsDeclaration => { + Language::yul_returns_declaration.parse(self, input) + } ProductionKind::YulStatement => Language::yul_statement.parse(self, input), + ProductionKind::YulStatementsList => Language::yul_statements_list.parse(self, input), + ProductionKind::YulSwitchCase => Language::yul_switch_case.parse(self, input), + ProductionKind::YulSwitchCasesList => { + Language::yul_switch_cases_list.parse(self, input) + } ProductionKind::YulSwitchStatement => Language::yul_switch_statement.parse(self, input), } .ok_or_else(|| Error::InvalidProductionVersion(production_kind).into()) diff --git a/crates/solidity/outputs/npm/crate/src/generated/parsers.rs b/crates/solidity/outputs/npm/crate/src/generated/parsers.rs index 380544cc4f..d2afacd285 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/parsers.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/parsers.rs @@ -81,7 +81,7 @@ impl Language { .with_kind(RuleKind::ABICoderPragma) } - // AddSubOperator = PLUS | MINUS; + // «AddSubOperator» = PLUS | MINUS; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -107,30 +107,47 @@ impl Language { } running_result } - .with_kind(RuleKind::AddSubOperator) } - // AddressType = ADDRESS_KEYWORD PAYABLE_KEYWORD?; + // AddressType = (ADDRESS_KEYWORD PAYABLE_KEYWORD?) | PAYABLE_KEYWORD; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn address_type(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::r#match(vec![], vec![]); + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::address_keyword, - TokenKind::AddressKeyword, - )) { + if running_result.incorporate_choice_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::address_keyword, + TokenKind::AddressKeyword, + ), + ) { + break; + } + running_result.incorporate_sequence_result(transform_option_result( + self.parse_token_with_trivia( + stream, + &Self::payable_keyword, + TokenKind::PayableKeyword, + ), + )); + break; + } + running_result + }) { break; } - running_result.incorporate_sequence_result(transform_option_result( - self.parse_token_with_trivia( - stream, - &Self::payable_keyword, - TokenKind::PayableKeyword, - ), + stream.set_position(start_position); + running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::payable_keyword, + TokenKind::PayableKeyword, )); break; } @@ -139,7 +156,7 @@ impl Language { .with_kind(RuleKind::AddressType) } - // AndOperator = AMPERSAND_AMPERSAND; + // «AndOperator» = AMPERSAND_AMPERSAND; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -149,14 +166,13 @@ impl Language { &Self::ampersand_ampersand, TokenKind::AmpersandAmpersand, ) - .with_kind(RuleKind::AndOperator) } - // ArgumentList = OPEN_PAREN (PositionalArgumentList | NamedArgumentList)? CLOSE_PAREN; + // ArgumentsDeclaration = OPEN_PAREN (PositionalArgumentsList | NamedArgumentsDeclaration)? CLOSE_PAREN; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn argument_list(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn arguments_declaration(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -172,12 +188,13 @@ impl Language { let start_position = stream.position(); loop { if running_result - .incorporate_choice_result(self.positional_argument_list(stream)) + .incorporate_choice_result(self.positional_arguments_list(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.named_argument_list(stream)); + running_result + .incorporate_choice_result(self.named_arguments_declaration(stream)); break; } running_result @@ -193,14 +210,14 @@ impl Language { } running_result } - .with_kind(RuleKind::ArgumentList) + .with_kind(RuleKind::ArgumentsDeclaration) } - // ArrayLiteral = OPEN_BRACKET Expression (COMMA Expression)* CLOSE_BRACKET; + // ArrayExpression = OPEN_BRACKET ArrayValuesList CLOSE_BRACKET; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn array_literal(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn array_expression(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -211,38 +228,7 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.expression(stream)) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result - .incorporate_sequence_result(self.expression(stream)); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - }) { + if !running_result.incorporate_sequence_result(self.array_values_list(stream)) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -254,82 +240,146 @@ impl Language { } running_result } - .with_kind(RuleKind::ArrayLiteral) + .with_kind(RuleKind::ArrayExpression) } - // AssemblyFlags = OPEN_PAREN DOUBLE_QUOTED_ASCII_STRING_LITERAL (COMMA DOUBLE_QUOTED_ASCII_STRING_LITERAL)* CLOSE_PAREN; + // «ArrayTypeNameOperator» = OPEN_BRACKET Expression? CLOSE_BRACKET; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn assembly_flags(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn array_type_name_operator(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::open_paren, - TokenKind::OpenParen, + &Self::open_bracket, + TokenKind::OpenBracket, )) { break; } - if !running_result.incorporate_sequence_result({ + if !running_result + .incorporate_sequence_result(transform_option_result(self.expression(stream))) + { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_bracket, + TokenKind::CloseBracket, + )); + break; + } + running_result + } + } + + // ArrayValuesList = Expression (COMMA Expression)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn array_values_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.expression(stream)) { + break; + } + running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::double_quoted_ascii_string_literal, - TokenKind::DoubleQuotedAsciiStringLiteral, - ), - ) { + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.expression(stream)); break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::double_quoted_ascii_string_literal, - TokenKind::DoubleQuotedAsciiStringLiteral, - ), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } + running_result + }) {} running_result - }) { + }); + break; + } + running_result + } + .with_kind(RuleKind::ArrayValuesList) + } + + // AsciiStringLiteralsList = ASCII_STRING_LITERAL+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn ascii_string_literals_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.parse_token_with_trivia( + stream, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, + )) {} + running_result + } + .with_kind(RuleKind::AsciiStringLiteralsList) + } + + // AssemblyFlagsList = ASCII_STRING_LITERAL (COMMA ASCII_STRING_LITERAL)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn assembly_flags_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, + )) { break; } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_paren, - TokenKind::CloseParen, - )); + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, + ), + ); + break; + } + running_result + }) {} + running_result + }); break; } running_result } - .with_kind(RuleKind::AssemblyFlags) + .with_kind(RuleKind::AssemblyFlagsList) } - // AssemblyStatement = ASSEMBLY_KEYWORD EVMASM? AssemblyFlags? YulBlock; + // AssemblyStatement = ASSEMBLY_KEYWORD ASCII_STRING_LITERAL? (OPEN_PAREN AssemblyFlagsList CLOSE_PAREN)? YulBlock; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -345,13 +395,40 @@ impl Language { break; } if !running_result.incorporate_sequence_result(transform_option_result( - self.parse_token_with_trivia(stream, &Self::evmasm, TokenKind::Evmasm), + self.parse_token_with_trivia( + stream, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, + ), )) { break; } - if !running_result.incorporate_sequence_result(transform_option_result( - self.assembly_flags(stream), - )) { + if !running_result.incorporate_sequence_result(transform_option_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::open_paren, + TokenKind::OpenParen, + ), + ) { + break; + } + if !running_result + .incorporate_sequence_result(self.assembly_flags_list(stream)) + { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_paren, + TokenKind::CloseParen, + )); + break; + } + running_result + })) { break; } running_result.incorporate_sequence_result(self.yul_block(stream)); @@ -362,18 +439,18 @@ impl Language { .with_kind(RuleKind::AssemblyStatement) } - // AssignmentOperator = EQUAL - // | BAR_EQUAL - // | CARET_EQUAL - // | AMPERSAND_EQUAL - // | LESS_THAN_LESS_THAN_EQUAL - // | GREATER_THAN_GREATER_THAN_EQUAL - // | GREATER_THAN_GREATER_THAN_GREATER_THAN_EQUAL - // | PLUS_EQUAL - // | MINUS_EQUAL - // | ASTERISK_EQUAL - // | SLASH_EQUAL - // | PERCENT_EQUAL; + // «AssignmentOperator» = EQUAL + // | BAR_EQUAL + // | PLUS_EQUAL + // | MINUS_EQUAL + // | CARET_EQUAL + // | SLASH_EQUAL + // | PERCENT_EQUAL + // | ASTERISK_EQUAL + // | AMPERSAND_EQUAL + // | LESS_THAN_LESS_THAN_EQUAL + // | GREATER_THAN_GREATER_THAN_EQUAL + // | GREATER_THAN_GREATER_THAN_GREATER_THAN_EQUAL; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -400,153 +477,116 @@ impl Language { stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::caret_equal, - TokenKind::CaretEqual, + &Self::plus_equal, + TokenKind::PlusEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::ampersand_equal, - TokenKind::AmpersandEqual, + &Self::minus_equal, + TokenKind::MinusEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::less_than_less_than_equal, - TokenKind::LessThanLessThanEqual, + &Self::caret_equal, + TokenKind::CaretEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::greater_than_greater_than_equal, - TokenKind::GreaterThanGreaterThanEqual, + &Self::slash_equal, + TokenKind::SlashEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::greater_than_greater_than_greater_than_equal, - TokenKind::GreaterThanGreaterThanGreaterThanEqual, + &Self::percent_equal, + TokenKind::PercentEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::plus_equal, - TokenKind::PlusEqual, + &Self::asterisk_equal, + TokenKind::AsteriskEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::minus_equal, - TokenKind::MinusEqual, + &Self::ampersand_equal, + TokenKind::AmpersandEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::asterisk_equal, - TokenKind::AsteriskEqual, + &Self::less_than_less_than_equal, + TokenKind::LessThanLessThanEqual, )) { break; } stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::slash_equal, - TokenKind::SlashEqual, + &Self::greater_than_greater_than_equal, + TokenKind::GreaterThanGreaterThanEqual, )) { break; } stream.set_position(start_position); running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::percent_equal, - TokenKind::PercentEqual, + &Self::greater_than_greater_than_greater_than_equal, + TokenKind::GreaterThanGreaterThanGreaterThanEqual, )); break; } running_result } - .with_kind(RuleKind::AssignmentOperator) } - // AsteriskImport = ASTERISK ImportAlias FROM_KEYWORD ImportPath; + // «BitwiseAndOperator» = AMPERSAND; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn asterisk_import(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::asterisk, - TokenKind::Asterisk, - )) { - break; - } - if !running_result.incorporate_sequence_result(self.import_alias(stream)) { - break; - } - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::from_keyword, - TokenKind::FromKeyword, - )) { - break; - } - running_result.incorporate_sequence_result(self.import_path(stream)); - break; - } - running_result - } - .with_kind(RuleKind::AsteriskImport) - } - - // BitAndOperator = AMPERSAND; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn bit_and_operator(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn bitwise_and_operator(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, &Self::ampersand, TokenKind::Ampersand) - .with_kind(RuleKind::BitAndOperator) } - // BitOrOperator = BAR; + // «BitwiseOrOperator» = BAR; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn bit_or_operator(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn bitwise_or_operator(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, &Self::bar, TokenKind::Bar) - .with_kind(RuleKind::BitOrOperator) } - // BitXOrOperator = CARET; + // «BitwiseXOrOperator» = CARET; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn bit_x_or_operator(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn bitwise_x_or_operator(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, &Self::caret, TokenKind::Caret) - .with_kind(RuleKind::BitXOrOperator) } - // (* v0.4.11 *) - // Block = OPEN_BRACE Statement* CLOSE_BRACE; + // Block = OPEN_BRACE StatementsList? CLOSE_BRACE; - #[allow(dead_code, non_snake_case)] - fn block__0_4_11(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn block(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -557,59 +597,11 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result(self.statement(stream)) {} - running_result - }) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_brace, - TokenKind::CloseBrace, - )); - break; - } - running_result - } - .with_kind(RuleKind::Block) - } - - // (* v0.8.0 *) - // Block = OPEN_BRACE (Statement | UncheckedBlock)* CLOSE_BRACE; - - #[allow(dead_code, non_snake_case)] - fn block__0_8_0(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::open_brace, - TokenKind::OpenBrace, + if !running_result.incorporate_sequence_result(transform_option_result( + self.statements_list(stream), )) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result(self.statement(stream)) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.unchecked_block(stream)); - break; - } - running_result - }) {} - running_result - }) { - break; - } running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, &Self::close_brace, @@ -622,19 +614,11 @@ impl Language { .with_kind(RuleKind::Block) } - pub(crate) fn block(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_8_0 { - self.block__0_8_0(stream) - } else { - self.block__0_4_11(stream) - } - } - - // BooleanLiteral = TRUE_KEYWORD | FALSE_KEYWORD; + // «BooleanExpression» = TRUE_KEYWORD | FALSE_KEYWORD; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn boolean_literal(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn boolean_expression(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); @@ -656,7 +640,6 @@ impl Language { } running_result } - .with_kind(RuleKind::BooleanLiteral) } // BreakStatement = BREAK_KEYWORD SEMICOLON; @@ -687,7 +670,7 @@ impl Language { } // (* v0.6.0 *) - // CatchClause = CATCH_KEYWORD (IDENTIFIER? ParameterList)? Block; + // CatchClause = CATCH_KEYWORD CatchClauseError? Block; #[allow(dead_code, non_snake_case)] fn catch_clause__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -701,23 +684,9 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(transform_option_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - )) { - break; - } - running_result.incorporate_sequence_result(self.parameter_list(stream)); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.catch_clause_error(stream), + )) { break; } running_result.incorporate_sequence_result(self.block(stream)); @@ -746,7 +715,77 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // ConditionalOperator = QUESTION_MARK Expression COLON Expression; + // (* v0.6.0 *) + // CatchClauseError = IDENTIFIER? ParametersDeclaration; + + #[allow(dead_code, non_snake_case)] + fn catch_clause_error__0_6_0(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(transform_option_result( + self.parse_token_with_trivia(stream, &Self::identifier, TokenKind::Identifier), + )) { + break; + } + running_result.incorporate_sequence_result(self.parameters_declaration(stream)); + break; + } + running_result + } + .with_kind(RuleKind::CatchClauseError) + } + + #[allow(non_snake_case)] + pub(crate) fn catch_clause_error__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_6_0 { + Some(self.catch_clause_error__0_6_0(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn catch_clause_error(&self, stream: &mut Stream) -> ParserResult { + self.catch_clause_error__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // (* v0.6.0 *) + // CatchClausesList = CatchClause+; + + #[allow(dead_code, non_snake_case)] + fn catch_clauses_list__0_6_0(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.catch_clause(stream)) {} + running_result + } + .with_kind(RuleKind::CatchClausesList) + } + + #[allow(non_snake_case)] + pub(crate) fn catch_clauses_list__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_6_0 { + Some(self.catch_clauses_list__0_6_0(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn catch_clauses_list(&self, stream: &mut Stream) -> ParserResult { + self.catch_clauses_list__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // «ConditionalOperator» = QUESTION_MARK Expression COLON Expression; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -776,7 +815,6 @@ impl Language { } running_result } - .with_kind(RuleKind::ConditionalOperator) } // ConstantDefinition = TypeName CONSTANT_KEYWORD IDENTIFIER EQUAL Expression SEMICOLON; @@ -836,10 +874,10 @@ impl Language { } // (* v0.4.22 *) - // ConstructorAttribute = ModifierInvocation - // | INTERNAL_KEYWORD - // | PAYABLE_KEYWORD - // | PUBLIC_KEYWORD; + // «ConstructorAttribute» = ModifierInvocation + // | INTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | PUBLIC_KEYWORD; #[allow(dead_code, non_snake_case)] fn constructor_attribute__0_4_22(&self, stream: &mut Stream) -> ParserResult { @@ -876,7 +914,6 @@ impl Language { } running_result } - .with_kind(RuleKind::ConstructorAttribute) } #[allow(non_snake_case)] @@ -898,7 +935,40 @@ impl Language { } // (* v0.4.22 *) - // ConstructorDefinition = CONSTRUCTOR_KEYWORD ParameterList ConstructorAttribute* Block; + // ConstructorAttributesList = «ConstructorAttribute»+; + + #[allow(dead_code, non_snake_case)] + fn constructor_attributes_list__0_4_22(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.constructor_attribute(stream)) + { + } + running_result + } + .with_kind(RuleKind::ConstructorAttributesList) + } + + #[allow(non_snake_case)] + pub(crate) fn constructor_attributes_list__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_4_22 { + Some(self.constructor_attributes_list__0_4_22(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn constructor_attributes_list(&self, stream: &mut Stream) -> ParserResult { + self.constructor_attributes_list__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // (* v0.4.22 *) + // ConstructorDefinition = CONSTRUCTOR_KEYWORD ParametersDeclaration ConstructorAttributesList? Block; #[allow(dead_code, non_snake_case)] fn constructor_definition__0_4_22(&self, stream: &mut Stream) -> ParserResult { @@ -912,17 +982,13 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(self.parameter_list(stream)) { + if !running_result.incorporate_sequence_result(self.parameters_declaration(stream)) + { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.constructor_attribute(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.constructor_attributes_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.block(stream)); @@ -979,80 +1045,217 @@ impl Language { } // (* v0.4.11 *) - // «ContractBodyElement» = UsingDirective - // | FunctionDefinition - // | UnnamedFunctionDefinition - // | ModifierDefinition - // | StructDefinition - // | EnumDefinition - // | EventDefinition - // | ErrorDefinition - // | StateVariableDeclaration; + // ContractDefinition = CONTRACT_KEYWORD IDENTIFIER InheritanceSpecifier? OPEN_BRACE ContractMembersList? CLOSE_BRACE; #[allow(dead_code, non_snake_case)] - fn contract_body_element__0_4_11(&self, stream: &mut Stream) -> ParserResult { + fn contract_definition__0_4_11(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); + let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if running_result.incorporate_choice_result(self.using_directive(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.function_definition(stream)) { - break; - } - stream.set_position(start_position); - if running_result - .incorporate_choice_result(self.unnamed_function_definition(stream)) - { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.modifier_definition(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.struct_definition(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.enum_definition(stream)) { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::contract_keyword, + TokenKind::ContractKeyword, + )) { break; } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.event_definition(stream)) { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )) { break; } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.error_definition(stream)) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.inheritance_specifier(stream), + )) { break; } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.state_variable_declaration(stream)); + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::open_brace, + TokenKind::OpenBrace, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.contract_members_list(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_brace, + TokenKind::CloseBrace, + )); + break; + } + running_result + }); break; } running_result } + .with_kind(RuleKind::ContractDefinition) } - // (* v0.4.22 *) - // «ContractBodyElement» = UsingDirective - // | ConstructorDefinition - // | FunctionDefinition - // | UnnamedFunctionDefinition - // | ModifierDefinition - // | StructDefinition - // | EnumDefinition - // | EventDefinition - // | ErrorDefinition - // | StateVariableDeclaration; + // (* v0.6.0 *) + // ContractDefinition = ABSTRACT_KEYWORD? CONTRACT_KEYWORD IDENTIFIER InheritanceSpecifier? OPEN_BRACE ContractMembersList? CLOSE_BRACE; #[allow(dead_code, non_snake_case)] - fn contract_body_element__0_4_22(&self, stream: &mut Stream) -> ParserResult { + fn contract_definition__0_6_0(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(transform_option_result( + self.parse_token_with_trivia( + stream, + &Self::abstract_keyword, + TokenKind::AbstractKeyword, + ), + )) { + break; + } + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::contract_keyword, + TokenKind::ContractKeyword, + )) { + break; + } + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.inheritance_specifier(stream), + )) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::open_brace, + TokenKind::OpenBrace, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.contract_members_list(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_brace, + TokenKind::CloseBrace, + )); + break; + } + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::ContractDefinition) + } + + pub(crate) fn contract_definition(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_6_0 { + self.contract_definition__0_6_0(stream) + } else { + self.contract_definition__0_4_11(stream) + } + } + + // (* v0.4.11 *) + // «ContractMember» = UsingDirective + // | FunctionDefinition + // | UnnamedFunctionDefinition + // | ModifierDefinition + // | StructDefinition + // | EnumDefinition + // | EventDefinition + // | ErrorDefinition + // | StateVariableDefinition; + + #[allow(dead_code, non_snake_case)] + fn contract_member__0_4_11(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result(self.using_directive(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.function_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result + .incorporate_choice_result(self.unnamed_function_definition(stream)) + { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.modifier_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.struct_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.enum_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.event_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.error_definition(stream)) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.state_variable_definition(stream)); + break; + } + running_result + } + } + + // (* v0.4.22 *) + // «ContractMember» = UsingDirective + // | ConstructorDefinition + // | FunctionDefinition + // | UnnamedFunctionDefinition + // | ModifierDefinition + // | StructDefinition + // | EnumDefinition + // | EventDefinition + // | ErrorDefinition + // | StateVariableDefinition; + + #[allow(dead_code, non_snake_case)] + fn contract_member__0_4_22(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { if running_result.incorporate_choice_result(self.using_directive(stream)) { break; @@ -1092,7 +1295,7 @@ impl Language { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.state_variable_declaration(stream)); + running_result.incorporate_choice_result(self.state_variable_definition(stream)); break; } running_result @@ -1100,20 +1303,20 @@ impl Language { } // (* v0.6.0 *) - // «ContractBodyElement» = UsingDirective - // | ConstructorDefinition - // | FunctionDefinition - // | FallbackFunctionDefinition - // | ReceiveFunctionDefinition - // | ModifierDefinition - // | StructDefinition - // | EnumDefinition - // | EventDefinition - // | ErrorDefinition - // | StateVariableDeclaration; + // «ContractMember» = UsingDirective + // | ConstructorDefinition + // | FunctionDefinition + // | FallbackFunctionDefinition + // | ReceiveFunctionDefinition + // | ModifierDefinition + // | StructDefinition + // | EnumDefinition + // | EventDefinition + // | ErrorDefinition + // | StateVariableDefinition; #[allow(dead_code, non_snake_case)] - fn contract_body_element__0_6_0(&self, stream: &mut Stream) -> ParserResult { + fn contract_member__0_6_0(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); @@ -1162,7 +1365,7 @@ impl Language { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.state_variable_declaration(stream)); + running_result.incorporate_choice_result(self.state_variable_definition(stream)); break; } running_result @@ -1170,21 +1373,21 @@ impl Language { } // (* v0.8.8 *) - // «ContractBodyElement» = UsingDirective - // | ConstructorDefinition - // | FunctionDefinition - // | FallbackFunctionDefinition - // | ReceiveFunctionDefinition - // | ModifierDefinition - // | StructDefinition - // | EnumDefinition - // | UserDefinedValueTypeDefinition - // | EventDefinition - // | ErrorDefinition - // | StateVariableDeclaration; + // «ContractMember» = UsingDirective + // | ConstructorDefinition + // | FunctionDefinition + // | FallbackFunctionDefinition + // | ReceiveFunctionDefinition + // | ModifierDefinition + // | StructDefinition + // | EnumDefinition + // | EventDefinition + // | ErrorDefinition + // | StateVariableDefinition + // | UserDefinedValueTypeDefinition; #[allow(dead_code, non_snake_case)] - fn contract_body_element__0_8_8(&self, stream: &mut Stream) -> ParserResult { + fn contract_member__0_8_8(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); @@ -1225,453 +1428,397 @@ impl Language { break; } stream.set_position(start_position); - if running_result - .incorporate_choice_result(self.user_defined_value_type_definition(stream)) - { + if running_result.incorporate_choice_result(self.event_definition(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.event_definition(stream)) { + if running_result.incorporate_choice_result(self.error_definition(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.error_definition(stream)) { + if running_result.incorporate_choice_result(self.state_variable_definition(stream)) + { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.state_variable_declaration(stream)); + running_result + .incorporate_choice_result(self.user_defined_value_type_definition(stream)); break; } running_result } } - pub(crate) fn contract_body_element(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn contract_member(&self, stream: &mut Stream) -> ParserResult { if self.version_is_equal_to_or_greater_than_0_8_8 { - self.contract_body_element__0_8_8(stream) + self.contract_member__0_8_8(stream) } else if self.version_is_equal_to_or_greater_than_0_6_0 { - self.contract_body_element__0_6_0(stream) + self.contract_member__0_6_0(stream) } else if self.version_is_equal_to_or_greater_than_0_4_22 { - self.contract_body_element__0_4_22(stream) + self.contract_member__0_4_22(stream) } else { - self.contract_body_element__0_4_11(stream) + self.contract_member__0_4_11(stream) + } + } + + // ContractMembersList = «ContractMember»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn contract_members_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.contract_member(stream)) {} + running_result } + .with_kind(RuleKind::ContractMembersList) } // (* v0.4.11 *) - // ContractDefinition = CONTRACT_KEYWORD IDENTIFIER InheritanceSpecifierList? OPEN_BRACE ContractBodyElements CLOSE_BRACE; - // ContractBodyElements = «ContractBodyElement»*; + // «ControlStatement» = IfStatement + // | ForStatement + // | WhileStatement + // | DoWhileStatement + // | ContinueStatement + // | BreakStatement + // | DeleteStatement + // | ReturnStatement + // | RevertStatement + // | ThrowStatement; #[allow(dead_code, non_snake_case)] - fn contract_definition__0_4_11(&self, stream: &mut Stream) -> ParserResult { + fn control_statement__0_4_11(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::r#match(vec![], vec![]); + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::contract_keyword, - TokenKind::ContractKeyword, - )) { + if running_result.incorporate_choice_result(self.if_statement(stream)) { break; } - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - )) { + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.for_statement(stream)) { break; } - if !running_result.incorporate_sequence_result(transform_option_result( - self.inheritance_specifier_list(stream), - )) { + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.while_statement(stream)) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_brace, - TokenKind::OpenBrace, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.contract_body_element(stream)) - { - } - running_result.with_kind(RuleKind::ContractBodyElements) - }) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_brace, - TokenKind::CloseBrace, - )); - break; - } - running_result - }); + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.do_while_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.continue_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.break_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.delete_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.return_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.revert_statement(stream)) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.throw_statement(stream)); break; } running_result } - .with_kind(RuleKind::ContractDefinition) } - // (* v0.6.0 *) - // ContractDefinition = ABSTRACT_KEYWORD? CONTRACT_KEYWORD IDENTIFIER InheritanceSpecifierList? OPEN_BRACE ContractBodyElements CLOSE_BRACE; - // ContractBodyElements = «ContractBodyElement»*; + // (* v0.4.21 *) + // «ControlStatement» = IfStatement + // | ForStatement + // | WhileStatement + // | DoWhileStatement + // | ContinueStatement + // | BreakStatement + // | DeleteStatement + // | ReturnStatement + // | RevertStatement + // | ThrowStatement + // | EmitStatement; #[allow(dead_code, non_snake_case)] - fn contract_definition__0_6_0(&self, stream: &mut Stream) -> ParserResult { + fn control_statement__0_4_21(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::r#match(vec![], vec![]); + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { - if !running_result.incorporate_sequence_result(transform_option_result( - self.parse_token_with_trivia( - stream, - &Self::abstract_keyword, - TokenKind::AbstractKeyword, - ), - )) { + if running_result.incorporate_choice_result(self.if_statement(stream)) { break; } - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::contract_keyword, - TokenKind::ContractKeyword, - )) { + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.for_statement(stream)) { break; } - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - )) { + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.while_statement(stream)) { break; } - if !running_result.incorporate_sequence_result(transform_option_result( - self.inheritance_specifier_list(stream), - )) { + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.do_while_statement(stream)) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_brace, - TokenKind::OpenBrace, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.contract_body_element(stream)) - { - } - running_result.with_kind(RuleKind::ContractBodyElements) - }) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_brace, - TokenKind::CloseBrace, - )); - break; - } - running_result - }); - break; - } - running_result - } - .with_kind(RuleKind::ContractDefinition) - } - - pub(crate) fn contract_definition(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_6_0 { - self.contract_definition__0_6_0(stream) - } else { - self.contract_definition__0_4_11(stream) - } - } - - // (* v0.4.11 *) - // DataLocation = MEMORY_KEYWORD | STORAGE_KEYWORD; - - #[allow(dead_code, non_snake_case)] - fn data_location__0_4_11(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::memory_keyword, - TokenKind::MemoryKeyword, - )) { + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.continue_statement(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::storage_keyword, - TokenKind::StorageKeyword, - )); + if running_result.incorporate_choice_result(self.break_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.delete_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.return_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.revert_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.throw_statement(stream)) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.emit_statement(stream)); break; } running_result } - .with_kind(RuleKind::DataLocation) } // (* v0.5.0 *) - // DataLocation = MEMORY_KEYWORD - // | STORAGE_KEYWORD - // | CALLDATA_KEYWORD; + // «ControlStatement» = IfStatement + // | ForStatement + // | WhileStatement + // | DoWhileStatement + // | ContinueStatement + // | BreakStatement + // | DeleteStatement + // | ReturnStatement + // | RevertStatement + // | EmitStatement; #[allow(dead_code, non_snake_case)] - fn data_location__0_5_0(&self, stream: &mut Stream) -> ParserResult { + fn control_statement__0_5_0(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::memory_keyword, - TokenKind::MemoryKeyword, - )) { + if running_result.incorporate_choice_result(self.if_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::storage_keyword, - TokenKind::StorageKeyword, - )) { + if running_result.incorporate_choice_result(self.for_statement(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::calldata_keyword, - TokenKind::CalldataKeyword, - )); - break; - } - running_result - } - .with_kind(RuleKind::DataLocation) - } - - pub(crate) fn data_location(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_5_0 { - self.data_location__0_5_0(stream) - } else { - self.data_location__0_4_11(stream) - } - } - - // (* v0.4.11 *) - // Definition = ConstantDefinition - // | ContractDefinition - // | EnumDefinition - // | ErrorDefinition - // | FunctionDefinition - // | InterfaceDefinition - // | LibraryDefinition - // | StructDefinition; - - #[allow(dead_code, non_snake_case)] - fn definition__0_4_11(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result(self.constant_definition(stream)) { + if running_result.incorporate_choice_result(self.while_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.contract_definition(stream)) { + if running_result.incorporate_choice_result(self.do_while_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.enum_definition(stream)) { + if running_result.incorporate_choice_result(self.continue_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.error_definition(stream)) { + if running_result.incorporate_choice_result(self.break_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.function_definition(stream)) { + if running_result.incorporate_choice_result(self.delete_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.interface_definition(stream)) { + if running_result.incorporate_choice_result(self.return_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.library_definition(stream)) { + if running_result.incorporate_choice_result(self.revert_statement(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.struct_definition(stream)); + running_result.incorporate_choice_result(self.emit_statement(stream)); break; } running_result } - .with_kind(RuleKind::Definition) } - // (* v0.8.8 *) - // Definition = ConstantDefinition - // | ContractDefinition - // | EnumDefinition - // | ErrorDefinition - // | FunctionDefinition - // | InterfaceDefinition - // | LibraryDefinition - // | StructDefinition - // | UserDefinedValueTypeDefinition; + // (* v0.6.0 *) + // «ControlStatement» = IfStatement + // | ForStatement + // | WhileStatement + // | DoWhileStatement + // | ContinueStatement + // | BreakStatement + // | DeleteStatement + // | ReturnStatement + // | RevertStatement + // | EmitStatement + // | TryStatement; #[allow(dead_code, non_snake_case)] - fn definition__0_8_8(&self, stream: &mut Stream) -> ParserResult { + fn control_statement__0_6_0(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result(self.constant_definition(stream)) { + if running_result.incorporate_choice_result(self.if_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.contract_definition(stream)) { + if running_result.incorporate_choice_result(self.for_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.enum_definition(stream)) { + if running_result.incorporate_choice_result(self.while_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.error_definition(stream)) { + if running_result.incorporate_choice_result(self.do_while_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.function_definition(stream)) { + if running_result.incorporate_choice_result(self.continue_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.interface_definition(stream)) { + if running_result.incorporate_choice_result(self.break_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.library_definition(stream)) { + if running_result.incorporate_choice_result(self.delete_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.struct_definition(stream)) { + if running_result.incorporate_choice_result(self.return_statement(stream)) { break; } stream.set_position(start_position); - running_result - .incorporate_choice_result(self.user_defined_value_type_definition(stream)); + if running_result.incorporate_choice_result(self.revert_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.emit_statement(stream)) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.try_statement(stream)); break; } running_result } - .with_kind(RuleKind::Definition) } - pub(crate) fn definition(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_8_8 { - self.definition__0_8_8(stream) + pub(crate) fn control_statement(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_6_0 { + self.control_statement__0_6_0(stream) + } else if self.version_is_equal_to_or_greater_than_0_5_0 { + self.control_statement__0_5_0(stream) + } else if self.version_is_equal_to_or_greater_than_0_4_21 { + self.control_statement__0_4_21(stream) } else { - self.definition__0_4_11(stream) + self.control_statement__0_4_11(stream) } } - // DeleteStatement = DELETE_KEYWORD Expression SEMICOLON; + // (* v0.4.11 *) + // «DataLocation» = MEMORY_KEYWORD | STORAGE_KEYWORD; - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn delete_statement(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code, non_snake_case)] + fn data_location__0_4_11(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::r#match(vec![], vec![]); + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::delete_keyword, - TokenKind::DeleteKeyword, - ), - ) { - break; - } - running_result.incorporate_sequence_result(self.expression(stream)); - break; - } - running_result - }) { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::memory_keyword, + TokenKind::MemoryKeyword, + )) { break; } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream.set_position(start_position); + running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::semicolon, - TokenKind::Semicolon, + &Self::storage_keyword, + TokenKind::StorageKeyword, )); break; } running_result } - .with_kind(RuleKind::DeleteStatement) } - // Directive = PragmaDirective - // | ImportDirective - // | UsingDirective; + // (* v0.5.0 *) + // «DataLocation» = MEMORY_KEYWORD + // | STORAGE_KEYWORD + // | CALLDATA_KEYWORD; - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn directive(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code, non_snake_case)] + fn data_location__0_5_0(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result(self.pragma_directive(stream)) { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::memory_keyword, + TokenKind::MemoryKeyword, + )) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.import_directive(stream)) { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::storage_keyword, + TokenKind::StorageKeyword, + )) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.using_directive(stream)); + running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::calldata_keyword, + TokenKind::CalldataKeyword, + )); break; } running_result } - .with_kind(RuleKind::Directive) } - // DoWhileStatement = DO_KEYWORD Statement WHILE_KEYWORD OPEN_PAREN Expression CLOSE_PAREN SEMICOLON; + pub(crate) fn data_location(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_5_0 { + self.data_location__0_5_0(stream) + } else { + self.data_location__0_4_11(stream) + } + } + + // DeconstructionImport = OPEN_BRACE DeconstructionImportSymbolsList CLOSE_BRACE FROM_KEYWORD ASCII_STRING_LITERAL; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn do_while_statement(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn deconstruction_import(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -1681,36 +1828,216 @@ impl Language { if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::do_keyword, - TokenKind::DoKeyword, + &Self::open_brace, + TokenKind::OpenBrace, ), ) { break; } - if !running_result.incorporate_sequence_result(self.statement(stream)) { - break; - } if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::while_keyword, - TokenKind::WhileKeyword, - ), + self.deconstruction_import_symbols_list(stream), ) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_paren, - TokenKind::OpenParen, - ), - ) { - break; - } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_brace, + TokenKind::CloseBrace, + )); + break; + } + running_result + }) { + break; + } + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::from_keyword, + TokenKind::FromKeyword, + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, + )); + break; + } + running_result + } + .with_kind(RuleKind::DeconstructionImport) + } + + // DeconstructionImportSymbol = IDENTIFIER (AS_KEYWORD IDENTIFIER)?; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn deconstruction_import_symbol(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )) { + break; + } + running_result.incorporate_sequence_result(transform_option_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::as_keyword, + TokenKind::AsKeyword, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )); + break; + } + running_result + })); + break; + } + running_result + } + .with_kind(RuleKind::DeconstructionImportSymbol) + } + + // DeconstructionImportSymbolsList = DeconstructionImportSymbol (COMMA DeconstructionImportSymbol)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn deconstruction_import_symbols_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result + .incorporate_sequence_result(self.deconstruction_import_symbol(stream)) + { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result( + self.deconstruction_import_symbol(stream), + ); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::DeconstructionImportSymbolsList) + } + + // DeleteStatement = DELETE_KEYWORD Expression SEMICOLON; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn delete_statement(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::delete_keyword, + TokenKind::DeleteKeyword, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.expression(stream)); + break; + } + running_result + }) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::semicolon, + TokenKind::Semicolon, + )); + break; + } + running_result + } + .with_kind(RuleKind::DeleteStatement) + } + + // DoWhileStatement = DO_KEYWORD Statement WHILE_KEYWORD OPEN_PAREN Expression CLOSE_PAREN SEMICOLON; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn do_while_statement(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::do_keyword, + TokenKind::DoKeyword, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result(self.statement(stream)) { + break; + } + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::while_keyword, + TokenKind::WhileKeyword, + ), + ) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::open_paren, + TokenKind::OpenParen, + ), + ) { + break; + } if !running_result .incorporate_sequence_result(self.expression(stream)) { @@ -1746,16 +2073,15 @@ impl Language { } // (* v0.4.11 *) - // ElementaryType = BOOL_KEYWORD - // | STRING_KEYWORD - // | AddressType - // | PayableType - // | BYTE_TYPE - // | FIXED_BYTES_TYPE - // | SIGNED_INTEGER_TYPE - // | UNSIGNED_INTEGER_TYPE - // | SIGNED_FIXED_TYPE - // | UNSIGNED_FIXED_TYPE; + // «ElementaryType» = BOOL_KEYWORD + // | BYTE_KEYWORD + // | STRING_KEYWORD + // | AddressType + // | FIXED_BYTES_TYPE + // | SIGNED_INTEGER_TYPE + // | UNSIGNED_INTEGER_TYPE + // | SIGNED_FIXED_TYPE + // | UNSIGNED_FIXED_TYPE; #[allow(dead_code, non_snake_case)] fn elementary_type__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -1773,28 +2099,24 @@ impl Language { stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::string_keyword, - TokenKind::StringKeyword, + &Self::byte_keyword, + TokenKind::ByteKeyword, )) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.address_type(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.payable_type(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, - &Self::byte_type, - TokenKind::ByteType, + &Self::string_keyword, + TokenKind::StringKeyword, )) { break; } stream.set_position(start_position); + if running_result.incorporate_choice_result(self.address_type(stream)) { + break; + } + stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::fixed_bytes_type, @@ -1836,19 +2158,17 @@ impl Language { } running_result } - .with_kind(RuleKind::ElementaryType) } // (* v0.8.0 *) - // ElementaryType = BOOL_KEYWORD - // | STRING_KEYWORD - // | AddressType - // | PayableType - // | FIXED_BYTES_TYPE - // | SIGNED_INTEGER_TYPE - // | UNSIGNED_INTEGER_TYPE - // | SIGNED_FIXED_TYPE - // | UNSIGNED_FIXED_TYPE; + // «ElementaryType» = BOOL_KEYWORD + // | STRING_KEYWORD + // | AddressType + // | FIXED_BYTES_TYPE + // | SIGNED_INTEGER_TYPE + // | UNSIGNED_INTEGER_TYPE + // | SIGNED_FIXED_TYPE + // | UNSIGNED_FIXED_TYPE; #[allow(dead_code, non_snake_case)] fn elementary_type__0_8_0(&self, stream: &mut Stream) -> ParserResult { @@ -1876,10 +2196,6 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.payable_type(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::fixed_bytes_type, @@ -1921,7 +2237,6 @@ impl Language { } running_result } - .with_kind(RuleKind::ElementaryType) } pub(crate) fn elementary_type(&self, stream: &mut Stream) -> ParserResult { @@ -1933,7 +2248,7 @@ impl Language { } // (* v0.4.21 *) - // EmitStatement = EMIT_KEYWORD IdentifierPath ArgumentList SEMICOLON; + // EmitStatement = EMIT_KEYWORD IdentifierPath ArgumentsDeclaration SEMICOLON; #[allow(dead_code, non_snake_case)] fn emit_statement__0_4_21(&self, stream: &mut Stream) -> ParserResult { @@ -1956,7 +2271,8 @@ impl Language { { break; } - running_result.incorporate_sequence_result(self.argument_list(stream)); + running_result + .incorporate_sequence_result(self.arguments_declaration(stream)); break; } running_result @@ -2042,7 +2358,7 @@ impl Language { .with_kind(RuleKind::EndOfFileTrivia) } - // EnumDefinition = ENUM_KEYWORD IDENTIFIER OPEN_BRACE (IDENTIFIER (COMMA IDENTIFIER)*)? CLOSE_BRACE; + // EnumDefinition = ENUM_KEYWORD IDENTIFIER OPEN_BRACE IdentifiersList? CLOSE_BRACE; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2076,50 +2392,9 @@ impl Language { ) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.identifiers_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -2138,7 +2413,7 @@ impl Language { .with_kind(RuleKind::EnumDefinition) } - // EqualityComparisonOperator = EQUAL_EQUAL | BANG_EQUAL; + // «EqualityComparisonOperator» = EQUAL_EQUAL | BANG_EQUAL; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2164,10 +2439,9 @@ impl Language { } running_result } - .with_kind(RuleKind::EqualityComparisonOperator) } - // ErrorDefinition = ERROR_KEYWORD IDENTIFIER OPEN_PAREN (ErrorParameter (COMMA ErrorParameter)*)? CLOSE_PAREN SEMICOLON; + // ErrorDefinition = ERROR_KEYWORD IDENTIFIER OPEN_PAREN ErrorParametersList? CLOSE_PAREN SEMICOLON; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2209,50 +2483,7 @@ impl Language { break; } if !running_result.incorporate_sequence_result( - transform_option_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.error_parameter(stream), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) - { - break; - } - running_result - .incorporate_sequence_result( - self.error_parameter(stream), - ); - break; - } - running_result - }) - { - } - running_result - }); - break; - } - running_result - }), + transform_option_result(self.error_parameters_list(stream)), ) { break; } @@ -2306,15 +2537,55 @@ impl Language { .with_kind(RuleKind::ErrorParameter) } - // EventDefinition = EVENT_KEYWORD IDENTIFIER OPEN_PAREN (EventParameter (COMMA EventParameter)*)? CLOSE_PAREN ANONYMOUS_KEYWORD? SEMICOLON; + // ErrorParametersList = ErrorParameter (COMMA ErrorParameter)*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn event_definition(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn error_parameters_list(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result({ + if !running_result.incorporate_sequence_result(self.error_parameter(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result + .incorporate_sequence_result(self.error_parameter(stream)); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::ErrorParametersList) + } + + // EventDefinition = EVENT_KEYWORD IDENTIFIER OPEN_PAREN EventParametersList? CLOSE_PAREN ANONYMOUS_KEYWORD? SEMICOLON; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn event_definition(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); loop { if !running_result.incorporate_sequence_result( @@ -2348,50 +2619,7 @@ impl Language { break; } if !running_result.incorporate_sequence_result( - transform_option_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.event_parameter(stream), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) - { - break; - } - running_result - .incorporate_sequence_result( - self.event_parameter(stream), - ); - break; - } - running_result - }) - { - } - running_result - }); - break; - } - running_result - }), + transform_option_result(self.event_parameters_list(stream)), ) { break; } @@ -2463,6 +2691,46 @@ impl Language { .with_kind(RuleKind::EventParameter) } + // EventParametersList = EventParameter (COMMA EventParameter)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn event_parameters_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.event_parameter(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result + .incorporate_sequence_result(self.event_parameter(stream)); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::EventParametersList) + } + // ExperimentalPragma = EXPERIMENTAL_KEYWORD IDENTIFIER; #[allow(dead_code)] @@ -2490,7 +2758,7 @@ impl Language { .with_kind(RuleKind::ExperimentalPragma) } - // ExponentiationOperator = ASTERISK_ASTERISK; + // «ExponentiationOperator» = ASTERISK_ASTERISK; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2500,47 +2768,35 @@ impl Language { &Self::asterisk_asterisk, TokenKind::AsteriskAsterisk, ) - .with_kind(RuleKind::ExponentiationOperator) } // (* v0.4.11 *) - // Expression = AssignmentExpression + // Expression = BinaryExpression // | ConditionalExpression - // | OrExpression - // | AndExpression - // | EqualityComparisonExpression - // | OrderComparisonExpression - // | BitOrExpression - // | BitXOrExpression - // | BitAndExpression - // | ShiftExpression - // | AddSubExpression - // | MulDivModExpression - // | ExponentiationExpression // | UnaryPostfixExpression // | UnaryPrefixExpression // | FunctionCallExpression // | MemberAccessExpression // | IndexAccessExpression - // | PrimaryExpression; - // AssignmentExpression = Expression AssignmentOperator Expression; - // ConditionalExpression = Expression ConditionalOperator; - // OrExpression = Expression OrOperator Expression; - // AndExpression = Expression AndOperator Expression; - // EqualityComparisonExpression = Expression EqualityComparisonOperator Expression; - // OrderComparisonExpression = Expression OrderComparisonOperator Expression; - // BitOrExpression = Expression BitOrOperator Expression; - // BitXOrExpression = Expression BitXOrOperator Expression; - // BitAndExpression = Expression BitAndOperator Expression; - // ShiftExpression = Expression ShiftOperator Expression; - // AddSubExpression = Expression AddSubOperator Expression; - // MulDivModExpression = Expression MulDivModOperator Expression; - // ExponentiationExpression = Expression ExponentiationOperator Expression; - // UnaryPostfixExpression = Expression UnaryPostfixOperator; - // UnaryPrefixExpression = UnaryPrefixOperator Expression; - // FunctionCallExpression = Expression FunctionCallOperator; - // MemberAccessExpression = Expression MemberAccessOperator; - // IndexAccessExpression = Expression IndexAccessOperator; + // | «PrimaryExpression»; + // BinaryExpression = Expression «AssignmentOperator» Expression; + // ConditionalExpression = Expression «ConditionalOperator»; + // BinaryExpression = Expression «OrOperator» Expression; + // BinaryExpression = Expression «AndOperator» Expression; + // BinaryExpression = Expression «EqualityComparisonOperator» Expression; + // BinaryExpression = Expression «OrderComparisonOperator» Expression; + // BinaryExpression = Expression «BitwiseOrOperator» Expression; + // BinaryExpression = Expression «BitwiseXOrOperator» Expression; + // BinaryExpression = Expression «BitwiseAndOperator» Expression; + // BinaryExpression = Expression «ShiftOperator» Expression; + // BinaryExpression = Expression «AddSubOperator» Expression; + // BinaryExpression = Expression «MulDivModOperator» Expression; + // BinaryExpression = Expression «ExponentiationOperator» Expression; + // UnaryPostfixExpression = Expression «UnaryPostfixOperator»; + // UnaryPrefixExpression = «UnaryPrefixOperator» Expression; + // FunctionCallExpression = Expression «FunctionCallOperator»; + // MemberAccessExpression = Expression «MemberAccessOperator»; + // IndexAccessExpression = Expression «IndexAccessOperator»; #[allow(dead_code, non_snake_case)] fn expression__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -2642,173 +2898,152 @@ impl Language { break result; } } - let result = loop { - let start_position = stream.position(); - stream.set_position(start_position); - let next_result = self.assignment_operator(stream).to_pratt_element_operator( - RuleKind::AssignmentExpression, - 1u8, - 1u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.or_operator(stream).to_pratt_element_operator( - RuleKind::OrExpression, - 5u8, - 5u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.and_operator(stream).to_pratt_element_operator( - RuleKind::AndExpression, - 7u8, - 7u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self - .equality_comparison_operator(stream) - .to_pratt_element_operator( - RuleKind::EqualityComparisonExpression, - 9u8, - 9u8 + 1, + let result = + loop { + let start_position = stream.position(); + stream.set_position(start_position); + let next_result = self + .assignment_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 1u8, 1u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.or_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 5u8, + 5u8 + 1, ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self - .order_comparison_operator(stream) - .to_pratt_element_operator( - RuleKind::OrderComparisonExpression, - 11u8, - 11u8 + 1, + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.and_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 7u8, + 7u8 + 1, ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.bit_or_operator(stream).to_pratt_element_operator( - RuleKind::BitOrExpression, - 13u8, - 13u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.bit_x_or_operator(stream).to_pratt_element_operator( - RuleKind::BitXOrExpression, - 15u8, - 15u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.bit_and_operator(stream).to_pratt_element_operator( - RuleKind::BitAndExpression, - 17u8, - 17u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.shift_operator(stream).to_pratt_element_operator( - RuleKind::ShiftExpression, - 19u8, - 19u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.add_sub_operator(stream).to_pratt_element_operator( - RuleKind::AddSubExpression, - 21u8, - 21u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.mul_div_mod_operator(stream).to_pratt_element_operator( - RuleKind::MulDivModExpression, - 23u8, - 23u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self - .exponentiation_operator(stream) - .to_pratt_element_operator( - RuleKind::ExponentiationExpression, - 25u8, - 25u8 + 1, + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .equality_comparison_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 9u8, 9u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .order_comparison_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 11u8, 11u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .bitwise_or_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 13u8, 13u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .bitwise_x_or_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 15u8, 15u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .bitwise_and_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 17u8, 17u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.shift_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 19u8, + 19u8 + 1, ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - break ParserResult::no_match(vec![]); - }; + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.add_sub_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 21u8, + 21u8 + 1, + ); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .mul_div_mod_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 23u8, 23u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .exponentiation_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 25u8, 25u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + break ParserResult::no_match(vec![]); + }; match result { ParserResult::PrattOperatorMatch(_) => elements.push(result), _ => break result, @@ -2844,43 +3079,32 @@ impl Language { } // (* v0.6.0 *) - // Expression = AssignmentExpression + // Expression = BinaryExpression // | ConditionalExpression - // | OrExpression - // | AndExpression - // | EqualityComparisonExpression - // | OrderComparisonExpression - // | BitOrExpression - // | BitXOrExpression - // | BitAndExpression - // | ShiftExpression - // | AddSubExpression - // | MulDivModExpression - // | ExponentiationExpression // | UnaryPostfixExpression // | UnaryPrefixExpression // | FunctionCallExpression // | MemberAccessExpression // | IndexAccessExpression - // | PrimaryExpression; - // AssignmentExpression = Expression AssignmentOperator Expression; - // ConditionalExpression = Expression ConditionalOperator; - // OrExpression = Expression OrOperator Expression; - // AndExpression = Expression AndOperator Expression; - // EqualityComparisonExpression = Expression EqualityComparisonOperator Expression; - // OrderComparisonExpression = Expression OrderComparisonOperator Expression; - // BitOrExpression = Expression BitOrOperator Expression; - // BitXOrExpression = Expression BitXOrOperator Expression; - // BitAndExpression = Expression BitAndOperator Expression; - // ShiftExpression = Expression ShiftOperator Expression; - // AddSubExpression = Expression AddSubOperator Expression; - // MulDivModExpression = Expression MulDivModOperator Expression; - // ExponentiationExpression = Expression ExponentiationOperator Expression; (* Right Associative *) - // UnaryPostfixExpression = Expression UnaryPostfixOperator; - // UnaryPrefixExpression = UnaryPrefixOperator Expression; - // FunctionCallExpression = Expression FunctionCallOperator; - // MemberAccessExpression = Expression MemberAccessOperator; - // IndexAccessExpression = Expression IndexAccessOperator; + // | «PrimaryExpression»; + // BinaryExpression = Expression «AssignmentOperator» Expression; + // ConditionalExpression = Expression «ConditionalOperator»; + // BinaryExpression = Expression «OrOperator» Expression; + // BinaryExpression = Expression «AndOperator» Expression; + // BinaryExpression = Expression «EqualityComparisonOperator» Expression; + // BinaryExpression = Expression «OrderComparisonOperator» Expression; + // BinaryExpression = Expression «BitwiseOrOperator» Expression; + // BinaryExpression = Expression «BitwiseXOrOperator» Expression; + // BinaryExpression = Expression «BitwiseAndOperator» Expression; + // BinaryExpression = Expression «ShiftOperator» Expression; + // BinaryExpression = Expression «AddSubOperator» Expression; + // BinaryExpression = Expression «MulDivModOperator» Expression; + // BinaryExpression = Expression «ExponentiationOperator» Expression; (* Right Associative *) + // UnaryPostfixExpression = Expression «UnaryPostfixOperator»; + // UnaryPrefixExpression = «UnaryPrefixOperator» Expression; + // FunctionCallExpression = Expression «FunctionCallOperator»; + // MemberAccessExpression = Expression «MemberAccessOperator»; + // IndexAccessExpression = Expression «IndexAccessOperator»; #[allow(dead_code, non_snake_case)] fn expression__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -2948,8 +3172,165 @@ impl Language { } stream.set_position(start_position); let next_result = self - .member_access_operator(stream) - .to_pratt_element_operator(RuleKind::MemberAccessExpression, 33u8, 255); + .member_access_operator(stream) + .to_pratt_element_operator(RuleKind::MemberAccessExpression, 33u8, 255); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .index_access_operator(stream) + .to_pratt_element_operator(RuleKind::IndexAccessExpression, 35u8, 255); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + break ParserResult::no_match(vec![]); + }; + match result { + ParserResult::PrattOperatorMatch(_) => elements.push(result), + _ => break result, + } + }; + match result { + ParserResult::NoMatch(_) => {} + _ => { + break result; + } + } + let result = + loop { + let start_position = stream.position(); + stream.set_position(start_position); + let next_result = self + .assignment_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 1u8, 1u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.or_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 5u8, + 5u8 + 1, + ); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.and_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 7u8, + 7u8 + 1, + ); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .equality_comparison_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 9u8, 9u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .order_comparison_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 11u8, 11u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .bitwise_or_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 13u8, 13u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .bitwise_x_or_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 15u8, 15u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .bitwise_and_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 17u8, 17u8 + 1); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.shift_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 19u8, + 19u8 + 1, + ); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self.add_sub_operator(stream).to_pratt_element_operator( + RuleKind::BinaryExpression, + 21u8, + 21u8 + 1, + ); + match next_result { + ParserResult::PrattOperatorMatch(_) => break next_result, + ParserResult::Match(_) => unreachable!( + "ParserResult::Match isn't constructed when parsing operators" + ), + ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} + } + stream.set_position(start_position); + let next_result = self + .mul_div_mod_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 23u8, 23u8 + 1); match next_result { ParserResult::PrattOperatorMatch(_) => break next_result, ParserResult::Match(_) => unreachable!( @@ -2959,8 +3340,8 @@ impl Language { } stream.set_position(start_position); let next_result = self - .index_access_operator(stream) - .to_pratt_element_operator(RuleKind::IndexAccessExpression, 35u8, 255); + .exponentiation_operator(stream) + .to_pratt_element_operator(RuleKind::BinaryExpression, 25u8 + 1, 25u8); match next_result { ParserResult::PrattOperatorMatch(_) => break next_result, ParserResult::Match(_) => unreachable!( @@ -2971,184 +3352,6 @@ impl Language { stream.set_position(start_position); break ParserResult::no_match(vec![]); }; - match result { - ParserResult::PrattOperatorMatch(_) => elements.push(result), - _ => break result, - } - }; - match result { - ParserResult::NoMatch(_) => {} - _ => { - break result; - } - } - let result = loop { - let start_position = stream.position(); - stream.set_position(start_position); - let next_result = self.assignment_operator(stream).to_pratt_element_operator( - RuleKind::AssignmentExpression, - 1u8, - 1u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.or_operator(stream).to_pratt_element_operator( - RuleKind::OrExpression, - 5u8, - 5u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.and_operator(stream).to_pratt_element_operator( - RuleKind::AndExpression, - 7u8, - 7u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self - .equality_comparison_operator(stream) - .to_pratt_element_operator( - RuleKind::EqualityComparisonExpression, - 9u8, - 9u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self - .order_comparison_operator(stream) - .to_pratt_element_operator( - RuleKind::OrderComparisonExpression, - 11u8, - 11u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.bit_or_operator(stream).to_pratt_element_operator( - RuleKind::BitOrExpression, - 13u8, - 13u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.bit_x_or_operator(stream).to_pratt_element_operator( - RuleKind::BitXOrExpression, - 15u8, - 15u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.bit_and_operator(stream).to_pratt_element_operator( - RuleKind::BitAndExpression, - 17u8, - 17u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.shift_operator(stream).to_pratt_element_operator( - RuleKind::ShiftExpression, - 19u8, - 19u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.add_sub_operator(stream).to_pratt_element_operator( - RuleKind::AddSubExpression, - 21u8, - 21u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self.mul_div_mod_operator(stream).to_pratt_element_operator( - RuleKind::MulDivModExpression, - 23u8, - 23u8 + 1, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - let next_result = self - .exponentiation_operator(stream) - .to_pratt_element_operator( - RuleKind::ExponentiationExpression, - 25u8 + 1, - 25u8, - ); - match next_result { - ParserResult::PrattOperatorMatch(_) => break next_result, - ParserResult::Match(_) => unreachable!( - "ParserResult::Match isn't constructed when parsing operators" - ), - ParserResult::IncompleteMatch(_) | ParserResult::NoMatch(_) => {} - } - stream.set_position(start_position); - break ParserResult::no_match(vec![]); - }; match result { ParserResult::PrattOperatorMatch(_) => elements.push(result), _ => break result, @@ -3215,13 +3418,13 @@ impl Language { } // (* v0.6.0 *) - // FallbackFunctionAttribute = ModifierInvocation - // | OverrideSpecifier - // | EXTERNAL_KEYWORD - // | PAYABLE_KEYWORD - // | PURE_KEYWORD - // | VIEW_KEYWORD - // | VIRTUAL_KEYWORD; + // «FallbackFunctionAttribute» = ModifierInvocation + // | OverrideSpecifier + // | EXTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | PURE_KEYWORD + // | VIEW_KEYWORD + // | VIRTUAL_KEYWORD; #[allow(dead_code, non_snake_case)] fn fallback_function_attribute__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -3278,7 +3481,6 @@ impl Language { } running_result } - .with_kind(RuleKind::FallbackFunctionAttribute) } #[allow(non_snake_case)] @@ -3300,7 +3502,41 @@ impl Language { } // (* v0.6.0 *) - // FallbackFunctionDefinition = FALLBACK_KEYWORD ParameterList FallbackFunctionAttribute* (RETURNS_KEYWORD ParameterList)? (SEMICOLON | Block); + // FallbackFunctionAttributesList = «FallbackFunctionAttribute»+; + + #[allow(dead_code, non_snake_case)] + fn fallback_function_attributes_list__0_6_0(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result + .incorporate_one_or_more_result(self.fallback_function_attribute(stream)) + { + } + running_result + } + .with_kind(RuleKind::FallbackFunctionAttributesList) + } + + #[allow(non_snake_case)] + pub(crate) fn fallback_function_attributes_list__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_6_0 { + Some(self.fallback_function_attributes_list__0_6_0(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn fallback_function_attributes_list(&self, stream: &mut Stream) -> ParserResult { + self.fallback_function_attributes_list__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // (* v0.6.0 *) + // FallbackFunctionDefinition = FALLBACK_KEYWORD ParametersDeclaration FallbackFunctionAttributesList? ReturnsDeclaration? (SEMICOLON | Block); #[allow(dead_code, non_snake_case)] fn fallback_function_definition__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -3314,36 +3550,18 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(self.parameter_list(stream)) { + if !running_result.incorporate_sequence_result(self.parameters_declaration(stream)) + { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.fallback_function_attribute(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.fallback_function_attributes_list(stream), + )) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::returns_keyword, - TokenKind::ReturnsKeyword, - ), - ) { - break; - } - running_result.incorporate_sequence_result(self.parameter_list(stream)); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.returns_declaration(stream), + )) { break; } running_result.incorporate_sequence_result({ @@ -3388,7 +3606,7 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // ForStatement = FOR_KEYWORD OPEN_PAREN (SimpleStatement | SEMICOLON) (ExpressionStatement | SEMICOLON) Expression? CLOSE_PAREN Statement; + // ForStatement = FOR_KEYWORD OPEN_PAREN («SimpleStatement» | SEMICOLON) (ExpressionStatement | SEMICOLON) Expression? CLOSE_PAREN Statement; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -3493,16 +3711,16 @@ impl Language { } // (* v0.4.11 *) - // FunctionAttribute = CONSTANT_KEYWORD - // | EXTERNAL_KEYWORD - // | INTERNAL_KEYWORD - // | ModifierInvocation - // | OverrideSpecifier - // | PAYABLE_KEYWORD - // | PRIVATE_KEYWORD - // | PUBLIC_KEYWORD - // | PURE_KEYWORD - // | VIEW_KEYWORD; + // «FunctionAttribute» = ModifierInvocation + // | OverrideSpecifier + // | CONSTANT_KEYWORD + // | EXTERNAL_KEYWORD + // | INTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD + // | PURE_KEYWORD + // | VIEW_KEYWORD; #[allow(dead_code, non_snake_case)] fn function_attribute__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -3510,6 +3728,14 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { + if running_result.incorporate_choice_result(self.modifier_invocation(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.override_specifier(stream)) { + break; + } + stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::constant_keyword, @@ -3534,14 +3760,6 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.modifier_invocation(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.override_specifier(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::payable_keyword, @@ -3583,19 +3801,18 @@ impl Language { } running_result } - .with_kind(RuleKind::FunctionAttribute) } // (* v0.5.0 *) - // FunctionAttribute = EXTERNAL_KEYWORD - // | INTERNAL_KEYWORD - // | ModifierInvocation - // | OverrideSpecifier - // | PAYABLE_KEYWORD - // | PRIVATE_KEYWORD - // | PUBLIC_KEYWORD - // | PURE_KEYWORD - // | VIEW_KEYWORD; + // «FunctionAttribute» = ModifierInvocation + // | OverrideSpecifier + // | EXTERNAL_KEYWORD + // | INTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD + // | PURE_KEYWORD + // | VIEW_KEYWORD; #[allow(dead_code, non_snake_case)] fn function_attribute__0_5_0(&self, stream: &mut Stream) -> ParserResult { @@ -3603,6 +3820,14 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { + if running_result.incorporate_choice_result(self.modifier_invocation(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.override_specifier(stream)) { + break; + } + stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::external_keyword, @@ -3619,14 +3844,6 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.modifier_invocation(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.override_specifier(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::payable_keyword, @@ -3668,20 +3885,19 @@ impl Language { } running_result } - .with_kind(RuleKind::FunctionAttribute) } // (* v0.6.0 *) - // FunctionAttribute = EXTERNAL_KEYWORD - // | INTERNAL_KEYWORD - // | ModifierInvocation - // | OverrideSpecifier - // | PAYABLE_KEYWORD - // | PRIVATE_KEYWORD - // | PUBLIC_KEYWORD - // | PURE_KEYWORD - // | VIEW_KEYWORD - // | VIRTUAL_KEYWORD; + // «FunctionAttribute» = ModifierInvocation + // | OverrideSpecifier + // | EXTERNAL_KEYWORD + // | INTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD + // | PURE_KEYWORD + // | VIEW_KEYWORD + // | VIRTUAL_KEYWORD; #[allow(dead_code, non_snake_case)] fn function_attribute__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -3689,6 +3905,14 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { + if running_result.incorporate_choice_result(self.modifier_invocation(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.override_specifier(stream)) { + break; + } + stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::external_keyword, @@ -3705,14 +3929,6 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.modifier_invocation(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.override_specifier(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::payable_keyword, @@ -3762,7 +3978,6 @@ impl Language { } running_result } - .with_kind(RuleKind::FunctionAttribute) } pub(crate) fn function_attribute(&self, stream: &mut Stream) -> ParserResult { @@ -3774,47 +3989,33 @@ impl Language { self.function_attribute__0_4_11(stream) } } - - // (* v0.4.11 *) - // FunctionCallOperator = ArgumentList; - - #[allow(dead_code, non_snake_case)] - fn function_call_operator__0_4_11(&self, stream: &mut Stream) -> ParserResult { - self.argument_list(stream) - .with_kind(RuleKind::FunctionCallOperator) - } - - // (* v0.6.2 *) - // FunctionCallOperator = FunctionCallOptions* ArgumentList; - - #[allow(dead_code, non_snake_case)] - fn function_call_operator__0_6_2(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.function_call_options(stream)) - { - } - running_result - }) { - break; - } - running_result.incorporate_sequence_result(self.argument_list(stream)); - break; - } + + // FunctionAttributesList = «FunctionAttribute»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn function_attributes_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.function_attribute(stream)) {} running_result } - .with_kind(RuleKind::FunctionCallOperator) + .with_kind(RuleKind::FunctionAttributesList) } - // (* v0.8.0 *) - // FunctionCallOperator = FunctionCallOptions? ArgumentList; + // (* v0.4.11 *) + // «FunctionCallOperator» = ArgumentsDeclaration; #[allow(dead_code, non_snake_case)] - fn function_call_operator__0_8_0(&self, stream: &mut Stream) -> ParserResult { + fn function_call_operator__0_4_11(&self, stream: &mut Stream) -> ParserResult { + self.arguments_declaration(stream) + } + + // (* v0.6.2 *) + // «FunctionCallOperator» = FunctionCallOptions? ArgumentsDeclaration; + + #[allow(dead_code, non_snake_case)] + fn function_call_operator__0_6_2(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -3823,18 +4024,15 @@ impl Language { )) { break; } - running_result.incorporate_sequence_result(self.argument_list(stream)); + running_result.incorporate_sequence_result(self.arguments_declaration(stream)); break; } running_result } - .with_kind(RuleKind::FunctionCallOperator) } pub(crate) fn function_call_operator(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_8_0 { - self.function_call_operator__0_8_0(stream) - } else if self.version_is_equal_to_or_greater_than_0_6_2 { + if self.version_is_equal_to_or_greater_than_0_6_2 { self.function_call_operator__0_6_2(stream) } else { self.function_call_operator__0_4_11(stream) @@ -3842,73 +4040,38 @@ impl Language { } // (* v0.6.2 *) - // FunctionCallOptions = OPEN_BRACE (NamedArgument (COMMA NamedArgument)*)? CLOSE_BRACE; + // FunctionCallOptions = NamedArgumentsDeclaration+; #[allow(dead_code, non_snake_case)] fn function_call_options__0_6_2(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::open_brace, - TokenKind::OpenBrace, - )) { - break; - } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.named_argument(stream)) - { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result - .incorporate_sequence_result(self.named_argument(stream)); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - })) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_brace, - TokenKind::CloseBrace, - )); - break; + while running_result + .incorporate_one_or_more_result(self.named_arguments_declaration(stream)) + { } running_result } .with_kind(RuleKind::FunctionCallOptions) } + // (* v0.8.0 *) + // FunctionCallOptions = NamedArgumentsDeclaration; + + #[allow(dead_code, non_snake_case)] + fn function_call_options__0_8_0(&self, stream: &mut Stream) -> ParserResult { + self.named_arguments_declaration(stream) + .with_kind(RuleKind::FunctionCallOptions) + } + #[allow(non_snake_case)] pub(crate) fn function_call_options__sparse_dispatch( &self, stream: &mut Stream, ) -> Option { - if self.version_is_equal_to_or_greater_than_0_6_2 { + if self.version_is_equal_to_or_greater_than_0_8_0 { + Some(self.function_call_options__0_8_0(stream)) + } else if self.version_is_equal_to_or_greater_than_0_6_2 { Some(self.function_call_options__0_6_2(stream)) } else { None @@ -3921,7 +4084,7 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // FunctionDefinition = FUNCTION_KEYWORD (IDENTIFIER | FALLBACK_KEYWORD | RECEIVE_KEYWORD) ParameterList FunctionAttribute* (RETURNS_KEYWORD ParameterList)? (SEMICOLON | Block); + // FunctionDefinition = FUNCTION_KEYWORD (IDENTIFIER | FALLBACK_KEYWORD | RECEIVE_KEYWORD) ParametersDeclaration FunctionAttributesList? ReturnsDeclaration? (SEMICOLON | Block); #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -3967,36 +4130,18 @@ impl Language { }) { break; } - if !running_result.incorporate_sequence_result(self.parameter_list(stream)) { + if !running_result.incorporate_sequence_result(self.parameters_declaration(stream)) + { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.function_attribute(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.function_attributes_list(stream), + )) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::returns_keyword, - TokenKind::ReturnsKeyword, - ), - ) { - break; - } - running_result.incorporate_sequence_result(self.parameter_list(stream)); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.returns_declaration(stream), + )) { break; } running_result.incorporate_sequence_result({ @@ -4023,7 +4168,7 @@ impl Language { .with_kind(RuleKind::FunctionDefinition) } - // FunctionType = FUNCTION_KEYWORD ParameterList (INTERNAL_KEYWORD | EXTERNAL_KEYWORD | PRIVATE_KEYWORD | PUBLIC_KEYWORD | PURE_KEYWORD | VIEW_KEYWORD | PAYABLE_KEYWORD)* (RETURNS_KEYWORD ParameterList)?; + // FunctionType = FUNCTION_KEYWORD ParametersDeclaration FunctionTypeAttributesList? ReturnsDeclaration?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4038,117 +4183,225 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(self.parameter_list(stream)) { + if !running_result.incorporate_sequence_result(self.parameters_declaration(stream)) + { break; } - if !running_result.incorporate_sequence_result({ + if !running_result.incorporate_sequence_result(transform_option_result( + self.function_type_attributes_list(stream), + )) { + break; + } + running_result.incorporate_sequence_result(transform_option_result( + self.returns_declaration(stream), + )); + break; + } + running_result + } + .with_kind(RuleKind::FunctionType) + } + + // «FunctionTypeAttribute» = INTERNAL_KEYWORD + // | EXTERNAL_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD + // | PURE_KEYWORD + // | VIEW_KEYWORD + // | PAYABLE_KEYWORD; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn function_type_attribute(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::internal_keyword, + TokenKind::InternalKeyword, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::external_keyword, + TokenKind::ExternalKeyword, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::private_keyword, + TokenKind::PrivateKeyword, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::public_keyword, + TokenKind::PublicKeyword, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::pure_keyword, + TokenKind::PureKeyword, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::view_keyword, + TokenKind::ViewKeyword, + )) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::payable_keyword, + TokenKind::PayableKeyword, + )); + break; + } + running_result + } + } + + // FunctionTypeAttributesList = «FunctionTypeAttribute»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn function_type_attributes_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result + .incorporate_one_or_more_result(self.function_type_attribute(stream)) + {} + running_result + } + .with_kind(RuleKind::FunctionTypeAttributesList) + } + + // HexStringLiteralsList = HEX_STRING_LITERAL+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn hex_string_literals_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.parse_token_with_trivia( + stream, + &Self::hex_string_literal, + TokenKind::HexStringLiteral, + )) {} + running_result + } + .with_kind(RuleKind::HexStringLiteralsList) + } + + // IdentifierPath = IDENTIFIER (PERIOD IDENTIFIER)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn identifier_path(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )) { + break; + } + running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); + let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::internal_keyword, - TokenKind::InternalKeyword, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::external_keyword, - TokenKind::ExternalKeyword, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::private_keyword, - TokenKind::PrivateKeyword, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( + if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::public_keyword, - TokenKind::PublicKeyword, + &Self::period, + TokenKind::Period, ), ) { break; } - stream.set_position(start_position); - if running_result.incorporate_choice_result( + running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::pure_keyword, - TokenKind::PureKeyword, + &Self::identifier, + TokenKind::Identifier, ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( + ); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::IdentifierPath) + } + + // IdentifierPathsList = IdentifierPath (COMMA IdentifierPath)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn identifier_paths_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.identifier_path(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::view_keyword, - TokenKind::ViewKeyword, + &Self::comma, + TokenKind::Comma, ), ) { break; } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::payable_keyword, - TokenKind::PayableKeyword, - )); + running_result + .incorporate_sequence_result(self.identifier_path(stream)); break; } running_result }) {} running_result - }) { - break; - } - running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::returns_keyword, - TokenKind::ReturnsKeyword, - ), - ) { - break; - } - running_result.incorporate_sequence_result(self.parameter_list(stream)); - break; - } - running_result - })); + }); break; } running_result } - .with_kind(RuleKind::FunctionType) + .with_kind(RuleKind::IdentifierPathsList) } - // IdentifierPath = IDENTIFIER (PERIOD IDENTIFIER)*; + // IdentifiersList = IDENTIFIER (COMMA IDENTIFIER)*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn identifier_path(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn identifiers_list(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -4167,8 +4420,8 @@ impl Language { if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::period, - TokenKind::Period, + &Self::comma, + TokenKind::Comma, ), ) { break; @@ -4190,7 +4443,7 @@ impl Language { } running_result } - .with_kind(RuleKind::IdentifierPath) + .with_kind(RuleKind::IdentifiersList) } // IfStatement = IF_KEYWORD OPEN_PAREN Expression CLOSE_PAREN Statement (ELSE_KEYWORD Statement)?; @@ -4261,34 +4514,7 @@ impl Language { .with_kind(RuleKind::IfStatement) } - // ImportAlias = AS_KEYWORD IDENTIFIER; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn import_alias(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::as_keyword, - TokenKind::AsKeyword, - )) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - )); - break; - } - running_result - } - .with_kind(RuleKind::ImportAlias) - } - - // ImportDirective = IMPORT_KEYWORD (SimpleImport | AsteriskImport | SelectiveImport) SEMICOLON; + // ImportDirective = IMPORT_KEYWORD (PathImport | NamedImport | DeconstructionImport) SEMICOLON; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4313,19 +4539,19 @@ impl Language { let start_position = stream.position(); loop { if running_result - .incorporate_choice_result(self.simple_import(stream)) + .incorporate_choice_result(self.path_import(stream)) { break; } stream.set_position(start_position); if running_result - .incorporate_choice_result(self.asterisk_import(stream)) + .incorporate_choice_result(self.named_import(stream)) { break; } stream.set_position(start_position); running_result - .incorporate_choice_result(self.selective_import(stream)); + .incorporate_choice_result(self.deconstruction_import(stream)); break; } running_result @@ -4348,20 +4574,7 @@ impl Language { .with_kind(RuleKind::ImportDirective) } - // ImportPath = ASCII_STRING_LITERAL; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn import_path(&self, stream: &mut Stream) -> ParserResult { - self.parse_token_with_trivia( - stream, - &Self::ascii_string_literal, - TokenKind::AsciiStringLiteral, - ) - .with_kind(RuleKind::ImportPath) - } - - // IndexAccessOperator = OPEN_BRACKET ((Expression (COLON Expression?)?) | (COLON Expression?)) CLOSE_BRACKET; + // «IndexAccessOperator» = OPEN_BRACKET ((Expression (COLON Expression?)?) | (COLON Expression?)) CLOSE_BRACKET; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4451,14 +4664,36 @@ impl Language { } running_result } - .with_kind(RuleKind::IndexAccessOperator) } - // InheritanceSpecifier = IdentifierPath ArgumentList?; + // InheritanceSpecifier = IS_KEYWORD InheritanceTypesList; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn inheritance_specifier(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::is_keyword, + TokenKind::IsKeyword, + )) { + break; + } + running_result.incorporate_sequence_result(self.inheritance_types_list(stream)); + break; + } + running_result + } + .with_kind(RuleKind::InheritanceSpecifier) + } + + // InheritanceType = IdentifierPath ArgumentsDeclaration?; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn inheritance_type(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -4466,73 +4701,56 @@ impl Language { break; } running_result.incorporate_sequence_result(transform_option_result( - self.argument_list(stream), + self.arguments_declaration(stream), )); break; } running_result } - .with_kind(RuleKind::InheritanceSpecifier) + .with_kind(RuleKind::InheritanceType) } - // InheritanceSpecifierList = IS_KEYWORD InheritanceSpecifier (COMMA InheritanceSpecifier)*; + // InheritanceTypesList = InheritanceType (COMMA InheritanceType)*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn inheritance_specifier_list(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn inheritance_types_list(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::is_keyword, - TokenKind::IsKeyword, - )) { + if !running_result.incorporate_sequence_result(self.inheritance_type(stream)) { break; } running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result(self.inheritance_specifier(stream)) - { + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result + .incorporate_sequence_result(self.inheritance_type(stream)); break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.inheritance_specifier(stream), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } + running_result + }) {} running_result }); break; } running_result } - .with_kind(RuleKind::InheritanceSpecifierList) + .with_kind(RuleKind::InheritanceTypesList) } - // InterfaceDefinition = INTERFACE_KEYWORD IDENTIFIER InheritanceSpecifierList? OPEN_BRACE «ContractBodyElement»* CLOSE_BRACE; + // InterfaceDefinition = INTERFACE_KEYWORD IDENTIFIER InheritanceSpecifier? OPEN_BRACE InterfaceMembersList? CLOSE_BRACE; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4555,7 +4773,7 @@ impl Language { break; } if !running_result.incorporate_sequence_result(transform_option_result( - self.inheritance_specifier_list(stream), + self.inheritance_specifier(stream), )) { break; } @@ -4571,14 +4789,9 @@ impl Language { ) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.contract_body_element(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.interface_members_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -4597,6 +4810,19 @@ impl Language { .with_kind(RuleKind::InterfaceDefinition) } + // InterfaceMembersList = «ContractMember»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn interface_members_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.contract_member(stream)) {} + running_result + } + .with_kind(RuleKind::InterfaceMembersList) + } + // LeadingTrivia = (WHITESPACE | END_OF_LINE | MULTILINE_COMMENT | SINGLE_LINE_COMMENT)+; #[allow(dead_code)] @@ -4646,7 +4872,7 @@ impl Language { .with_kind(RuleKind::LeadingTrivia) } - // LibraryDefinition = LIBRARY_KEYWORD IDENTIFIER OPEN_BRACE «ContractBodyElement»* CLOSE_BRACE; + // LibraryDefinition = LIBRARY_KEYWORD IDENTIFIER OPEN_BRACE LibraryMembersList? CLOSE_BRACE; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4680,14 +4906,9 @@ impl Language { ) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.contract_body_element(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.library_members_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -4706,8 +4927,21 @@ impl Language { .with_kind(RuleKind::LibraryDefinition) } + // LibraryMembersList = «ContractMember»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn library_members_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.contract_member(stream)) {} + running_result + } + .with_kind(RuleKind::LibraryMembersList) + } + // (* v0.4.11 *) - // MappingKeyType = (ElementaryType | IdentifierPath); + // MappingKeyType = «ElementaryType» | IdentifierPath; #[allow(dead_code, non_snake_case)] fn mapping_key_type__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -4728,7 +4962,7 @@ impl Language { } // (* v0.8.18 *) - // MappingKeyType = (ElementaryType | IdentifierPath) IDENTIFIER?; + // MappingKeyType = («ElementaryType» | IdentifierPath) IDENTIFIER?; #[allow(dead_code, non_snake_case)] fn mapping_key_type__0_8_18(&self, stream: &mut Stream) -> ParserResult { @@ -4873,7 +5107,7 @@ impl Language { } } - // MemberAccessOperator = PERIOD (IDENTIFIER | ADDRESS_KEYWORD); + // «MemberAccessOperator» = PERIOD (IDENTIFIER | ADDRESS_KEYWORD); #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4913,20 +5147,18 @@ impl Language { } running_result } - .with_kind(RuleKind::MemberAccessOperator) } // (* v0.4.11 *) - // ModifierAttribute = OverrideSpecifier; + // «ModifierAttribute» = OverrideSpecifier; #[allow(dead_code, non_snake_case)] fn modifier_attribute__0_4_11(&self, stream: &mut Stream) -> ParserResult { self.override_specifier(stream) - .with_kind(RuleKind::ModifierAttribute) } // (* v0.6.0 *) - // ModifierAttribute = OverrideSpecifier | VIRTUAL_KEYWORD; + // «ModifierAttribute» = OverrideSpecifier | VIRTUAL_KEYWORD; #[allow(dead_code, non_snake_case)] fn modifier_attribute__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -4947,7 +5179,6 @@ impl Language { } running_result } - .with_kind(RuleKind::ModifierAttribute) } pub(crate) fn modifier_attribute(&self, stream: &mut Stream) -> ParserResult { @@ -4958,7 +5189,20 @@ impl Language { } } - // ModifierDefinition = MODIFIER_KEYWORD IDENTIFIER ParameterList? ModifierAttribute* (SEMICOLON | Block); + // ModifierAttributesList = «ModifierAttribute»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn modifier_attributes_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.modifier_attribute(stream)) {} + running_result + } + .with_kind(RuleKind::ModifierAttributesList) + } + + // ModifierDefinition = MODIFIER_KEYWORD IDENTIFIER ParametersDeclaration? ModifierAttributesList? (SEMICOLON | Block); #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -4981,18 +5225,13 @@ impl Language { break; } if !running_result.incorporate_sequence_result(transform_option_result( - self.parameter_list(stream), + self.parameters_declaration(stream), )) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.modifier_attribute(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.modifier_attributes_list(stream), + )) { break; } running_result.incorporate_sequence_result({ @@ -5019,7 +5258,7 @@ impl Language { .with_kind(RuleKind::ModifierDefinition) } - // ModifierInvocation = IdentifierPath ArgumentList?; + // ModifierInvocation = IdentifierPath ArgumentsDeclaration?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -5031,7 +5270,7 @@ impl Language { break; } running_result.incorporate_sequence_result(transform_option_result( - self.argument_list(stream), + self.arguments_declaration(stream), )); break; } @@ -5040,9 +5279,9 @@ impl Language { .with_kind(RuleKind::ModifierInvocation) } - // MulDivModOperator = ASTERISK - // | SLASH - // | PERCENT; + // «MulDivModOperator» = ASTERISK + // | SLASH + // | PERCENT; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -5076,99 +5315,155 @@ impl Language { } running_result } - .with_kind(RuleKind::MulDivModOperator) } - // NamedArgument = IDENTIFIER COLON Expression; + // NamedArgument = IDENTIFIER COLON Expression; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn named_argument(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )) { + break; + } + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::colon, + TokenKind::Colon, + )) { + break; + } + running_result.incorporate_sequence_result(self.expression(stream)); + break; + } + running_result + } + .with_kind(RuleKind::NamedArgument) + } + + // NamedArgumentsDeclaration = OPEN_BRACE NamedArgumentsList? CLOSE_BRACE; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn named_arguments_declaration(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::open_brace, + TokenKind::OpenBrace, + )) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.named_arguments_list(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_brace, + TokenKind::CloseBrace, + )); + break; + } + running_result + } + .with_kind(RuleKind::NamedArgumentsDeclaration) + } + + // NamedArgumentsList = NamedArgument (COMMA NamedArgument)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn named_arguments_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.named_argument(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.named_argument(stream)); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::NamedArgumentsList) + } + + // NamedImport = ASTERISK AS_KEYWORD IDENTIFIER FROM_KEYWORD ASCII_STRING_LITERAL; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn named_argument(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn named_import(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::identifier, - TokenKind::Identifier, + &Self::asterisk, + TokenKind::Asterisk, )) { break; } if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::colon, - TokenKind::Colon, + &Self::as_keyword, + TokenKind::AsKeyword, )) { break; } - running_result.incorporate_sequence_result(self.expression(stream)); - break; - } - running_result - } - .with_kind(RuleKind::NamedArgument) - } - - // NamedArgumentList = OPEN_BRACE (NamedArgument (COMMA NamedArgument)*)? CLOSE_BRACE; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn named_argument_list(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::open_brace, - TokenKind::OpenBrace, + &Self::identifier, + TokenKind::Identifier, )) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result(self.named_argument(stream)) - { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result - .incorporate_sequence_result(self.named_argument(stream)); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::from_keyword, + TokenKind::FromKeyword, + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::close_brace, - TokenKind::CloseBrace, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, )); break; } running_result } - .with_kind(RuleKind::NamedArgumentList) + .with_kind(RuleKind::NamedImport) } // NewExpression = NEW_KEYWORD TypeName; @@ -5195,16 +5490,16 @@ impl Language { } // (* v0.4.11 *) - // NumberUnit = DAYS_KEYWORD - // | ETHER_KEYWORD - // | FINNEY_KEYWORD - // | HOURS_KEYWORD - // | MINUTES_KEYWORD - // | SECONDS_KEYWORD - // | SZABO_KEYWORD - // | WEEKS_KEYWORD - // | WEI_KEYWORD - // | YEARS_KEYWORD; + // «NumberUnit» = DAYS_KEYWORD + // | ETHER_KEYWORD + // | FINNEY_KEYWORD + // | HOURS_KEYWORD + // | MINUTES_KEYWORD + // | SECONDS_KEYWORD + // | SZABO_KEYWORD + // | WEEKS_KEYWORD + // | WEI_KEYWORD + // | YEARS_KEYWORD; #[allow(dead_code, non_snake_case)] fn number_unit__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -5293,19 +5588,18 @@ impl Language { } running_result } - .with_kind(RuleKind::NumberUnit) } // (* v0.5.0 *) - // NumberUnit = DAYS_KEYWORD - // | ETHER_KEYWORD - // | FINNEY_KEYWORD - // | HOURS_KEYWORD - // | MINUTES_KEYWORD - // | SECONDS_KEYWORD - // | SZABO_KEYWORD - // | WEEKS_KEYWORD - // | WEI_KEYWORD; + // «NumberUnit» = DAYS_KEYWORD + // | ETHER_KEYWORD + // | FINNEY_KEYWORD + // | HOURS_KEYWORD + // | MINUTES_KEYWORD + // | SECONDS_KEYWORD + // | SZABO_KEYWORD + // | WEEKS_KEYWORD + // | WEI_KEYWORD; #[allow(dead_code, non_snake_case)] fn number_unit__0_5_0(&self, stream: &mut Stream) -> ParserResult { @@ -5386,20 +5680,19 @@ impl Language { } running_result } - .with_kind(RuleKind::NumberUnit) } // (* v0.6.11 *) - // NumberUnit = DAYS_KEYWORD - // | ETHER_KEYWORD - // | FINNEY_KEYWORD - // | GWEI_KEYWORD - // | HOURS_KEYWORD - // | MINUTES_KEYWORD - // | SECONDS_KEYWORD - // | SZABO_KEYWORD - // | WEEKS_KEYWORD - // | WEI_KEYWORD; + // «NumberUnit» = DAYS_KEYWORD + // | ETHER_KEYWORD + // | FINNEY_KEYWORD + // | GWEI_KEYWORD + // | HOURS_KEYWORD + // | MINUTES_KEYWORD + // | SECONDS_KEYWORD + // | SZABO_KEYWORD + // | WEEKS_KEYWORD + // | WEI_KEYWORD; #[allow(dead_code, non_snake_case)] fn number_unit__0_6_11(&self, stream: &mut Stream) -> ParserResult { @@ -5488,18 +5781,17 @@ impl Language { } running_result } - .with_kind(RuleKind::NumberUnit) } // (* v0.7.0 *) - // NumberUnit = DAYS_KEYWORD - // | ETHER_KEYWORD - // | GWEI_KEYWORD - // | HOURS_KEYWORD - // | MINUTES_KEYWORD - // | SECONDS_KEYWORD - // | WEEKS_KEYWORD - // | WEI_KEYWORD; + // «NumberUnit» = DAYS_KEYWORD + // | ETHER_KEYWORD + // | GWEI_KEYWORD + // | HOURS_KEYWORD + // | MINUTES_KEYWORD + // | SECONDS_KEYWORD + // | WEEKS_KEYWORD + // | WEI_KEYWORD; #[allow(dead_code, non_snake_case)] fn number_unit__0_7_0(&self, stream: &mut Stream) -> ParserResult { @@ -5572,7 +5864,6 @@ impl Language { } running_result } - .with_kind(RuleKind::NumberUnit) } pub(crate) fn number_unit(&self, stream: &mut Stream) -> ParserResult { @@ -5588,7 +5879,7 @@ impl Language { } // (* v0.4.11 *) - // NumericExpression = (HEX_LITERAL | DECIMAL_LITERAL) NumberUnit?; + // NumericExpression = (HEX_LITERAL | DECIMAL_LITERAL) «NumberUnit»?; #[allow(dead_code, non_snake_case)] fn numeric_expression__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -5628,7 +5919,7 @@ impl Language { } // (* v0.5.0 *) - // NumericExpression = HEX_LITERAL | (DECIMAL_LITERAL NumberUnit?); + // NumericExpression = HEX_LITERAL | (DECIMAL_LITERAL «NumberUnit»?); #[allow(dead_code, non_snake_case)] fn numeric_expression__0_5_0(&self, stream: &mut Stream) -> ParserResult { @@ -5678,19 +5969,18 @@ impl Language { } } - // OrOperator = BAR_BAR; + // «OrOperator» = BAR_BAR; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn or_operator(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, &Self::bar_bar, TokenKind::BarBar) - .with_kind(RuleKind::OrOperator) } - // OrderComparisonOperator = LESS_THAN - // | GREATER_THAN - // | LESS_THAN_EQUAL - // | GREATER_THAN_EQUAL; + // «OrderComparisonOperator» = LESS_THAN + // | GREATER_THAN + // | LESS_THAN_EQUAL + // | GREATER_THAN_EQUAL; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -5732,10 +6022,9 @@ impl Language { } running_result } - .with_kind(RuleKind::OrderComparisonOperator) } - // OverrideSpecifier = OVERRIDE_KEYWORD (OPEN_PAREN IdentifierPath (COMMA IdentifierPath)* CLOSE_PAREN)?; + // OverrideSpecifier = OVERRIDE_KEYWORD (OPEN_PAREN IdentifierPathsList? CLOSE_PAREN)?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -5762,42 +6051,9 @@ impl Language { ) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result(self.identifier_path(stream)) - { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.identifier_path(stream), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.identifier_paths_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -5816,11 +6072,11 @@ impl Language { .with_kind(RuleKind::OverrideSpecifier) } - // ParameterDeclaration = TypeName DataLocation? IDENTIFIER?; + // Parameter = TypeName «DataLocation»? IDENTIFIER?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn parameter_declaration(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn parameter(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -5839,14 +6095,14 @@ impl Language { } running_result } - .with_kind(RuleKind::ParameterDeclaration) + .with_kind(RuleKind::Parameter) } - // ParameterList = OPEN_PAREN (ParameterDeclaration (COMMA ParameterDeclaration)*)? CLOSE_PAREN; + // ParametersDeclaration = OPEN_PAREN ParametersList? CLOSE_PAREN; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn parameter_list(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn parameters_declaration(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -5857,41 +6113,9 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result(self.parameter_declaration(stream)) - { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.parameter_declaration(stream), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.parameters_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -5903,23 +6127,96 @@ impl Language { } running_result } - .with_kind(RuleKind::ParameterList) + .with_kind(RuleKind::ParametersDeclaration) + } + + // ParametersList = Parameter (COMMA Parameter)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn parameters_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parameter(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.parameter(stream)); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::ParametersList) } - // PayableType = PAYABLE_KEYWORD; + // PathImport = ASCII_STRING_LITERAL (AS_KEYWORD IDENTIFIER)?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn payable_type(&self, stream: &mut Stream) -> ParserResult { - self.parse_token_with_trivia(stream, &Self::payable_keyword, TokenKind::PayableKeyword) - .with_kind(RuleKind::PayableType) + pub(crate) fn path_import(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::ascii_string_literal, + TokenKind::AsciiStringLiteral, + )) { + break; + } + running_result.incorporate_sequence_result(transform_option_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::as_keyword, + TokenKind::AsKeyword, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )); + break; + } + running_result + })); + break; + } + running_result + } + .with_kind(RuleKind::PathImport) } - // PositionalArgumentList = Expression (COMMA Expression)*; + // PositionalArgumentsList = Expression (COMMA Expression)*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn positional_argument_list(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn positional_arguments_list(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -5951,10 +6248,10 @@ impl Language { } running_result } - .with_kind(RuleKind::PositionalArgumentList) + .with_kind(RuleKind::PositionalArgumentsList) } - // PragmaDirective = PRAGMA_KEYWORD (VersionPragma | ABICoderPragma | ExperimentalPragma) SEMICOLON; + // PragmaDirective = PRAGMA_KEYWORD (ABICoderPragma | ExperimentalPragma | VersionPragma) SEMICOLON; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -5979,19 +6276,19 @@ impl Language { let start_position = stream.position(); loop { if running_result - .incorporate_choice_result(self.version_pragma(stream)) + .incorporate_choice_result(self.abi_coder_pragma(stream)) { break; } stream.set_position(start_position); if running_result - .incorporate_choice_result(self.abi_coder_pragma(stream)) + .incorporate_choice_result(self.experimental_pragma(stream)) { break; } stream.set_position(start_position); running_result - .incorporate_choice_result(self.experimental_pragma(stream)); + .incorporate_choice_result(self.version_pragma(stream)); break; } running_result @@ -6015,14 +6312,14 @@ impl Language { } // (* v0.4.11 *) - // PrimaryExpression = NewExpression - // | TupleExpression - // | ArrayLiteral - // | BooleanLiteral - // | NumericExpression - // | StringExpression - // | ElementaryType - // | IDENTIFIER; + // «PrimaryExpression» = NewExpression + // | TupleExpression + // | ArrayExpression + // | «BooleanExpression» + // | NumericExpression + // | «StringExpression» + // | «ElementaryType» + // | IDENTIFIER; #[allow(dead_code, non_snake_case)] fn primary_expression__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -6038,11 +6335,11 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.array_literal(stream)) { + if running_result.incorporate_choice_result(self.array_expression(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.boolean_literal(stream)) { + if running_result.incorporate_choice_result(self.boolean_expression(stream)) { break; } stream.set_position(start_position); @@ -6067,19 +6364,18 @@ impl Language { } running_result } - .with_kind(RuleKind::PrimaryExpression) } // (* v0.5.3 *) - // PrimaryExpression = NewExpression - // | TupleExpression - // | TypeExpression - // | ArrayLiteral - // | BooleanLiteral - // | NumericExpression - // | StringExpression - // | ElementaryType - // | IDENTIFIER; + // «PrimaryExpression» = NewExpression + // | TupleExpression + // | TypeExpression + // | ArrayExpression + // | «BooleanExpression» + // | NumericExpression + // | «StringExpression» + // | «ElementaryType» + // | IDENTIFIER; #[allow(dead_code, non_snake_case)] fn primary_expression__0_5_3(&self, stream: &mut Stream) -> ParserResult { @@ -6099,11 +6395,11 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.array_literal(stream)) { + if running_result.incorporate_choice_result(self.array_expression(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.boolean_literal(stream)) { + if running_result.incorporate_choice_result(self.boolean_expression(stream)) { break; } stream.set_position(start_position); @@ -6128,7 +6424,6 @@ impl Language { } running_result } - .with_kind(RuleKind::PrimaryExpression) } pub(crate) fn primary_expression(&self, stream: &mut Stream) -> ParserResult { @@ -6140,11 +6435,11 @@ impl Language { } // (* v0.6.0 *) - // ReceiveFunctionAttribute = ModifierInvocation - // | OverrideSpecifier - // | EXTERNAL_KEYWORD - // | PAYABLE_KEYWORD - // | VIRTUAL_KEYWORD; + // «ReceiveFunctionAttribute» = ModifierInvocation + // | OverrideSpecifier + // | EXTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | VIRTUAL_KEYWORD; #[allow(dead_code, non_snake_case)] fn receive_function_attribute__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -6185,7 +6480,6 @@ impl Language { } running_result } - .with_kind(RuleKind::ReceiveFunctionAttribute) } #[allow(non_snake_case)] @@ -6207,7 +6501,41 @@ impl Language { } // (* v0.6.0 *) - // ReceiveFunctionDefinition = RECEIVE_KEYWORD ParameterList ReceiveFunctionAttribute* (SEMICOLON | Block); + // ReceiveFunctionAttributesList = «ReceiveFunctionAttribute»+; + + #[allow(dead_code, non_snake_case)] + fn receive_function_attributes_list__0_6_0(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result + .incorporate_one_or_more_result(self.receive_function_attribute(stream)) + { + } + running_result + } + .with_kind(RuleKind::ReceiveFunctionAttributesList) + } + + #[allow(non_snake_case)] + pub(crate) fn receive_function_attributes_list__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_6_0 { + Some(self.receive_function_attributes_list__0_6_0(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn receive_function_attributes_list(&self, stream: &mut Stream) -> ParserResult { + self.receive_function_attributes_list__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // (* v0.6.0 *) + // ReceiveFunctionDefinition = RECEIVE_KEYWORD ParametersDeclaration ReceiveFunctionAttributesList? (SEMICOLON | Block); #[allow(dead_code, non_snake_case)] fn receive_function_definition__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -6221,17 +6549,13 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(self.parameter_list(stream)) { + if !running_result.incorporate_sequence_result(self.parameters_declaration(stream)) + { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.receive_function_attribute(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.receive_function_attributes_list(stream), + )) { break; } running_result.incorporate_sequence_result({ @@ -6315,57 +6639,36 @@ impl Language { running_result } .with_kind(RuleKind::ReturnStatement) - } - - // RevertStatement = REVERT_KEYWORD IdentifierPath? ArgumentList SEMICOLON; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn revert_statement(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::revert_keyword, - TokenKind::RevertKeyword, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result(transform_option_result( - self.identifier_path(stream), - )) { - break; - } - running_result.incorporate_sequence_result(self.argument_list(stream)); - break; - } - running_result - }) { + } + + // ReturnsDeclaration = RETURNS_KEYWORD ParametersDeclaration; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn returns_declaration(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::returns_keyword, + TokenKind::ReturnsKeyword, + )) { break; } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::semicolon, - TokenKind::Semicolon, - )); + running_result.incorporate_sequence_result(self.parameters_declaration(stream)); break; } running_result } - .with_kind(RuleKind::RevertStatement) + .with_kind(RuleKind::ReturnsDeclaration) } - // SelectiveImport = OPEN_BRACE IDENTIFIER ImportAlias? (COMMA IDENTIFIER ImportAlias?)* CLOSE_BRACE FROM_KEYWORD ImportPath; + // RevertStatement = REVERT_KEYWORD IdentifierPath? ArgumentsDeclaration SEMICOLON; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn selective_import(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn revert_statement(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -6375,114 +6678,40 @@ impl Language { if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::open_brace, - TokenKind::OpenBrace, + &Self::revert_keyword, + TokenKind::RevertKeyword, ), ) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - transform_option_result(self.import_alias(stream)), - ); - break; - } - running_result - }) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - transform_option_result( - self.import_alias(stream), - ), - ); - break; - } - running_result - }); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.identifier_path(stream), + )) { break; } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_brace, - TokenKind::CloseBrace, - )); + running_result + .incorporate_sequence_result(self.arguments_declaration(stream)); break; } running_result }) { break; } - if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::from_keyword, - TokenKind::FromKeyword, - )) { - break; - } - running_result.incorporate_sequence_result(self.import_path(stream)); + &Self::semicolon, + TokenKind::Semicolon, + )); break; } running_result } - .with_kind(RuleKind::SelectiveImport) + .with_kind(RuleKind::RevertStatement) } - // ShiftOperator = LESS_THAN_LESS_THAN - // | GREATER_THAN_GREATER_THAN - // | GREATER_THAN_GREATER_THAN_GREATER_THAN; + // «ShiftOperator» = LESS_THAN_LESS_THAN + // | GREATER_THAN_GREATER_THAN + // | GREATER_THAN_GREATER_THAN_GREATER_THAN; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -6516,104 +6745,225 @@ impl Language { } running_result } - .with_kind(RuleKind::ShiftOperator) } - // SimpleImport = ImportPath ImportAlias?; + // «SimpleStatement» = ExpressionStatement + // | VariableDeclarationStatement + // | TupleDeconstructionStatement; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn simple_statement(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result(self.expression_statement(stream)) { + break; + } + stream.set_position(start_position); + if running_result + .incorporate_choice_result(self.variable_declaration_statement(stream)) + { + break; + } + stream.set_position(start_position); + running_result + .incorporate_choice_result(self.tuple_deconstruction_statement(stream)); + break; + } + running_result + } + } + + // SourceUnit = SourceUnitMembersList? EndOfFileTrivia?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn simple_import(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn source_unit(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result(self.import_path(stream)) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.source_unit_members_list(stream), + )) { break; } running_result.incorporate_sequence_result(transform_option_result( - self.import_alias(stream), + self.end_of_file_trivia(stream), )); break; } running_result } - .with_kind(RuleKind::SimpleImport) + .with_kind(RuleKind::SourceUnit) } - // SimpleStatement = TupleDeconstructionStatement - // | VariableDeclarationStatement - // | ExpressionStatement; + // (* v0.4.11 *) + // «SourceUnitMember» = ContractDefinition + // | LibraryDefinition + // | InterfaceDefinition + // | StructDefinition + // | EnumDefinition + // | ConstantDefinition + // | FunctionDefinition + // | ErrorDefinition + // | ImportDirective + // | PragmaDirective + // | UsingDirective; - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn simple_statement(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code, non_snake_case)] + fn source_unit_member__0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result - .incorporate_choice_result(self.tuple_deconstruction_statement(stream)) - { + if running_result.incorporate_choice_result(self.contract_definition(stream)) { break; } stream.set_position(start_position); - if running_result - .incorporate_choice_result(self.variable_declaration_statement(stream)) - { + if running_result.incorporate_choice_result(self.library_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.interface_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.struct_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.enum_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.constant_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.function_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.error_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.import_directive(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.pragma_directive(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.expression_statement(stream)); + running_result.incorporate_choice_result(self.using_directive(stream)); break; } running_result } - .with_kind(RuleKind::SimpleStatement) } - // SourceUnit = (Directive | Definition)* EndOfFileTrivia?; + // (* v0.8.8 *) + // «SourceUnitMember» = ContractDefinition + // | LibraryDefinition + // | InterfaceDefinition + // | StructDefinition + // | EnumDefinition + // | ConstantDefinition + // | FunctionDefinition + // | ErrorDefinition + // | ImportDirective + // | PragmaDirective + // | UsingDirective + // | UserDefinedValueTypeDefinition; - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn source_unit(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code, non_snake_case)] + fn source_unit_member__0_8_8(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::r#match(vec![], vec![]); + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result(self.directive(stream)) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.definition(stream)); - break; - } - running_result - }) {} - running_result - }) { + if running_result.incorporate_choice_result(self.contract_definition(stream)) { break; } - running_result.incorporate_sequence_result(transform_option_result( - self.end_of_file_trivia(stream), - )); + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.library_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.interface_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.struct_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.enum_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.constant_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.function_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.error_definition(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.import_directive(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.pragma_directive(stream)) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.using_directive(stream)) { + break; + } + stream.set_position(start_position); + running_result + .incorporate_choice_result(self.user_defined_value_type_definition(stream)); break; } running_result } - .with_kind(RuleKind::SourceUnit) + } + + pub(crate) fn source_unit_member(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_8_8 { + self.source_unit_member__0_8_8(stream) + } else { + self.source_unit_member__0_4_11(stream) + } + } + + // SourceUnitMembersList = «SourceUnitMember»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn source_unit_members_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.source_unit_member(stream)) {} + running_result + } + .with_kind(RuleKind::SourceUnitMembersList) } // (* v0.4.11 *) - // StateVariableAttribute = OverrideSpecifier - // | CONSTANT_KEYWORD - // | INTERNAL_KEYWORD - // | PRIVATE_KEYWORD - // | PUBLIC_KEYWORD; + // «StateVariableAttribute» = OverrideSpecifier + // | CONSTANT_KEYWORD + // | INTERNAL_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD; #[allow(dead_code, non_snake_case)] fn state_variable_attribute__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -6658,16 +7008,15 @@ impl Language { } running_result } - .with_kind(RuleKind::StateVariableAttribute) } // (* v0.6.5 *) - // StateVariableAttribute = OverrideSpecifier - // | CONSTANT_KEYWORD - // | IMMUTABLE_KEYWORD - // | INTERNAL_KEYWORD - // | PRIVATE_KEYWORD - // | PUBLIC_KEYWORD; + // «StateVariableAttribute» = OverrideSpecifier + // | CONSTANT_KEYWORD + // | IMMUTABLE_KEYWORD + // | INTERNAL_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD; #[allow(dead_code, non_snake_case)] fn state_variable_attribute__0_6_5(&self, stream: &mut Stream) -> ParserResult { @@ -6720,7 +7069,6 @@ impl Language { } running_result } - .with_kind(RuleKind::StateVariableAttribute) } pub(crate) fn state_variable_attribute(&self, stream: &mut Stream) -> ParserResult { @@ -6731,11 +7079,26 @@ impl Language { } } - // StateVariableDeclaration = TypeName StateVariableAttribute* IDENTIFIER (EQUAL Expression)? SEMICOLON; + // StateVariableAttributesList = «StateVariableAttribute»+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn state_variable_attributes_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result + .incorporate_one_or_more_result(self.state_variable_attribute(stream)) + {} + running_result + } + .with_kind(RuleKind::StateVariableAttributesList) + } + + // StateVariableDefinition = TypeName StateVariableAttributesList? IDENTIFIER (EQUAL Expression)? SEMICOLON; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn state_variable_declaration(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn state_variable_definition(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -6745,15 +7108,11 @@ impl Language { if !running_result.incorporate_sequence_result(self.type_name(stream)) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result( - self.state_variable_attribute(stream), - ) {} - running_result - }) { - break; - } + if !running_result.incorporate_sequence_result(transform_option_result( + self.state_variable_attributes_list(stream), + )) { + break; + } if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, @@ -6795,23 +7154,14 @@ impl Language { } running_result } - .with_kind(RuleKind::StateVariableDeclaration) + .with_kind(RuleKind::StateVariableDefinition) } // (* v0.4.11 *) - // Statement = Block - // | SimpleStatement - // | IfStatement - // | ForStatement - // | WhileStatement - // | DoWhileStatement - // | ContinueStatement - // | BreakStatement - // | ReturnStatement - // | ThrowStatement - // | RevertStatement - // | DeleteStatement - // | AssemblyStatement; + // Statement = «SimpleStatement» + // | «ControlStatement» + // | AssemblyStatement + // | Block; #[allow(dead_code, non_snake_case)] fn statement__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -6819,55 +7169,19 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result(self.block(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.simple_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.if_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.for_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.do_while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.continue_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.break_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.return_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.throw_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.revert_statement(stream)) { + if running_result.incorporate_choice_result(self.control_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.delete_statement(stream)) { + if running_result.incorporate_choice_result(self.assembly_statement(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.assembly_statement(stream)); + running_result.incorporate_choice_result(self.block(stream)); break; } running_result @@ -6875,81 +7189,36 @@ impl Language { .with_kind(RuleKind::Statement) } - // (* v0.4.21 *) - // Statement = Block - // | SimpleStatement - // | IfStatement - // | ForStatement - // | WhileStatement - // | DoWhileStatement - // | ContinueStatement - // | BreakStatement - // | ReturnStatement - // | EmitStatement - // | ThrowStatement - // | RevertStatement - // | DeleteStatement - // | AssemblyStatement; + // (* v0.8.0 *) + // Statement = «SimpleStatement» + // | «ControlStatement» + // | AssemblyStatement + // | Block + // | UncheckedBlock; #[allow(dead_code, non_snake_case)] - fn statement__0_4_21(&self, stream: &mut Stream) -> ParserResult { + fn statement__0_8_0(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result(self.block(stream)) { - break; - } - stream.set_position(start_position); if running_result.incorporate_choice_result(self.simple_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.if_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.for_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.do_while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.continue_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.break_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.return_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.emit_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.throw_statement(stream)) { + if running_result.incorporate_choice_result(self.control_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.revert_statement(stream)) { + if running_result.incorporate_choice_result(self.assembly_statement(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.delete_statement(stream)) { + if running_result.incorporate_choice_result(self.block(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result(self.assembly_statement(stream)); + running_result.incorporate_choice_result(self.unchecked_block(stream)); break; } running_result @@ -6957,179 +7226,29 @@ impl Language { .with_kind(RuleKind::Statement) } - // (* v0.5.0 *) - // Statement = Block - // | SimpleStatement - // | IfStatement - // | ForStatement - // | WhileStatement - // | DoWhileStatement - // | ContinueStatement - // | BreakStatement - // | ReturnStatement - // | EmitStatement - // | RevertStatement - // | DeleteStatement - // | AssemblyStatement; - - #[allow(dead_code, non_snake_case)] - fn statement__0_5_0(&self, stream: &mut Stream) -> ParserResult { - { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result(self.block(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.simple_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.if_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.for_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.do_while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.continue_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.break_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.return_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.emit_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.revert_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.delete_statement(stream)) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.assembly_statement(stream)); - break; - } - running_result + pub(crate) fn statement(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_8_0 { + self.statement__0_8_0(stream) + } else { + self.statement__0_4_11(stream) } - .with_kind(RuleKind::Statement) } - // (* v0.6.0 *) - // Statement = Block - // | SimpleStatement - // | IfStatement - // | ForStatement - // | WhileStatement - // | DoWhileStatement - // | ContinueStatement - // | BreakStatement - // | TryStatement - // | ReturnStatement - // | EmitStatement - // | RevertStatement - // | DeleteStatement - // | AssemblyStatement; + // StatementsList = Statement+; - #[allow(dead_code, non_snake_case)] - fn statement__0_6_0(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn statements_list(&self, stream: &mut Stream) -> ParserResult { { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result(self.block(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.simple_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.if_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.for_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.do_while_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.continue_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.break_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.try_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.return_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.emit_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.revert_statement(stream)) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result(self.delete_statement(stream)) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.assembly_statement(stream)); - break; - } + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.statement(stream)) {} running_result } - .with_kind(RuleKind::Statement) - } - - pub(crate) fn statement(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_6_0 { - self.statement__0_6_0(stream) - } else if self.version_is_equal_to_or_greater_than_0_5_0 { - self.statement__0_5_0(stream) - } else if self.version_is_equal_to_or_greater_than_0_4_21 { - self.statement__0_4_21(stream) - } else { - self.statement__0_4_11(stream) - } + .with_kind(RuleKind::StatementsList) } // (* v0.4.11 *) - // StringExpression = HEX_STRING_LITERAL+ | ASCII_STRING_LITERAL+; + // «StringExpression» = HexStringLiteralsList | AsciiStringLiteralsList; #[allow(dead_code, non_snake_case)] fn string_expression__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -7137,40 +7256,21 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result( - self.parse_token_with_trivia( - stream, - &Self::hex_string_literal, - TokenKind::HexStringLiteral, - ), - ) {} - running_result - }) { + if running_result.incorporate_choice_result(self.hex_string_literals_list(stream)) { break; } stream.set_position(start_position); - running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result( - self.parse_token_with_trivia( - stream, - &Self::ascii_string_literal, - TokenKind::AsciiStringLiteral, - ), - ) {} - running_result - }); + running_result.incorporate_choice_result(self.ascii_string_literals_list(stream)); break; } running_result } - .with_kind(RuleKind::StringExpression) } // (* v0.7.0 *) - // StringExpression = HEX_STRING_LITERAL+ | ASCII_STRING_LITERAL+ | UNICODE_STRING_LITERAL+; + // «StringExpression» = HexStringLiteralsList + // | AsciiStringLiteralsList + // | UnicodeStringLiteralsList; #[allow(dead_code, non_snake_case)] fn string_expression__0_7_0(&self, stream: &mut Stream) -> ParserResult { @@ -7178,50 +7278,20 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result( - self.parse_token_with_trivia( - stream, - &Self::hex_string_literal, - TokenKind::HexStringLiteral, - ), - ) {} - running_result - }) { + if running_result.incorporate_choice_result(self.hex_string_literals_list(stream)) { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result( - self.parse_token_with_trivia( - stream, - &Self::ascii_string_literal, - TokenKind::AsciiStringLiteral, - ), - ) {} - running_result - }) { + if running_result.incorporate_choice_result(self.ascii_string_literals_list(stream)) + { break; } stream.set_position(start_position); - running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result( - self.parse_token_with_trivia( - stream, - &Self::unicode_string_literal, - TokenKind::UnicodeStringLiteral, - ), - ) {} - running_result - }); + running_result.incorporate_choice_result(self.unicode_string_literals_list(stream)); break; } running_result } - .with_kind(RuleKind::StringExpression) } pub(crate) fn string_expression(&self, stream: &mut Stream) -> ParserResult { @@ -7232,7 +7302,7 @@ impl Language { } } - // StructDefinition = STRUCT_KEYWORD IDENTIFIER OPEN_BRACE StructMember+ CLOSE_BRACE; + // StructDefinition = STRUCT_KEYWORD IDENTIFIER OPEN_BRACE StructMembersList? CLOSE_BRACE; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -7266,14 +7336,9 @@ impl Language { ) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_one_or_more_result(self.struct_member(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.struct_members_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -7329,6 +7394,19 @@ impl Language { .with_kind(RuleKind::StructMember) } + // StructMembersList = StructMember+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn struct_members_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.struct_member(stream)) {} + running_result + } + .with_kind(RuleKind::StructMembersList) + } + // (* v0.4.11 *) // ThrowStatement = THROW_KEYWORD SEMICOLON; @@ -7409,7 +7487,7 @@ impl Language { } // (* v0.6.0 *) - // TryStatement = TRY_KEYWORD Expression (RETURNS_KEYWORD ParameterList)? Block CatchClause+; + // TryStatement = TRY_KEYWORD Expression ReturnsDeclaration? Block CatchClausesList; #[allow(dead_code, non_snake_case)] fn try_statement__0_6_0(&self, stream: &mut Stream) -> ParserResult { @@ -7426,34 +7504,15 @@ impl Language { if !running_result.incorporate_sequence_result(self.expression(stream)) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::returns_keyword, - TokenKind::ReturnsKeyword, - ), - ) { - break; - } - running_result.incorporate_sequence_result(self.parameter_list(stream)); - break; - } - running_result - })) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.returns_declaration(stream), + )) { break; } if !running_result.incorporate_sequence_result(self.block(stream)) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result(self.catch_clause(stream)) { - } - running_result - }); + running_result.incorporate_sequence_result(self.catch_clauses_list(stream)); break; } running_result @@ -7479,15 +7538,72 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // TupleDeconstructionStatement = OPEN_PAREN (((TypeName DataLocation? IDENTIFIER) | (DataLocation? IDENTIFIER))? (COMMA ((TypeName DataLocation? IDENTIFIER) | (DataLocation? IDENTIFIER))?)*)? CLOSE_PAREN EQUAL Expression SEMICOLON; + // TupleDeconstructionStatement = OPEN_PAREN TupleMembersList? CLOSE_PAREN EQUAL Expression SEMICOLON; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn tuple_deconstruction_statement(&self, stream: &mut Stream) -> ParserResult { - { let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: open_paren , TokenKind :: OpenParen)) { break ; } if ! running_result . incorporate_sequence_result (transform_option_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (transform_option_result ({ let mut running_result = ParserResult :: no_match (vec ! []) ; let start_position = stream . position () ; loop { if running_result . incorporate_choice_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . type_name (stream)) { break ; } if ! running_result . incorporate_sequence_result (transform_option_result (self . data_location (stream))) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: identifier , TokenKind :: Identifier)) ; break ; } running_result }) { break ; } stream . set_position (start_position) ; running_result . incorporate_choice_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (transform_option_result (self . data_location (stream))) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: identifier , TokenKind :: Identifier)) ; break ; } running_result }) ; break ; } running_result })) { break ; } running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; while running_result . incorporate_zero_or_more_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: comma , TokenKind :: Comma)) { break ; } running_result . incorporate_sequence_result (transform_option_result ({ let mut running_result = ParserResult :: no_match (vec ! []) ; let start_position = stream . position () ; loop { if running_result . incorporate_choice_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . type_name (stream)) { break ; } if ! running_result . incorporate_sequence_result (transform_option_result (self . data_location (stream))) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: identifier , TokenKind :: Identifier)) ; break ; } running_result }) { break ; } stream . set_position (start_position) ; running_result . incorporate_choice_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (transform_option_result (self . data_location (stream))) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: identifier , TokenKind :: Identifier)) ; break ; } running_result }) ; break ; } running_result })) ; break ; } running_result }) { } running_result }) ; break ; } running_result })) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: close_paren , TokenKind :: CloseParen)) ; break ; } running_result }) { break ; } if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: equal , TokenKind :: Equal)) { break ; } running_result . incorporate_sequence_result (self . expression (stream)) ; break ; } running_result }) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: semicolon , TokenKind :: Semicolon)) ; break ; } running_result } . with_kind (RuleKind :: TupleDeconstructionStatement) + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::open_paren, + TokenKind::OpenParen, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result( + transform_option_result(self.tuple_members_list(stream)), + ) { + break; + } + running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::close_paren, + TokenKind::CloseParen, + ), + ); + break; + } + running_result + }) { + break; + } + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia(stream, &Self::equal, TokenKind::Equal), + ) { + break; + } + running_result.incorporate_sequence_result(self.expression(stream)); + break; + } + running_result + }) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::semicolon, + TokenKind::Semicolon, + )); + break; + } + running_result + } + .with_kind(RuleKind::TupleDeconstructionStatement) } - // TupleExpression = OPEN_PAREN Expression? (COMMA Expression?)* CLOSE_PAREN; + // TupleExpression = OPEN_PAREN TupleValuesList CLOSE_PAREN; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -7502,53 +7618,157 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result({ + if !running_result.incorporate_sequence_result(self.tuple_values_list(stream)) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_paren, + TokenKind::CloseParen, + )); + break; + } + running_result + } + .with_kind(RuleKind::TupleExpression) + } + + // TupleMember = ((TypeName «DataLocation»? IDENTIFIER) | («DataLocation»? IDENTIFIER))?; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn tuple_member(&self, stream: &mut Stream) -> ParserResult { + transform_option_result({ + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); loop { + if !running_result.incorporate_sequence_result(self.type_name(stream)) { + break; + } if !running_result.incorporate_sequence_result(transform_option_result( - self.expression(stream), + self.data_location(stream), )) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - transform_option_result(self.expression(stream)), - ); - break; - } - running_result - }) {} - running_result - }); + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )); break; } running_result }) { break; } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_paren, - TokenKind::CloseParen, - )); + stream.set_position(start_position); + running_result.incorporate_choice_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(transform_option_result( + self.data_location(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )); + break; + } + running_result + }); + break; + } + running_result + }) + .with_kind(RuleKind::TupleMember) + } + + // TupleMembersList = TupleMember (COMMA TupleMember)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn tuple_members_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.tuple_member(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.tuple_member(stream)); + break; + } + running_result + }) {} + running_result + }); break; } running_result } - .with_kind(RuleKind::TupleExpression) + .with_kind(RuleKind::TupleMembersList) + } + + // TupleValuesList = Expression? (COMMA Expression?)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn tuple_values_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result + .incorporate_sequence_result(transform_option_result(self.expression(stream))) + { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result(transform_option_result( + self.expression(stream), + )); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::TupleValuesList) } // (* v0.5.3 *) @@ -7615,8 +7835,8 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // TypeName = ArrayTypeName | FunctionType | MappingType | ElementaryType | IdentifierPath; - // ArrayTypeName = TypeName OPEN_BRACKET Expression? CLOSE_BRACKET; + // TypeName = ArrayTypeName | FunctionType | MappingType | «ElementaryType» | IdentifierPath; + // ArrayTypeName = TypeName «ArrayTypeNameOperator»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -7640,55 +7860,25 @@ impl Language { stream.set_position(start_position); if running_result .incorporate_choice_result(self.elementary_type(stream)) - { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.identifier_path(stream)); - break; - } - running_result - }; - if result.is_match() { - elements.push(result); - } else { - break result; - } - } - let result = loop { - let result = { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_bracket, - TokenKind::OpenBracket, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result(transform_option_result( - self.expression(stream), - )) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::close_bracket, - TokenKind::CloseBracket, - ), - ); + { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.identifier_path(stream)); break; } running_result + }; + if result.is_match() { + elements.push(result); + } else { + break result; } - .to_pratt_element_operator( - RuleKind::ArrayTypeName, - 1u8, - 255, - ); + } + let result = loop { + let result = self + .array_type_name_operator(stream) + .to_pratt_element_operator(RuleKind::ArrayTypeName, 1u8, 255); match result { ParserResult::PrattOperatorMatch(_) => elements.push(result), _ => break result, @@ -7731,7 +7921,7 @@ impl Language { .with_kind(RuleKind::TypeName) } - // UnaryPostfixOperator = PLUS_PLUS | MINUS_MINUS; + // «UnaryPostfixOperator» = PLUS_PLUS | MINUS_MINUS; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -7757,16 +7947,15 @@ impl Language { } running_result } - .with_kind(RuleKind::UnaryPostfixOperator) } // (* v0.4.11 *) - // UnaryPrefixOperator = PLUS_PLUS - // | MINUS_MINUS - // | TILDE - // | BANG - // | MINUS - // | PLUS; + // «UnaryPrefixOperator» = PLUS_PLUS + // | MINUS_MINUS + // | TILDE + // | BANG + // | MINUS + // | PLUS; #[allow(dead_code, non_snake_case)] fn unary_prefix_operator__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -7823,15 +8012,14 @@ impl Language { } running_result } - .with_kind(RuleKind::UnaryPrefixOperator) } // (* v0.5.0 *) - // UnaryPrefixOperator = PLUS_PLUS - // | MINUS_MINUS - // | TILDE - // | BANG - // | MINUS; + // «UnaryPrefixOperator» = PLUS_PLUS + // | MINUS_MINUS + // | TILDE + // | BANG + // | MINUS; #[allow(dead_code, non_snake_case)] fn unary_prefix_operator__0_5_0(&self, stream: &mut Stream) -> ParserResult { @@ -7880,7 +8068,6 @@ impl Language { } running_result } - .with_kind(RuleKind::UnaryPrefixOperator) } pub(crate) fn unary_prefix_operator(&self, stream: &mut Stream) -> ParserResult { @@ -7932,13 +8119,48 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } + // (* v0.7.0 *) + // UnicodeStringLiteralsList = UNICODE_STRING_LITERAL+; + + #[allow(dead_code, non_snake_case)] + fn unicode_string_literals_list__0_7_0(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.parse_token_with_trivia( + stream, + &Self::unicode_string_literal, + TokenKind::UnicodeStringLiteral, + )) {} + running_result + } + .with_kind(RuleKind::UnicodeStringLiteralsList) + } + + #[allow(non_snake_case)] + pub(crate) fn unicode_string_literals_list__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_7_0 { + Some(self.unicode_string_literals_list__0_7_0(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn unicode_string_literals_list(&self, stream: &mut Stream) -> ParserResult { + self.unicode_string_literals_list__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + // (* v0.4.11 *) - // UnnamedFunctionAttribute = ModifierInvocation - // | OverrideSpecifier - // | EXTERNAL_KEYWORD - // | PAYABLE_KEYWORD - // | PURE_KEYWORD - // | VIEW_KEYWORD; + // «UnnamedFunctionAttribute» = ModifierInvocation + // | OverrideSpecifier + // | EXTERNAL_KEYWORD + // | PAYABLE_KEYWORD + // | PURE_KEYWORD + // | VIEW_KEYWORD; #[allow(dead_code, non_snake_case)] fn unnamed_function_attribute__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -7987,7 +8209,6 @@ impl Language { } running_result } - .with_kind(RuleKind::UnnamedFunctionAttribute) } #[allow(non_snake_case)] @@ -8009,7 +8230,41 @@ impl Language { } // (* v0.4.11 *) - // UnnamedFunctionDefinition = FUNCTION_KEYWORD ParameterList UnnamedFunctionAttribute* (SEMICOLON | Block); + // UnnamedFunctionAttributesList = «UnnamedFunctionAttribute»+; + + #[allow(dead_code, non_snake_case)] + fn unnamed_function_attributes_list__0_4_11(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result + .incorporate_one_or_more_result(self.unnamed_function_attribute(stream)) + { + } + running_result + } + .with_kind(RuleKind::UnnamedFunctionAttributesList) + } + + #[allow(non_snake_case)] + pub(crate) fn unnamed_function_attributes_list__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_6_0 { + None + } else { + Some(self.unnamed_function_attributes_list__0_4_11(stream)) + } + } + + #[inline] + pub(crate) fn unnamed_function_attributes_list(&self, stream: &mut Stream) -> ParserResult { + self.unnamed_function_attributes_list__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // (* v0.4.11 *) + // UnnamedFunctionDefinition = FUNCTION_KEYWORD ParametersDeclaration UnnamedFunctionAttributesList? (SEMICOLON | Block); #[allow(dead_code, non_snake_case)] fn unnamed_function_definition__0_4_11(&self, stream: &mut Stream) -> ParserResult { @@ -8023,17 +8278,13 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result(self.parameter_list(stream)) { + if !running_result.incorporate_sequence_result(self.parameters_declaration(stream)) + { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result(self.unnamed_function_attribute(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.unnamed_function_attributes_list(stream), + )) { break; } running_result.incorporate_sequence_result({ @@ -8070,33 +8321,234 @@ impl Language { } else { Some(self.unnamed_function_definition__0_4_11(stream)) } - } - - #[inline] - pub(crate) fn unnamed_function_definition(&self, stream: &mut Stream) -> ParserResult { - self.unnamed_function_definition__sparse_dispatch(stream) - .expect("Validation should have checked that references are valid between versions") + } + + #[inline] + pub(crate) fn unnamed_function_definition(&self, stream: &mut Stream) -> ParserResult { + self.unnamed_function_definition__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // (* v0.8.8 *) + // UserDefinedValueTypeDefinition = TYPE_KEYWORD IDENTIFIER IS_KEYWORD «ElementaryType» SEMICOLON; + + #[allow(dead_code, non_snake_case)] + fn user_defined_value_type_definition__0_8_8(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::type_keyword, + TokenKind::TypeKeyword, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::is_keyword, + TokenKind::IsKeyword, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.elementary_type(stream)); + break; + } + running_result + }) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::semicolon, + TokenKind::Semicolon, + )); + break; + } + running_result + } + .with_kind(RuleKind::UserDefinedValueTypeDefinition) + } + + #[allow(non_snake_case)] + pub(crate) fn user_defined_value_type_definition__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_8_8 { + Some(self.user_defined_value_type_definition__0_8_8(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn user_defined_value_type_definition(&self, stream: &mut Stream) -> ParserResult { + self.user_defined_value_type_definition__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + + // UsingDirective = USING_KEYWORD (UsingDirectivePath | UsingDirectiveDeconstruction) FOR_KEYWORD (ASTERISK | TypeName) GLOBAL_KEYWORD? SEMICOLON; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn using_directive(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::using_keyword, + TokenKind::UsingKeyword, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result + .incorporate_choice_result(self.using_directive_path(stream)) + { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result( + self.using_directive_deconstruction(stream), + ); + break; + } + running_result + }) { + break; + } + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::for_keyword, + TokenKind::ForKeyword, + ), + ) { + break; + } + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result( + self.parse_token_with_trivia( + stream, + &Self::asterisk, + TokenKind::Asterisk, + ), + ) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.type_name(stream)); + break; + } + running_result + }) { + break; + } + running_result.incorporate_sequence_result(transform_option_result( + self.parse_token_with_trivia( + stream, + &Self::global_keyword, + TokenKind::GlobalKeyword, + ), + )); + break; + } + running_result + }) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::semicolon, + TokenKind::Semicolon, + )); + break; + } + running_result + } + .with_kind(RuleKind::UsingDirective) + } + + // UsingDirectiveDeconstruction = OPEN_BRACE UsingDirectiveSymbolsList CLOSE_BRACE; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn using_directive_deconstruction(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::open_brace, + TokenKind::OpenBrace, + )) { + break; + } + if !running_result + .incorporate_sequence_result(self.using_directive_symbols_list(stream)) + { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_brace, + TokenKind::CloseBrace, + )); + break; + } + running_result + } + .with_kind(RuleKind::UsingDirectiveDeconstruction) } // (* v0.8.19 *) - // UserDefinedOperator = AMPERSAND - // | BANG_EQUAL - // | BAR - // | CARET - // | EQUAL_EQUAL - // | GREATER_THAN - // | GREATER_THAN_EQUAL - // | LESS_THAN - // | LESS_THAN_EQUAL - // | MINUS - // | PERCENT - // | PLUS - // | SLASH - // | ASTERISK - // | TILDE; + // «UsingDirectiveOperator» = AMPERSAND + // | ASTERISK + // | BANG_EQUAL + // | BAR + // | CARET + // | EQUAL_EQUAL + // | GREATER_THAN + // | GREATER_THAN_EQUAL + // | LESS_THAN + // | LESS_THAN_EQUAL + // | MINUS + // | PERCENT + // | PLUS + // | SLASH + // | TILDE; #[allow(dead_code, non_snake_case)] - fn user_defined_operator__0_8_19(&self, stream: &mut Stream) -> ParserResult { + fn using_directive_operator__0_8_19(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); @@ -8109,6 +8561,14 @@ impl Language { break; } stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::asterisk, + TokenKind::Asterisk, + )) { + break; + } + stream.set_position(start_position); if running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::bang_equal, @@ -8205,14 +8665,6 @@ impl Language { break; } stream.set_position(start_position); - if running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::asterisk, - TokenKind::Asterisk, - )) { - break; - } - stream.set_position(start_position); running_result.incorporate_choice_result(self.parse_token_with_trivia( stream, &Self::tilde, @@ -8222,398 +8674,223 @@ impl Language { } running_result } - .with_kind(RuleKind::UserDefinedOperator) } #[allow(non_snake_case)] - pub(crate) fn user_defined_operator__sparse_dispatch( + pub(crate) fn using_directive_operator__sparse_dispatch( &self, stream: &mut Stream, ) -> Option { if self.version_is_equal_to_or_greater_than_0_8_19 { - Some(self.user_defined_operator__0_8_19(stream)) + Some(self.using_directive_operator__0_8_19(stream)) } else { None } } #[inline] - pub(crate) fn user_defined_operator(&self, stream: &mut Stream) -> ParserResult { - self.user_defined_operator__sparse_dispatch(stream) + pub(crate) fn using_directive_operator(&self, stream: &mut Stream) -> ParserResult { + self.using_directive_operator__sparse_dispatch(stream) .expect("Validation should have checked that references are valid between versions") } - // (* v0.8.8 *) - // UserDefinedValueTypeDefinition = TYPE_KEYWORD IDENTIFIER IS_KEYWORD ElementaryType SEMICOLON; + // UsingDirectivePath = IdentifierPath; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn using_directive_path(&self, stream: &mut Stream) -> ParserResult { + self.identifier_path(stream) + .with_kind(RuleKind::UsingDirectivePath) + } + + // (* v0.4.11 *) + // UsingDirectiveSymbol = IdentifierPath; #[allow(dead_code, non_snake_case)] - fn user_defined_value_type_definition__0_8_8(&self, stream: &mut Stream) -> ParserResult { + fn using_directive_symbol__0_4_11(&self, stream: &mut Stream) -> ParserResult { + self.identifier_path(stream) + .with_kind(RuleKind::UsingDirectiveSymbol) + } + + // (* v0.8.19 *) + // UsingDirectiveSymbol = IdentifierPath (AS_KEYWORD «UsingDirectiveOperator»)?; + + #[allow(dead_code, non_snake_case)] + fn using_directive_symbol__0_8_19(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result({ + if !running_result.incorporate_sequence_result(self.identifier_path(stream)) { + break; + } + running_result.incorporate_sequence_result(transform_option_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); loop { if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::type_keyword, - TokenKind::TypeKeyword, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::is_keyword, - TokenKind::IsKeyword, + &Self::as_keyword, + TokenKind::AsKeyword, ), ) { break; } - running_result.incorporate_sequence_result(self.elementary_type(stream)); + running_result + .incorporate_sequence_result(self.using_directive_operator(stream)); break; } running_result - }) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::semicolon, - TokenKind::Semicolon, - )); + })); break; } running_result } - .with_kind(RuleKind::UserDefinedValueTypeDefinition) + .with_kind(RuleKind::UsingDirectiveSymbol) } - #[allow(non_snake_case)] - pub(crate) fn user_defined_value_type_definition__sparse_dispatch( - &self, - stream: &mut Stream, - ) -> Option { - if self.version_is_equal_to_or_greater_than_0_8_8 { - Some(self.user_defined_value_type_definition__0_8_8(stream)) + pub(crate) fn using_directive_symbol(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_8_19 { + self.using_directive_symbol__0_8_19(stream) } else { - None + self.using_directive_symbol__0_4_11(stream) } } - #[inline] - pub(crate) fn user_defined_value_type_definition(&self, stream: &mut Stream) -> ParserResult { - self.user_defined_value_type_definition__sparse_dispatch(stream) - .expect("Validation should have checked that references are valid between versions") - } - - // (* v0.4.11 *) - // UsingDirective = USING_KEYWORD (IdentifierPath | (OPEN_BRACE IdentifierPath (COMMA IdentifierPath)* CLOSE_BRACE)) FOR_KEYWORD (ASTERISK | TypeName) GLOBAL_KEYWORD? SEMICOLON; + // UsingDirectiveSymbolsList = UsingDirectiveSymbol (COMMA UsingDirectiveSymbol)*; - #[allow(dead_code, non_snake_case)] - fn using_directive__0_4_11(&self, stream: &mut Stream) -> ParserResult { + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn using_directive_symbols_list(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result({ + if !running_result.incorporate_sequence_result(self.using_directive_symbol(stream)) + { + break; + } + running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::using_keyword, - TokenKind::UsingKeyword, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result - .incorporate_choice_result(self.identifier_path(stream)) - { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_brace, - TokenKind::OpenBrace, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.identifier_path(stream), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match( - vec![], - vec![], - ); - loop { - if !running_result - .incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result - .incorporate_sequence_result( - self.identifier_path( - stream, - ), - ); - break; - } - running_result - }) - { - } - running_result - }); - break; - } - running_result - }) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::close_brace, - TokenKind::CloseBrace, - ), - ); - break; - } - running_result - }); - break; - } - running_result - }) { - break; - } - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::for_keyword, - TokenKind::ForKeyword, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::asterisk, - TokenKind::Asterisk, - ), - ) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.type_name(stream)); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { break; } running_result - }) { + .incorporate_sequence_result(self.using_directive_symbol(stream)); break; } - running_result.incorporate_sequence_result(transform_option_result( - self.parse_token_with_trivia( - stream, - &Self::global_keyword, - TokenKind::GlobalKeyword, - ), - )); - break; - } + running_result + }) {} running_result - }) { - break; - } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::semicolon, - TokenKind::Semicolon, - )); + }); break; } running_result } - .with_kind(RuleKind::UsingDirective) - } - - // (* v0.8.19 *) - // UsingDirective = USING_KEYWORD (IdentifierPath | (OPEN_BRACE IdentifierPath (AS_KEYWORD UserDefinedOperator)? (COMMA IdentifierPath (AS_KEYWORD UserDefinedOperator)?)* CLOSE_BRACE)) FOR_KEYWORD (ASTERISK | TypeName) GLOBAL_KEYWORD? SEMICOLON; - - #[allow(dead_code, non_snake_case)] - fn using_directive__0_8_19(&self, stream: &mut Stream) -> ParserResult { - { let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: using_keyword , TokenKind :: UsingKeyword)) { break ; } if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: no_match (vec ! []) ; let start_position = stream . position () ; loop { if running_result . incorporate_choice_result (self . identifier_path (stream)) { break ; } stream . set_position (start_position) ; running_result . incorporate_choice_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: open_brace , TokenKind :: OpenBrace)) { break ; } if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . identifier_path (stream)) { break ; } running_result . incorporate_sequence_result (transform_option_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: as_keyword , TokenKind :: AsKeyword)) { break ; } running_result . incorporate_sequence_result (self . user_defined_operator (stream)) ; break ; } running_result })) ; break ; } running_result }) { break ; } running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; while running_result . incorporate_zero_or_more_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: comma , TokenKind :: Comma)) { break ; } running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . identifier_path (stream)) { break ; } running_result . incorporate_sequence_result (transform_option_result ({ let mut running_result = ParserResult :: r#match (vec ! [] , vec ! []) ; loop { if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: as_keyword , TokenKind :: AsKeyword)) { break ; } running_result . incorporate_sequence_result (self . user_defined_operator (stream)) ; break ; } running_result })) ; break ; } running_result }) ; break ; } running_result }) { } running_result }) ; break ; } running_result }) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: close_brace , TokenKind :: CloseBrace)) ; break ; } running_result }) ; break ; } running_result }) { break ; } if ! running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: for_keyword , TokenKind :: ForKeyword)) { break ; } if ! running_result . incorporate_sequence_result ({ let mut running_result = ParserResult :: no_match (vec ! []) ; let start_position = stream . position () ; loop { if running_result . incorporate_choice_result (self . parse_token_with_trivia (stream , & Self :: asterisk , TokenKind :: Asterisk)) { break ; } stream . set_position (start_position) ; running_result . incorporate_choice_result (self . type_name (stream)) ; break ; } running_result }) { break ; } running_result . incorporate_sequence_result (transform_option_result (self . parse_token_with_trivia (stream , & Self :: global_keyword , TokenKind :: GlobalKeyword))) ; break ; } running_result }) { break ; } running_result . incorporate_sequence_result (self . parse_token_with_trivia (stream , & Self :: semicolon , TokenKind :: Semicolon)) ; break ; } running_result } . with_kind (RuleKind :: UsingDirective) - } - - pub(crate) fn using_directive(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_8_19 { - self.using_directive__0_8_19(stream) - } else { - self.using_directive__0_4_11(stream) - } + .with_kind(RuleKind::UsingDirectiveSymbolsList) } // (* v0.4.11 *) - // VariableDeclarationStatement = ((TypeName DataLocation?) | VAR_KEYWORD) IDENTIFIER (EQUAL Expression)? SEMICOLON; + // VariableDeclaration = (VAR_KEYWORD | TypeName) «DataLocation»? IDENTIFIER; #[allow(dead_code, non_snake_case)] - fn variable_declaration_statement__0_4_11(&self, stream: &mut Stream) -> ParserResult { + fn variable_declaration__0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result(self.type_name(stream)) - { - break; - } - running_result.incorporate_sequence_result( - transform_option_result(self.data_location(stream)), - ); - break; - } - running_result - }) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::var_keyword, - TokenKind::VarKeyword, - ), - ); - break; - } - running_result - }) { - break; - } - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ) { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::var_keyword, + TokenKind::VarKeyword, + )) { break; } - running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::equal, - TokenKind::Equal, - ), - ) { - break; - } - running_result.incorporate_sequence_result(self.expression(stream)); - break; - } - running_result - })); + stream.set_position(start_position); + running_result.incorporate_choice_result(self.type_name(stream)); break; } running_result }) { break; } + if !running_result.incorporate_sequence_result(transform_option_result( + self.data_location(stream), + )) { + break; + } running_result.incorporate_sequence_result(self.parse_token_with_trivia( stream, - &Self::semicolon, - TokenKind::Semicolon, + &Self::identifier, + TokenKind::Identifier, )); break; } running_result } - .with_kind(RuleKind::VariableDeclarationStatement) + .with_kind(RuleKind::VariableDeclaration) } // (* v0.5.0 *) - // VariableDeclarationStatement = TypeName DataLocation? IDENTIFIER (EQUAL Expression)? SEMICOLON; + // VariableDeclaration = TypeName «DataLocation»? IDENTIFIER; #[allow(dead_code, non_snake_case)] - fn variable_declaration_statement__0_5_0(&self, stream: &mut Stream) -> ParserResult { + fn variable_declaration__0_5_0(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.type_name(stream)) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.data_location(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::identifier, + TokenKind::Identifier, + )); + break; + } + running_result + } + .with_kind(RuleKind::VariableDeclaration) + } + + pub(crate) fn variable_declaration(&self, stream: &mut Stream) -> ParserResult { + if self.version_is_equal_to_or_greater_than_0_5_0 { + self.variable_declaration__0_5_0(stream) + } else { + self.variable_declaration__0_4_11(stream) + } + } + + // VariableDeclarationStatement = VariableDeclaration (EQUAL Expression)? SEMICOLON; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn variable_declaration_statement(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { if !running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result(self.type_name(stream)) { - break; - } - if !running_result.incorporate_sequence_result(transform_option_result( - self.data_location(stream), - )) { - break; - } - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::identifier, - TokenKind::Identifier, - ), - ) { + if !running_result + .incorporate_sequence_result(self.variable_declaration(stream)) + { break; } running_result.incorporate_sequence_result(transform_option_result({ @@ -8651,16 +8928,7 @@ impl Language { .with_kind(RuleKind::VariableDeclarationStatement) } - pub(crate) fn variable_declaration_statement(&self, stream: &mut Stream) -> ParserResult { - if self.version_is_equal_to_or_greater_than_0_5_0 { - self.variable_declaration_statement__0_5_0(stream) - } else { - self.variable_declaration_statement__0_4_11(stream) - } - } - - // VersionPragma = SOLIDITY_KEYWORD VersionPragmaExpressionList; - // VersionPragmaExpressionList = «VersionPragmaExpression»+; + // VersionPragma = SOLIDITY_KEYWORD VersionPragmaExpressionsList; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -8675,14 +8943,8 @@ impl Language { )) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result - .incorporate_one_or_more_result(self.version_pragma_expression(stream)) - { - } - running_result.with_kind(RuleKind::VersionPragmaExpressionList) - }); + running_result + .incorporate_sequence_result(self.version_pragma_expressions_list(stream)); break; } running_result @@ -8690,13 +8952,12 @@ impl Language { .with_kind(RuleKind::VersionPragma) } - // «VersionPragmaExpression» = VersionPragmaAlternatives - // | VersionPragmaRange - // | VersionPragmaComparator - // | VersionPragmaSpecifier; - // VersionPragmaAlternatives = «VersionPragmaExpression» BAR_BAR «VersionPragmaExpression»; - // VersionPragmaRange = «VersionPragmaExpression» MINUS «VersionPragmaExpression»; - // VersionPragmaComparator = (CARET | TILDE | EQUAL | LESS_THAN | GREATER_THAN | LESS_THAN_EQUAL | GREATER_THAN_EQUAL) «VersionPragmaExpression»; + // VersionPragmaExpression = VersionPragmaBinaryExpression + // | VersionPragmaUnaryExpression + // | VersionPragmaSpecifier; + // VersionPragmaBinaryExpression = VersionPragmaExpression «VersionPragmaOrOperator» VersionPragmaExpression; + // VersionPragmaBinaryExpression = VersionPragmaExpression «VersionPragmaRangeOperator» VersionPragmaExpression; + // VersionPragmaUnaryExpression = «VersionPragmaUnaryOperator» VersionPragmaExpression; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -8705,84 +8966,13 @@ impl Language { let mut elements: Vec = Vec::new(); let result = loop { let result = loop { - let result = { - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::caret, - TokenKind::Caret, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::tilde, - TokenKind::Tilde, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::equal, - TokenKind::Equal, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::less_than, - TokenKind::LessThan, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::greater_than, - TokenKind::GreaterThan, - ), - ) { - break; - } - stream.set_position(start_position); - if running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::less_than_equal, - TokenKind::LessThanEqual, - ), - ) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result(self.parse_token_with_trivia( - stream, - &Self::greater_than_equal, - TokenKind::GreaterThanEqual, - )); - break; - } - running_result - } - .to_pratt_element_operator( - RuleKind::VersionPragmaComparator, - 255, - 5u8, - ); + let result = self + .version_pragma_unary_operator(stream) + .to_pratt_element_operator( + RuleKind::VersionPragmaUnaryExpression, + 255, + 5u8, + ); match result { ParserResult::PrattOperatorMatch(_) => elements.push(result), _ => break result, @@ -8806,9 +8996,9 @@ impl Language { let start_position = stream.position(); stream.set_position(start_position); let next_result = self - .parse_token_with_trivia(stream, &Self::bar_bar, TokenKind::BarBar) + .version_pragma_or_operator(stream) .to_pratt_element_operator( - RuleKind::VersionPragmaAlternatives, + RuleKind::VersionPragmaBinaryExpression, 1u8, 1u8 + 1, ); @@ -8821,8 +9011,12 @@ impl Language { } stream.set_position(start_position); let next_result = self - .parse_token_with_trivia(stream, &Self::minus, TokenKind::Minus) - .to_pratt_element_operator(RuleKind::VersionPragmaRange, 3u8, 3u8 + 1); + .version_pragma_range_operator(stream) + .to_pratt_element_operator( + RuleKind::VersionPragmaBinaryExpression, + 3u8, + 3u8 + 1, + ); match next_result { ParserResult::PrattOperatorMatch(_) => break next_result, ParserResult::Match(_) => unreachable!( @@ -8841,7 +9035,10 @@ impl Language { if elements.is_empty() { break result; } - reduce_pratt_elements(|children| children, &mut elements); + reduce_pratt_elements( + |children| vec![cst::Node::rule(RuleKind::VersionPragmaExpression, children)], + &mut elements, + ); if elements.len() != 1 { unreachable!( "Pratt parser failed to reduce to a single result: {:?}", @@ -8861,6 +9058,39 @@ impl Language { unreachable!("Pratt parser failed to reduce to a single match") } } + .with_kind(RuleKind::VersionPragmaExpression) + } + + // VersionPragmaExpressionsList = VersionPragmaExpression+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn version_pragma_expressions_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result + .incorporate_one_or_more_result(self.version_pragma_expression(stream)) + { + } + running_result + } + .with_kind(RuleKind::VersionPragmaExpressionsList) + } + + // «VersionPragmaOrOperator» = BAR_BAR; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn version_pragma_or_operator(&self, stream: &mut Stream) -> ParserResult { + self.parse_token_with_trivia(stream, &Self::bar_bar, TokenKind::BarBar) + } + + // «VersionPragmaRangeOperator» = MINUS; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn version_pragma_range_operator(&self, stream: &mut Stream) -> ParserResult { + self.parse_token_with_trivia(stream, &Self::minus, TokenKind::Minus) } // VersionPragmaSpecifier = VERSION_PRAGMA_VALUE (PERIOD VERSION_PRAGMA_VALUE)*; @@ -8878,38 +9108,112 @@ impl Language { )) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::period, - TokenKind::Period, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::version_pragma_value, - TokenKind::VersionPragmaValue, - ), - ); - break; - } - running_result - }) {} - running_result - }); + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::period, + TokenKind::Period, + ), + ) { + break; + } + running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::version_pragma_value, + TokenKind::VersionPragmaValue, + ), + ); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::VersionPragmaSpecifier) + } + + // «VersionPragmaUnaryOperator» = CARET + // | TILDE + // | EQUAL + // | LESS_THAN + // | GREATER_THAN + // | LESS_THAN_EQUAL + // | GREATER_THAN_EQUAL; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn version_pragma_unary_operator(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::caret, + TokenKind::Caret, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::tilde, + TokenKind::Tilde, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::equal, + TokenKind::Equal, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::less_than, + TokenKind::LessThan, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::greater_than, + TokenKind::GreaterThan, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::less_than_equal, + TokenKind::LessThanEqual, + )) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::greater_than_equal, + TokenKind::GreaterThanEqual, + )); break; } running_result } - .with_kind(RuleKind::VersionPragmaSpecifier) } // WhileStatement = WHILE_KEYWORD OPEN_PAREN Expression CLOSE_PAREN Statement; @@ -8961,7 +9265,7 @@ impl Language { .with_kind(RuleKind::WhileStatement) } - // YulAssignmentStatement = YulIdentifierPath (COMMA YulIdentifierPath)* COLON_EQUAL YulExpression; + // YulAssignmentStatement = YulIdentifierPathsList COLON_EQUAL YulExpression; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -8969,41 +9273,9 @@ impl Language { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result(self.yul_identifier_path(stream)) - { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.yul_identifier_path(stream), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - }) { + if !running_result + .incorporate_sequence_result(self.yul_identifier_paths_list(stream)) + { break; } if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -9021,7 +9293,7 @@ impl Language { .with_kind(RuleKind::YulAssignmentStatement) } - // YulBlock = OPEN_BRACE YulStatement* CLOSE_BRACE; + // YulBlock = OPEN_BRACE YulStatementsList? CLOSE_BRACE; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -9036,13 +9308,9 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result(self.yul_statement(stream)) - { - } - running_result - }) { + if !running_result.incorporate_sequence_result(transform_option_result( + self.yul_statements_list(stream), + )) { break; } running_result.incorporate_sequence_result(self.parse_token_with_trivia( @@ -9075,7 +9343,7 @@ impl Language { .with_kind(RuleKind::YulContinueStatement) } - // YulDeclarationStatement = LET_KEYWORD YulIdentifierPath (COMMA YulIdentifierPath)* (COLON_EQUAL YulExpression)?; + // YulDeclarationStatement = LET_KEYWORD YulIdentifierPathsList (COLON_EQUAL YulExpression)?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -9090,41 +9358,9 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result - .incorporate_sequence_result(self.yul_identifier_path(stream)) - { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.yul_identifier_path(stream), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - }) { + if !running_result + .incorporate_sequence_result(self.yul_identifier_paths_list(stream)) + { break; } running_result.incorporate_sequence_result(transform_option_result({ @@ -9151,8 +9387,8 @@ impl Language { .with_kind(RuleKind::YulDeclarationStatement) } - // YulExpression = YulFunctionCallExpression | YulLiteral | YulIdentifierPath; - // YulFunctionCallExpression = YulExpression OPEN_PAREN (YulExpression (COMMA YulExpression)*)? CLOSE_PAREN; + // YulExpression = YulFunctionCallExpression | «YulLiteral» | YulIdentifierPath; + // YulFunctionCallExpression = YulExpression «YulFunctionCallOperator»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -9182,75 +9418,9 @@ impl Language { } } let result = loop { - let result = { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_paren, - TokenKind::OpenParen, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result(transform_option_result( - { - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.yul_expression(stream), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.yul_expression(stream), - ); - break; - } - running_result - }) {} - running_result - }); - break; - } - running_result - }, - )) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::close_paren, - TokenKind::CloseParen, - ), - ); - break; - } - running_result - } - .to_pratt_element_operator( - RuleKind::YulFunctionCallExpression, - 1u8, - 255, - ); + let result = self + .yul_function_call_operator(stream) + .to_pratt_element_operator(RuleKind::YulFunctionCallExpression, 1u8, 255); match result { ParserResult::PrattOperatorMatch(_) => elements.push(result), _ => break result, @@ -9293,6 +9463,45 @@ impl Language { .with_kind(RuleKind::YulExpression) } + // YulExpressionsList = YulExpression (COMMA YulExpression)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_expressions_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.yul_expression(stream)) { + break; + } + running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { + break; + } + running_result.incorporate_sequence_result(self.yul_expression(stream)); + break; + } + running_result + }) {} + running_result + }); + break; + } + running_result + } + .with_kind(RuleKind::YulExpressionsList) + } + // YulForStatement = FOR_KEYWORD YulBlock YulExpression YulBlock YulBlock; #[allow(dead_code)] @@ -9325,9 +9534,38 @@ impl Language { .with_kind(RuleKind::YulForStatement) } - // YulFunctionDefinition = FUNCTION_KEYWORD YUL_IDENTIFIER OPEN_PAREN Arguments? CLOSE_PAREN (MINUS_GREATER_THAN Results)? YulBlock; - // Arguments = YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*; - // Results = YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*; + // «YulFunctionCallOperator» = OPEN_PAREN YulExpressionsList? CLOSE_PAREN; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_function_call_operator(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::open_paren, + TokenKind::OpenParen, + )) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.yul_expressions_list(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_paren, + TokenKind::CloseParen, + )); + break; + } + running_result + } + } + + // YulFunctionDefinition = FUNCTION_KEYWORD YUL_IDENTIFIER YulParametersDeclaration YulReturnsDeclaration? YulBlock; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -9349,150 +9587,118 @@ impl Language { )) { break; } - if !running_result.incorporate_sequence_result({ + if !running_result + .incorporate_sequence_result(self.yul_parameters_declaration(stream)) + { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.yul_returns_declaration(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.yul_block(stream)); + break; + } + running_result + } + .with_kind(RuleKind::YulFunctionDefinition) + } + + // YulIdentifierPath = YUL_IDENTIFIER (PERIOD YUL_IDENTIFIER)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_identifier_path(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::yul_identifier, + TokenKind::YulIdentifier, + )) { + break; + } + running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::open_paren, - TokenKind::OpenParen, - ), - ) { - break; - } - if !running_result.incorporate_sequence_result(transform_option_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::yul_identifier, - TokenKind::YulIdentifier, - ), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::yul_identifier, - TokenKind::YulIdentifier, - ), - ); - break; - } - running_result - }) {} - running_result - }); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::period, + TokenKind::Period, + ), + ) { break; } - running_result.with_kind(RuleKind::Arguments) - })) { + running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::yul_identifier, + TokenKind::YulIdentifier, + ), + ); break; } - running_result.incorporate_sequence_result(self.parse_token_with_trivia( - stream, - &Self::close_paren, - TokenKind::CloseParen, - )); - break; - } + running_result + }) {} running_result - }) { + }); + break; + } + running_result + } + .with_kind(RuleKind::YulIdentifierPath) + } + + // YulIdentifierPathsList = YulIdentifierPath (COMMA YulIdentifierPath)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_identifier_paths_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.yul_identifier_path(stream)) { break; } - if !running_result.incorporate_sequence_result(transform_option_result({ + running_result.incorporate_sequence_result({ let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::minus_greater_than, - TokenKind::MinusGreaterThan, - ), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::yul_identifier, - TokenKind::YulIdentifier, - ), - ) { - break; - } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_zero_or_more_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::comma, - TokenKind::Comma, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::yul_identifier, - TokenKind::YulIdentifier, - ), - ); - break; - } - running_result - }) {} - running_result - }); + while running_result.incorporate_zero_or_more_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::comma, + TokenKind::Comma, + ), + ) { break; } - running_result.with_kind(RuleKind::Results) - }); - break; - } + running_result + .incorporate_sequence_result(self.yul_identifier_path(stream)); + break; + } + running_result + }) {} running_result - })) { - break; - } - running_result.incorporate_sequence_result(self.yul_block(stream)); + }); break; } running_result } - .with_kind(RuleKind::YulFunctionDefinition) + .with_kind(RuleKind::YulIdentifierPathsList) } - // YulIdentifierPath = YUL_IDENTIFIER (PERIOD YUL_IDENTIFIER)*; + // YulIdentifiersList = YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn yul_identifier_path(&self, stream: &mut Stream) -> ParserResult { + pub(crate) fn yul_identifiers_list(&self, stream: &mut Stream) -> ParserResult { { let mut running_result = ParserResult::r#match(vec![], vec![]); loop { @@ -9511,8 +9717,8 @@ impl Language { if !running_result.incorporate_sequence_result( self.parse_token_with_trivia( stream, - &Self::period, - TokenKind::Period, + &Self::comma, + TokenKind::Comma, ), ) { break; @@ -9534,7 +9740,7 @@ impl Language { } running_result } - .with_kind(RuleKind::YulIdentifierPath) + .with_kind(RuleKind::YulIdentifiersList) } // YulIfStatement = IF_KEYWORD YulExpression YulBlock; @@ -9590,11 +9796,12 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // YulLiteral = BooleanLiteral - // | YUL_HEX_LITERAL - // | YUL_DECIMAL_LITERAL - // | HEX_STRING_LITERAL - // | ASCII_STRING_LITERAL; + // «YulLiteral» = TRUE_KEYWORD + // | FALSE_KEYWORD + // | YUL_HEX_LITERAL + // | YUL_DECIMAL_LITERAL + // | HEX_STRING_LITERAL + // | ASCII_STRING_LITERAL; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -9603,7 +9810,19 @@ impl Language { let mut running_result = ParserResult::no_match(vec![]); let start_position = stream.position(); loop { - if running_result.incorporate_choice_result(self.boolean_literal(stream)) { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::true_keyword, + TokenKind::TrueKeyword, + )) { + break; + } + stream.set_position(start_position); + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::false_keyword, + TokenKind::FalseKeyword, + )) { break; } stream.set_position(start_position); @@ -9640,7 +9859,61 @@ impl Language { } running_result } - .with_kind(RuleKind::YulLiteral) + } + + // YulParametersDeclaration = OPEN_PAREN YulIdentifiersList? CLOSE_PAREN; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_parameters_declaration(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::open_paren, + TokenKind::OpenParen, + )) { + break; + } + if !running_result.incorporate_sequence_result(transform_option_result( + self.yul_identifiers_list(stream), + )) { + break; + } + running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::close_paren, + TokenKind::CloseParen, + )); + break; + } + running_result + } + .with_kind(RuleKind::YulParametersDeclaration) + } + + // YulReturnsDeclaration = MINUS_GREATER_THAN YulIdentifiersList; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_returns_declaration(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result(self.parse_token_with_trivia( + stream, + &Self::minus_greater_than, + TokenKind::MinusGreaterThan, + )) { + break; + } + running_result.incorporate_sequence_result(self.yul_identifiers_list(stream)); + break; + } + running_result + } + .with_kind(RuleKind::YulReturnsDeclaration) } // (* v0.4.11 *) @@ -9782,7 +10055,85 @@ impl Language { } } - // YulSwitchStatement = SWITCH_KEYWORD YulExpression (((CASE_KEYWORD YulLiteral) | DEFAULT_KEYWORD) YulBlock)+; + // YulStatementsList = YulStatement+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_statements_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.yul_statement(stream)) {} + running_result + } + .with_kind(RuleKind::YulStatementsList) + } + + // YulSwitchCase = (DEFAULT_KEYWORD | (CASE_KEYWORD «YulLiteral»)) YulBlock; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_switch_case(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result({ + let mut running_result = ParserResult::no_match(vec![]); + let start_position = stream.position(); + loop { + if running_result.incorporate_choice_result(self.parse_token_with_trivia( + stream, + &Self::default_keyword, + TokenKind::DefaultKeyword, + )) { + break; + } + stream.set_position(start_position); + running_result.incorporate_choice_result({ + let mut running_result = ParserResult::r#match(vec![], vec![]); + loop { + if !running_result.incorporate_sequence_result( + self.parse_token_with_trivia( + stream, + &Self::case_keyword, + TokenKind::CaseKeyword, + ), + ) { + break; + } + running_result + .incorporate_sequence_result(self.yul_literal(stream)); + break; + } + running_result + }); + break; + } + running_result + }) { + break; + } + running_result.incorporate_sequence_result(self.yul_block(stream)); + break; + } + running_result + } + .with_kind(RuleKind::YulSwitchCase) + } + + // YulSwitchCasesList = YulSwitchCase+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn yul_switch_cases_list(&self, stream: &mut Stream) -> ParserResult { + { + let mut running_result = ParserResult::r#match(vec![], vec![]); + while running_result.incorporate_one_or_more_result(self.yul_switch_case(stream)) {} + running_result + } + .with_kind(RuleKind::YulSwitchCasesList) + } + + // YulSwitchStatement = SWITCH_KEYWORD YulExpression YulSwitchCasesList; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -9800,58 +10151,7 @@ impl Language { if !running_result.incorporate_sequence_result(self.yul_expression(stream)) { break; } - running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - while running_result.incorporate_one_or_more_result({ - let mut running_result = ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result({ - let mut running_result = ParserResult::no_match(vec![]); - let start_position = stream.position(); - loop { - if running_result.incorporate_choice_result({ - let mut running_result = - ParserResult::r#match(vec![], vec![]); - loop { - if !running_result.incorporate_sequence_result( - self.parse_token_with_trivia( - stream, - &Self::case_keyword, - TokenKind::CaseKeyword, - ), - ) { - break; - } - running_result.incorporate_sequence_result( - self.yul_literal(stream), - ); - break; - } - running_result - }) { - break; - } - stream.set_position(start_position); - running_result.incorporate_choice_result( - self.parse_token_with_trivia( - stream, - &Self::default_keyword, - TokenKind::DefaultKeyword, - ), - ); - break; - } - running_result - }) { - break; - } - running_result.incorporate_sequence_result(self.yul_block(stream)); - break; - } - running_result - }) {} - running_result - }); + running_result.incorporate_sequence_result(self.yul_switch_cases_list(stream)); break; } running_result diff --git a/crates/solidity/outputs/npm/crate/src/generated/scanners.rs b/crates/solidity/outputs/npm/crate/src/generated/scanners.rs index 557899db71..df72dfa83c 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/scanners.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/scanners.rs @@ -127,14 +127,14 @@ impl Language { ) } - // ASCII_ESCAPE = "n" - // | "r" - // | "t" - // | "'" - // | '"' - // | "\\" - // | "\n" - // | "\r"; + // «ASCII_ESCAPE» = "n" + // | "r" + // | "t" + // | "'" + // | '"' + // | "\\" + // | "\n" + // | "\r"; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -149,15 +149,23 @@ impl Language { || c == 't') } - // ASCII_STRING_LITERAL = SINGLE_QUOTED_ASCII_STRING_LITERAL | DOUBLE_QUOTED_ASCII_STRING_LITERAL; + // ASCII_STRING_LITERAL = «SINGLE_QUOTED_ASCII_STRING_LITERAL» | «DOUBLE_QUOTED_ASCII_STRING_LITERAL»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn ascii_string_literal(&self, stream: &mut Stream) -> bool { - scan_choice!( + scan_not_followed_by!( stream, - self.single_quoted_ascii_string_literal(stream), - self.double_quoted_ascii_string_literal(stream) + scan_choice!( + stream, + self.single_quoted_ascii_string_literal(stream), + self.double_quoted_ascii_string_literal(stream) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } @@ -282,10 +290,10 @@ impl Language { } // (* v0.4.11 *) - // BYTE_TYPE = "byte"; + // BYTE_KEYWORD = "byte"; #[allow(dead_code, non_snake_case)] - fn byte_type__0_4_11(&self, stream: &mut Stream) -> bool { + fn byte_keyword__0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, scan_chars!(stream, 'b', 'y', 't', 'e'), @@ -298,17 +306,17 @@ impl Language { } #[allow(non_snake_case)] - pub(crate) fn byte_type__sparse_dispatch(&self, stream: &mut Stream) -> Option { + pub(crate) fn byte_keyword__sparse_dispatch(&self, stream: &mut Stream) -> Option { if self.version_is_equal_to_or_greater_than_0_8_0 { None } else { - Some(self.byte_type__0_4_11(stream)) + Some(self.byte_keyword__0_4_11(stream)) } } #[inline] - pub(crate) fn byte_type(&self, stream: &mut Stream) -> bool { - self.byte_type__sparse_dispatch(stream) + pub(crate) fn byte_keyword(&self, stream: &mut Stream) -> bool { + self.byte_keyword__sparse_dispatch(stream) .expect("Validation should have checked that references are valid between versions") } @@ -549,7 +557,24 @@ impl Language { ) } - // DECIMAL_EXPONENT = ("e" | "E") "-"? DECIMAL_NUMBER; + // «DECIMAL_DIGITS» = "0"…"9"+ ("_" "0"…"9"+)*; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn decimal_digits(&self, stream: &mut Stream) -> bool { + scan_sequence!( + scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))), + scan_zero_or_more!( + stream, + scan_sequence!( + scan_chars!(stream, '_'), + scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))) + ) + ) + ) + } + + // «DECIMAL_EXPONENT» = ("e" | "E") "-"? «DECIMAL_DIGITS»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -557,52 +582,68 @@ impl Language { scan_sequence!( scan_predicate!(stream, |c| c == 'E' || c == 'e'), scan_optional!(stream, scan_chars!(stream, '-')), - self.decimal_number(stream) + self.decimal_digits(stream) ) } // (* v0.4.11 *) - // DECIMAL_LITERAL = ((DECIMAL_NUMBER ("." DECIMAL_NUMBER?)?) | ("." DECIMAL_NUMBER)) DECIMAL_EXPONENT?; + // DECIMAL_LITERAL = ((«DECIMAL_DIGITS» ("." «DECIMAL_DIGITS»?)?) | ("." «DECIMAL_DIGITS»)) «DECIMAL_EXPONENT»?; #[allow(dead_code, non_snake_case)] fn decimal_literal__0_4_11(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_choice!( - stream, - scan_sequence!( - self.decimal_number(stream), - scan_optional!( - stream, - scan_sequence!( - scan_chars!(stream, '.'), - scan_optional!(stream, self.decimal_number(stream)) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_choice!( + stream, + scan_sequence!( + self.decimal_digits(stream), + scan_optional!( + stream, + scan_sequence!( + scan_chars!(stream, '.'), + scan_optional!(stream, self.decimal_digits(stream)) + ) ) - ) + ), + scan_sequence!(scan_chars!(stream, '.'), self.decimal_digits(stream)) ), - scan_sequence!(scan_chars!(stream, '.'), self.decimal_number(stream)) + scan_optional!(stream, self.decimal_exponent(stream)) ), - scan_optional!(stream, self.decimal_exponent(stream)) + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } // (* v0.5.0 *) - // DECIMAL_LITERAL = ((DECIMAL_NUMBER ("." DECIMAL_NUMBER)?) | ("." DECIMAL_NUMBER)) DECIMAL_EXPONENT?; + // DECIMAL_LITERAL = ((«DECIMAL_DIGITS» ("." «DECIMAL_DIGITS»)?) | ("." «DECIMAL_DIGITS»)) «DECIMAL_EXPONENT»?; #[allow(dead_code, non_snake_case)] fn decimal_literal__0_5_0(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_choice!( - stream, - scan_sequence!( - self.decimal_number(stream), - scan_optional!( - stream, - scan_sequence!(scan_chars!(stream, '.'), self.decimal_number(stream)) - ) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_choice!( + stream, + scan_sequence!( + self.decimal_digits(stream), + scan_optional!( + stream, + scan_sequence!(scan_chars!(stream, '.'), self.decimal_digits(stream)) + ) + ), + scan_sequence!(scan_chars!(stream, '.'), self.decimal_digits(stream)) ), - scan_sequence!(scan_chars!(stream, '.'), self.decimal_number(stream)) + scan_optional!(stream, self.decimal_exponent(stream)) ), - scan_optional!(stream, self.decimal_exponent(stream)) + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } @@ -614,23 +655,6 @@ impl Language { } } - // DECIMAL_NUMBER = "0"…"9"+ ("_" "0"…"9"+)*; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn decimal_number(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))), - scan_zero_or_more!( - stream, - scan_sequence!( - scan_chars!(stream, '_'), - scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))) - ) - ) - ) - } - // DEFAULT_KEYWORD = "default"; #[allow(dead_code)] @@ -679,7 +703,7 @@ impl Language { ) } - // DOUBLE_QUOTED_ASCII_STRING_LITERAL = '"' (ESCAPE_SEQUENCE | (" "…"~" - ('"' | "\\")))* '"'; + // «DOUBLE_QUOTED_ASCII_STRING_LITERAL» = '"' («ESCAPE_SEQUENCE» | (" "…"~" - ('"' | "\\")))* '"'; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -700,8 +724,21 @@ impl Language { ) } + // «DOUBLE_QUOTED_HEX_STRING_LITERAL» = "hex" '"' «HEX_STRING_CONTENTS»? '"'; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn double_quoted_hex_string_literal(&self, stream: &mut Stream) -> bool { + scan_sequence!( + scan_chars!(stream, 'h', 'e', 'x'), + scan_chars!(stream, '"'), + scan_optional!(stream, self.hex_string_contents(stream)), + scan_chars!(stream, '"') + ) + } + // (* v0.7.0 *) - // DOUBLE_QUOTED_UNICODE_STRING_LITERAL = 'unicode"' (ESCAPE_SEQUENCE | !('"' | "\\" | "\n" | "\r"))* '"'; + // «DOUBLE_QUOTED_UNICODE_STRING_LITERAL» = 'unicode"' («ESCAPE_SEQUENCE» | !('"' | "\\" | "\n" | "\r"))* '"'; #[allow(dead_code, non_snake_case)] fn double_quoted_unicode_string_literal__0_7_0(&self, stream: &mut Stream) -> bool { @@ -855,7 +892,7 @@ impl Language { ) } - // ESCAPE_SEQUENCE = "\\" (ASCII_ESCAPE | HEX_BYTE_ESCAPE | UNICODE_ESCAPE); + // «ESCAPE_SEQUENCE» = "\\" («ASCII_ESCAPE» | «HEX_BYTE_ESCAPE» | «UNICODE_ESCAPE»); #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -903,14 +940,6 @@ impl Language { ) } - // EVMASM = '"evmasm"'; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn evmasm(&self, stream: &mut Stream) -> bool { - scan_chars!(stream, '"', 'e', 'v', 'm', 'a', 's', 'm', '"') - } - // EXPERIMENTAL_KEYWORD = "experimental"; #[allow(dead_code)] @@ -1006,7 +1035,7 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // FIXED_BYTES_TYPE = "bytes" ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" | "18" | "19" | "20" | "21" | "22" | "23" | "24" | "25" | "26" | "27" | "28" | "29" | "30" | "31" | "32"); + // FIXED_BYTES_TYPE = "bytes" «FIXED_BYTES_TYPE_SIZE»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -1039,6 +1068,71 @@ impl Language { ) } + // «FIXED_BYTES_TYPE_SIZE» = "1" + // | "2" + // | "3" + // | "4" + // | "5" + // | "6" + // | "7" + // | "8" + // | "9" + // | "10" + // | "11" + // | "12" + // | "13" + // | "14" + // | "15" + // | "16" + // | "17" + // | "18" + // | "19" + // | "20" + // | "21" + // | "22" + // | "23" + // | "24" + // | "25" + // | "26" + // | "27" + // | "28" + // | "29" + // | "30" + // | "31" + // | "32"; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn fixed_bytes_type_size(&self, stream: &mut Stream) -> bool { + scan_trie!( + stream, + ['4' | '5' | '6' | '7' | '8' | '9'], + '1' + scan_trie!( + stream, + EMPTY, + ['0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'] + ), + '2' + scan_trie!( + stream, + EMPTY, + ['0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'] + ), + '3' + scan_trie!(stream, EMPTY, ['0' | '1' | '2']) + ) + } + + // «FIXED_TYPE_SIZE» = "0"…"9"+ "x" "0"…"9"+; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn fixed_type_size(&self, stream: &mut Stream) -> bool { + scan_sequence!( + scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))), + scan_chars!(stream, 'x'), + scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))) + ) + } + // FOR_KEYWORD = "for"; #[allow(dead_code)] @@ -1194,7 +1288,7 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // HEX_BYTE_ESCAPE = "x" «HEX_CHARACTER» «HEX_CHARACTER»; + // «HEX_BYTE_ESCAPE» = "x" «HEX_CHARACTER» «HEX_CHARACTER»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -1221,31 +1315,38 @@ impl Language { } // (* v0.4.11 *) - // HEX_LITERAL = "0" ("x" | "X") «HEX_CHARACTER»+ ("_" «HEX_CHARACTER»+)*; + // HEX_LITERAL = ("0x" | "0X") «HEX_CHARACTER»+ ("_" «HEX_CHARACTER»+)*; #[allow(dead_code, non_snake_case)] fn hex_literal__0_4_11(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_chars!(stream, '0'), - scan_predicate!(stream, |c| c == 'X' || c == 'x'), - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')) - ), - scan_zero_or_more!( - stream, - scan_sequence!( - scan_chars!(stream, '_'), - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_sequence!(scan_chars!(stream, '0'), scan_trie!(stream, ['X' | 'x'])), + scan_one_or_more!( + stream, + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')) + ), + scan_zero_or_more!( + stream, + scan_sequence!( + scan_chars!(stream, '_'), + scan_one_or_more!( + stream, + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')) + ) ) ) - ) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } @@ -1254,26 +1355,34 @@ impl Language { #[allow(dead_code, non_snake_case)] fn hex_literal__0_5_0(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_chars!(stream, '0', 'x'), - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')) - ), - scan_zero_or_more!( - stream, - scan_sequence!( - scan_chars!(stream, '_'), - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_chars!(stream, '0', 'x'), + scan_one_or_more!( + stream, + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')) + ), + scan_zero_or_more!( + stream, + scan_sequence!( + scan_chars!(stream, '_'), + scan_one_or_more!( + stream, + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')) + ) ) ) - ) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } @@ -1285,29 +1394,53 @@ impl Language { } } - // HEX_STRING_LITERAL = "hex" (('"' POSSIBLY_SEPARATED_PAIRS_OF_HEX_DIGITS? '"') | ("'" POSSIBLY_SEPARATED_PAIRS_OF_HEX_DIGITS? "'")); + // «HEX_STRING_CONTENTS» = «HEX_CHARACTER» «HEX_CHARACTER» ("_"? «HEX_CHARACTER» «HEX_CHARACTER»)*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn hex_string_literal(&self, stream: &mut Stream) -> bool { + pub(crate) fn hex_string_contents(&self, stream: &mut Stream) -> bool { scan_sequence!( - scan_chars!(stream, 'h', 'e', 'x'), - scan_choice!( + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')), + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')), + scan_zero_or_more!( stream, scan_sequence!( - scan_chars!(stream, '"'), - scan_optional!(stream, self.possibly_separated_pairs_of_hex_digits(stream)), - scan_chars!(stream, '"') - ), - scan_sequence!( - scan_chars!(stream, '\''), - scan_optional!(stream, self.possibly_separated_pairs_of_hex_digits(stream)), - scan_chars!(stream, '\'') + scan_optional!(stream, scan_chars!(stream, '_')), + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')), + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')) ) ) ) } + // HEX_STRING_LITERAL = «SINGLE_QUOTED_HEX_STRING_LITERAL» | «DOUBLE_QUOTED_HEX_STRING_LITERAL»; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn hex_string_literal(&self, stream: &mut Stream) -> bool { + scan_not_followed_by!( + stream, + scan_choice!( + stream, + self.single_quoted_hex_string_literal(stream), + self.double_quoted_hex_string_literal(stream) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) + ) + } + // HOURS_KEYWORD = "hours"; #[allow(dead_code)] @@ -1324,200 +1457,134 @@ impl Language { ) } - // IDENTIFIER = RAW_IDENTIFIER - (NOT_AN_IDENTIFIER_IN_ANY_VERSION | NOT_AN_IDENTIFIER_IN_SOME_VERSIONS | FIXED_BYTES_TYPE | SIGNED_FIXED_TYPE | UNSIGNED_FIXED_TYPE | SIGNED_INTEGER_TYPE | UNSIGNED_INTEGER_TYPE); + // (* v0.4.11 *) + // IDENTIFIER = «RAW_IDENTIFIER» - («KEYWORD_IN_ANY_VERSION» | «KEYWORD_IN_SOME_VERSION» | «RESERVED_WORD_IN_ANY_VERSION»); - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn identifier(&self, stream: &mut Stream) -> bool { + #[allow(dead_code, non_snake_case)] + fn identifier__0_4_11(&self, stream: &mut Stream) -> bool { scan_difference!( stream, self.raw_identifier(stream), scan_choice!( stream, + self.keyword_in_any_version(stream), + self.keyword_in_some_version(stream), scan_trie!( stream, 'a' + scan_trie!( stream, 'b' + scan_chars!(stream, 's', 't', 'r', 'a', 'c', 't'), - 'd' + scan_chars!(stream, 'd', 'r', 'e', 's', 's'), - 'f' + scan_chars!(stream, 't', 'e', 'r'), - 'n' + scan_chars!(stream, 'o', 'n', 'y', 'm', 'o', 'u', 's'), - 's' + scan_trie!( + 'f' + scan_chars!(stream, 't', 'e', 'r') + ), + 'b' + scan_chars!(stream, 'y', 't', 'e'), + 'c' + scan_chars!(stream, 'a', 't', 'c', 'h'), + 'f' + scan_sequence!( + scan_chars!(stream, 'i', 'n'), + scan_trie!( stream, - EMPTY, - 's' + scan_chars!(stream, 'e', 'm', 'b', 'l', 'y') + 'a' + scan_chars!(stream, 'l'), + 'n' + scan_chars!(stream, 'e', 'y') ) ), - 'b' + scan_trie!( + 'h' + scan_chars!(stream, 'e', 'x'), + 'i' + scan_sequence!( + scan_chars!(stream, 'n'), + scan_trie!(stream, EMPTY, 'l' + scan_chars!(stream, 'i', 'n', 'e')) + ), + 'm' + scan_chars!(stream, 'a', 't', 'c', 'h'), + 'n' + scan_chars!(stream, 'u', 'l', 'l'), + 'o' + scan_chars!(stream, 'f'), + 'r' + scan_chars!(stream, 'e', 'l', 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e'), + 's' + scan_trie!( stream, - 'o' + scan_chars!(stream, 'o', 'l'), - 'r' + scan_chars!(stream, 'e', 'a', 'k'), - 'y' + scan_chars!(stream, 't', 'e') + 't' + scan_chars!(stream, 'a', 't', 'i', 'c'), + 'z' + scan_chars!(stream, 'a', 'b', 'o') ), - 'c' + scan_trie!( + 't' + scan_trie!( stream, - 'a' + scan_trie!( - stream, - 's' + scan_chars!(stream, 'e'), - 't' + scan_chars!(stream, 'c', 'h') - ), - 'o' + scan_sequence!( - scan_chars!(stream, 'n'), - scan_trie!( - stream, - 's' + scan_chars!(stream, 't', 'a', 'n', 't'), - 't' + scan_trie!( - stream, - 'i' + scan_chars!(stream, 'n', 'u', 'e'), - 'r' + scan_chars!(stream, 'a', 'c', 't') - ) - ) + 'h' + scan_chars!(stream, 'r', 'o', 'w'), + 'r' + scan_chars!(stream, 'y'), + 'y' + scan_sequence!( + scan_chars!(stream, 'p', 'e'), + scan_trie!(stream, EMPTY, 'o' + scan_chars!(stream, 'f')) ) ), - 'd' + scan_trie!( + 'v' + scan_chars!(stream, 'a', 'r'), + 'y' + scan_chars!(stream, 'e', 'a', 'r', 's') + ) + ) + ) + } + + // (* v0.5.0 *) + // IDENTIFIER = «RAW_IDENTIFIER» - («KEYWORD_IN_ANY_VERSION» | «KEYWORD_IN_SOME_VERSION» | «RESERVED_WORD_IN_ANY_VERSION» | «RESERVED_WORD_IN_SOME_VERSION»); + + #[allow(dead_code, non_snake_case)] + fn identifier__0_5_0(&self, stream: &mut Stream) -> bool { + scan_difference!( + stream, + self.raw_identifier(stream), + scan_choice!( + stream, + self.keyword_in_any_version(stream), + self.keyword_in_some_version(stream), + scan_trie!( + stream, + 'a' + scan_trie!( stream, - ['o'], - 'a' + scan_chars!(stream, 'y', 's'), - 'e' + scan_trie!( + 'b' + scan_chars!(stream, 's', 't', 'r', 'a', 'c', 't'), + 'f' + scan_chars!(stream, 't', 'e', 'r') + ), + 'b' + scan_chars!(stream, 'y', 't', 'e'), + 'c' + scan_chars!(stream, 'a', 't', 'c', 'h'), + 'f' + scan_sequence!( + scan_chars!(stream, 'i', 'n'), + scan_trie!( stream, - 'f' + scan_chars!(stream, 'a', 'u', 'l', 't'), - 'l' + scan_chars!(stream, 'e', 't', 'e') + 'a' + scan_chars!(stream, 'l'), + 'n' + scan_chars!(stream, 'e', 'y') ) ), - 'e' + scan_trie!( - stream, - 'l' + scan_chars!(stream, 's', 'e'), - 'n' + scan_chars!(stream, 'u', 'm'), - 't' + scan_chars!(stream, 'h', 'e', 'r'), - 'v' + scan_chars!(stream, 'e', 'n', 't'), - 'x' + scan_chars!(stream, 't', 'e', 'r', 'n', 'a', 'l') + 'h' + scan_chars!(stream, 'e', 'x'), + 'i' + scan_sequence!( + scan_chars!(stream, 'n'), + scan_trie!(stream, EMPTY, 'l' + scan_chars!(stream, 'i', 'n', 'e')) ), - 'f' + scan_trie!( + 'm' + scan_chars!(stream, 'a', 't', 'c', 'h'), + 'n' + scan_chars!(stream, 'u', 'l', 'l'), + 'o' + scan_chars!(stream, 'f'), + 'r' + scan_chars!(stream, 'e', 'l', 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e'), + 's' + scan_trie!( stream, - 'a' + scan_chars!(stream, 'l', 's', 'e'), - 'i' + scan_chars!(stream, 'n', 'a', 'l'), - 'o' + scan_chars!(stream, 'r'), - 'u' + scan_chars!(stream, 'n', 'c', 't', 'i', 'o', 'n') + 't' + scan_chars!(stream, 'a', 't', 'i', 'c'), + 'z' + scan_chars!(stream, 'a', 'b', 'o') ), - 'h' + scan_trie!( + 't' + scan_trie!( stream, - 'e' + scan_chars!(stream, 'x'), - 'o' + scan_chars!(stream, 'u', 'r', 's') - ), - 'i' + scan_trie!( - stream, - ['f' | 's'], - 'm' + scan_chars!(stream, 'p', 'o', 'r', 't'), - 'n' + scan_trie!( - stream, - EMPTY, - 'd' + scan_chars!(stream, 'e', 'x', 'e', 'd'), - 'l' + scan_chars!(stream, 'i', 'n', 'e'), - 't' + scan_sequence!( - scan_chars!(stream, 'e', 'r'), - scan_trie!( - stream, - 'f' + scan_chars!(stream, 'a', 'c', 'e'), - 'n' + scan_chars!(stream, 'a', 'l') - ) - ) - ) - ), - 'l' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 't'), - 'i' + scan_chars!(stream, 'b', 'r', 'a', 'r', 'y') - ), - 'm' + scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 'p' + scan_chars!(stream, 'p', 'i', 'n', 'g'), - 't' + scan_chars!(stream, 'c', 'h') - ), - 'e' + scan_chars!(stream, 'm', 'o', 'r', 'y'), - 'i' + scan_chars!(stream, 'n', 'u', 't', 'e', 's'), - 'o' + scan_chars!(stream, 'd', 'i', 'f', 'i', 'e', 'r') - ), - 'n' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'w'), - 'u' + scan_chars!(stream, 'l', 'l') - ), - 'o' + scan_chars!(stream, 'f'), - 'p' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'y', 'a', 'b', 'l', 'e'), - 'r' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'g', 'm', 'a'), - 'i' + scan_chars!(stream, 'v', 'a', 't', 'e') - ), - 'u' + scan_trie!( - stream, - 'b' + scan_chars!(stream, 'l', 'i', 'c'), - 'r' + scan_chars!(stream, 'e') - ) - ), - 'r' + scan_sequence!( - scan_chars!(stream, 'e'), - scan_trie!( - stream, - 'l' + scan_chars!(stream, 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e'), - 't' + scan_sequence!( - scan_chars!(stream, 'u', 'r', 'n'), - scan_trie!(stream, EMPTY, ['s']) - ) - ) - ), - 's' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'c', 'o', 'n', 'd', 's'), - 't' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 't', 'i', 'c'), - 'o' + scan_chars!(stream, 'r', 'a', 'g', 'e'), - 'r' + scan_trie!( - stream, - 'i' + scan_chars!(stream, 'n', 'g'), - 'u' + scan_chars!(stream, 'c', 't') - ) - ), - 'w' + scan_chars!(stream, 'i', 't', 'c', 'h') - ), - 't' + scan_trie!( - stream, - 'h' + scan_chars!(stream, 'r', 'o', 'w'), - 'r' + scan_trie!(stream, ['y'], 'u' + scan_chars!(stream, 'e')), - 'y' + scan_sequence!( - scan_chars!(stream, 'p', 'e'), - scan_trie!(stream, EMPTY, 'o' + scan_chars!(stream, 'f')) - ) - ), - 'u' + scan_chars!(stream, 's', 'i', 'n', 'g'), - 'v' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'r'), - 'i' + scan_chars!(stream, 'e', 'w') - ), - 'w' + scan_trie!( - stream, - 'e' + scan_trie!(stream, ['i'], 'e' + scan_chars!(stream, 'k', 's')), - 'h' + scan_chars!(stream, 'i', 'l', 'e') + 'h' + scan_chars!(stream, 'r', 'o', 'w'), + 'r' + scan_chars!(stream, 'y'), + 'y' + scan_sequence!( + scan_chars!(stream, 'p', 'e'), + scan_trie!(stream, EMPTY, 'o' + scan_chars!(stream, 'f')) + ) ), + 'v' + scan_chars!(stream, 'a', 'r'), 'y' + scan_chars!(stream, 'e', 'a', 'r', 's') ), - self.not_an_identifier_in_some_versions(stream), - self.fixed_bytes_type(stream), - self.signed_fixed_type(stream), - self.unsigned_fixed_type(stream), - self.signed_integer_type(stream), - self.unsigned_integer_type(stream) + self.reserved_word_in_some_version(stream) ) ) } - // IDENTIFIER_PART = IDENTIFIER_START | "0"…"9"; + pub(crate) fn identifier(&self, stream: &mut Stream) -> bool { + if self.version_is_equal_to_or_greater_than_0_5_0 { + self.identifier__0_5_0(stream) + } else { + self.identifier__0_4_11(stream) + } + } + + // «IDENTIFIER_PART» = «IDENTIFIER_START» | "0"…"9"; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -1529,7 +1596,7 @@ impl Language { || ('a' <= c && c <= 'z')) } - // IDENTIFIER_START = "_" | "$" | "a"…"z" | "A"…"Z"; + // «IDENTIFIER_START» = "_" | "$" | "a"…"z" | "A"…"Z"; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -1619,6 +1686,76 @@ impl Language { ) } + // «INTEGER_TYPE_SIZE» = "8" + // | "16" + // | "24" + // | "32" + // | "40" + // | "48" + // | "56" + // | "64" + // | "72" + // | "80" + // | "88" + // | "96" + // | "104" + // | "112" + // | "120" + // | "128" + // | "136" + // | "144" + // | "152" + // | "160" + // | "168" + // | "176" + // | "184" + // | "192" + // | "200" + // | "208" + // | "216" + // | "224" + // | "232" + // | "240" + // | "248" + // | "256"; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn integer_type_size(&self, stream: &mut Stream) -> bool { + scan_trie!( + stream, + '1' + scan_trie!( + stream, + '0' + scan_chars!(stream, '4'), + '1' + scan_chars!(stream, '2'), + '2' + scan_trie!(stream, ['0' | '8']), + '3' + scan_chars!(stream, '6'), + '4' + scan_chars!(stream, '4'), + '5' + scan_chars!(stream, '2'), + '6' + scan_trie!(stream, EMPTY, ['0' | '8']), + '7' + scan_chars!(stream, '6'), + '8' + scan_chars!(stream, '4'), + '9' + scan_chars!(stream, '2') + ), + '2' + scan_trie!( + stream, + '0' + scan_trie!(stream, ['0' | '8']), + '1' + scan_chars!(stream, '6'), + '2' + scan_chars!(stream, '4'), + '3' + scan_chars!(stream, '2'), + '4' + scan_trie!(stream, EMPTY, ['0' | '8']), + '5' + scan_chars!(stream, '6') + ), + '3' + scan_chars!(stream, '2'), + '4' + scan_trie!(stream, ['0' | '8']), + '5' + scan_chars!(stream, '6'), + '6' + scan_chars!(stream, '4'), + '7' + scan_chars!(stream, '2'), + '8' + scan_trie!(stream, EMPTY, ['0' | '8']), + '9' + scan_chars!(stream, '6') + ) + } + // INTERFACE_KEYWORD = "interface"; #[allow(dead_code)] @@ -1667,6 +1804,370 @@ impl Language { ) } + // «KEYWORD_IN_ANY_VERSION» = FIXED_BYTES_TYPE + // | SIGNED_FIXED_TYPE + // | UNSIGNED_FIXED_TYPE + // | SIGNED_INTEGER_TYPE + // | UNSIGNED_INTEGER_TYPE + // | ADDRESS_KEYWORD + // | ANONYMOUS_KEYWORD + // | AS_KEYWORD + // | ASSEMBLY_KEYWORD + // | BOOL_KEYWORD + // | BREAK_KEYWORD + // | CASE_KEYWORD + // | CONSTANT_KEYWORD + // | CONTINUE_KEYWORD + // | CONTRACT_KEYWORD + // | DAYS_KEYWORD + // | DEFAULT_KEYWORD + // | DELETE_KEYWORD + // | DO_KEYWORD + // | ELSE_KEYWORD + // | ENUM_KEYWORD + // | ETHER_KEYWORD + // | EVENT_KEYWORD + // | EXTERNAL_KEYWORD + // | FALSE_KEYWORD + // | FOR_KEYWORD + // | FUNCTION_KEYWORD + // | HOURS_KEYWORD + // | IF_KEYWORD + // | IMPORT_KEYWORD + // | INDEXED_KEYWORD + // | INTERFACE_KEYWORD + // | INTERNAL_KEYWORD + // | IS_KEYWORD + // | LET_KEYWORD + // | LIBRARY_KEYWORD + // | MAPPING_KEYWORD + // | MEMORY_KEYWORD + // | MINUTES_KEYWORD + // | MODIFIER_KEYWORD + // | NEW_KEYWORD + // | PAYABLE_KEYWORD + // | PRAGMA_KEYWORD + // | PRIVATE_KEYWORD + // | PUBLIC_KEYWORD + // | PURE_KEYWORD + // | RETURN_KEYWORD + // | RETURNS_KEYWORD + // | SECONDS_KEYWORD + // | STORAGE_KEYWORD + // | STRING_KEYWORD + // | STRUCT_KEYWORD + // | SWITCH_KEYWORD + // | TRUE_KEYWORD + // | USING_KEYWORD + // | VIEW_KEYWORD + // | WEEKS_KEYWORD + // | WEI_KEYWORD + // | WHILE_KEYWORD; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn keyword_in_any_version(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.fixed_bytes_type(stream), + self.signed_fixed_type(stream), + self.unsigned_fixed_type(stream), + self.signed_integer_type(stream), + self.unsigned_integer_type(stream), + self.address_keyword(stream), + self.anonymous_keyword(stream), + self.as_keyword(stream), + self.assembly_keyword(stream), + self.bool_keyword(stream), + self.break_keyword(stream), + self.case_keyword(stream), + self.constant_keyword(stream), + self.continue_keyword(stream), + self.contract_keyword(stream), + self.days_keyword(stream), + self.default_keyword(stream), + self.delete_keyword(stream), + self.do_keyword(stream), + self.else_keyword(stream), + self.enum_keyword(stream), + self.ether_keyword(stream), + self.event_keyword(stream), + self.external_keyword(stream), + self.false_keyword(stream), + self.for_keyword(stream), + self.function_keyword(stream), + self.hours_keyword(stream), + self.if_keyword(stream), + self.import_keyword(stream), + self.indexed_keyword(stream), + self.interface_keyword(stream), + self.internal_keyword(stream), + self.is_keyword(stream), + self.let_keyword(stream), + self.library_keyword(stream), + self.mapping_keyword(stream), + self.memory_keyword(stream), + self.minutes_keyword(stream), + self.modifier_keyword(stream), + self.new_keyword(stream), + self.payable_keyword(stream), + self.pragma_keyword(stream), + self.private_keyword(stream), + self.public_keyword(stream), + self.pure_keyword(stream), + self.return_keyword(stream), + self.returns_keyword(stream), + self.seconds_keyword(stream), + self.storage_keyword(stream), + self.string_keyword(stream), + self.struct_keyword(stream), + self.switch_keyword(stream), + self.true_keyword(stream), + self.using_keyword(stream), + self.view_keyword(stream), + self.weeks_keyword(stream), + self.wei_keyword(stream), + self.while_keyword(stream) + ) + } + + // (* v0.4.11 *) + // «KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + // | FINNEY_KEYWORD + // | SZABO_KEYWORD + // | THROW_KEYWORD + // | VAR_KEYWORD + // | YEARS_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_4_11(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.byte_keyword(stream), + self.finney_keyword(stream), + self.szabo_keyword(stream), + self.throw_keyword(stream), + self.var_keyword(stream), + self.years_keyword(stream) + ) + } + + // (* v0.5.0 *) + // «KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + // | FINNEY_KEYWORD + // | SZABO_KEYWORD + // | CALLDATA_KEYWORD + // | CONSTRUCTOR_KEYWORD + // | EMIT_KEYWORD + // | OVERRIDE_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_5_0(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.byte_keyword(stream), + self.finney_keyword(stream), + self.szabo_keyword(stream), + self.calldata_keyword(stream), + self.constructor_keyword(stream), + self.emit_keyword(stream), + self.override_keyword(stream) + ) + } + + // (* v0.5.3 *) + // «KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + // | FINNEY_KEYWORD + // | SZABO_KEYWORD + // | CALLDATA_KEYWORD + // | CONSTRUCTOR_KEYWORD + // | EMIT_KEYWORD + // | OVERRIDE_KEYWORD + // | TYPE_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_5_3(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.byte_keyword(stream), + self.finney_keyword(stream), + self.szabo_keyword(stream), + self.calldata_keyword(stream), + self.constructor_keyword(stream), + self.emit_keyword(stream), + self.override_keyword(stream), + self.type_keyword(stream) + ) + } + + // (* v0.6.0 *) + // «KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + // | FINNEY_KEYWORD + // | SZABO_KEYWORD + // | CALLDATA_KEYWORD + // | CONSTRUCTOR_KEYWORD + // | EMIT_KEYWORD + // | OVERRIDE_KEYWORD + // | TYPE_KEYWORD + // | ABSTRACT_KEYWORD + // | CATCH_KEYWORD + // | FALLBACK_KEYWORD + // | RECEIVE_KEYWORD + // | TRY_KEYWORD + // | VIRTUAL_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_6_0(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.byte_keyword(stream), + self.finney_keyword(stream), + self.szabo_keyword(stream), + self.calldata_keyword(stream), + self.constructor_keyword(stream), + self.emit_keyword(stream), + self.override_keyword(stream), + self.type_keyword(stream), + self.abstract_keyword(stream), + self.catch_keyword(stream), + self.fallback_keyword(stream), + self.receive_keyword(stream), + self.try_keyword(stream), + self.virtual_keyword(stream) + ) + } + + // (* v0.6.5 *) + // «KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + // | FINNEY_KEYWORD + // | SZABO_KEYWORD + // | CALLDATA_KEYWORD + // | CONSTRUCTOR_KEYWORD + // | EMIT_KEYWORD + // | OVERRIDE_KEYWORD + // | TYPE_KEYWORD + // | ABSTRACT_KEYWORD + // | CATCH_KEYWORD + // | FALLBACK_KEYWORD + // | RECEIVE_KEYWORD + // | TRY_KEYWORD + // | VIRTUAL_KEYWORD + // | IMMUTABLE_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_6_5(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.byte_keyword(stream), + self.finney_keyword(stream), + self.szabo_keyword(stream), + self.calldata_keyword(stream), + self.constructor_keyword(stream), + self.emit_keyword(stream), + self.override_keyword(stream), + self.type_keyword(stream), + self.abstract_keyword(stream), + self.catch_keyword(stream), + self.fallback_keyword(stream), + self.receive_keyword(stream), + self.try_keyword(stream), + self.virtual_keyword(stream), + self.immutable_keyword(stream) + ) + } + + // (* v0.7.0 *) + // «KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + // | CALLDATA_KEYWORD + // | CONSTRUCTOR_KEYWORD + // | EMIT_KEYWORD + // | OVERRIDE_KEYWORD + // | TYPE_KEYWORD + // | ABSTRACT_KEYWORD + // | CATCH_KEYWORD + // | FALLBACK_KEYWORD + // | RECEIVE_KEYWORD + // | TRY_KEYWORD + // | VIRTUAL_KEYWORD + // | IMMUTABLE_KEYWORD + // | GWEI_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_7_0(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.byte_keyword(stream), + self.calldata_keyword(stream), + self.constructor_keyword(stream), + self.emit_keyword(stream), + self.override_keyword(stream), + self.type_keyword(stream), + self.abstract_keyword(stream), + self.catch_keyword(stream), + self.fallback_keyword(stream), + self.receive_keyword(stream), + self.try_keyword(stream), + self.virtual_keyword(stream), + self.immutable_keyword(stream), + self.gwei_keyword(stream) + ) + } + + // (* v0.8.0 *) + // «KEYWORD_IN_SOME_VERSION» = CALLDATA_KEYWORD + // | CONSTRUCTOR_KEYWORD + // | EMIT_KEYWORD + // | OVERRIDE_KEYWORD + // | TYPE_KEYWORD + // | ABSTRACT_KEYWORD + // | CATCH_KEYWORD + // | FALLBACK_KEYWORD + // | RECEIVE_KEYWORD + // | TRY_KEYWORD + // | VIRTUAL_KEYWORD + // | IMMUTABLE_KEYWORD + // | GWEI_KEYWORD + // | UNCHECKED_KEYWORD; + + #[allow(dead_code, non_snake_case)] + fn keyword_in_some_version__0_8_0(&self, stream: &mut Stream) -> bool { + scan_choice!( + stream, + self.calldata_keyword(stream), + self.constructor_keyword(stream), + self.emit_keyword(stream), + self.override_keyword(stream), + self.type_keyword(stream), + self.abstract_keyword(stream), + self.catch_keyword(stream), + self.fallback_keyword(stream), + self.receive_keyword(stream), + self.try_keyword(stream), + self.virtual_keyword(stream), + self.immutable_keyword(stream), + self.gwei_keyword(stream), + self.unchecked_keyword(stream) + ) + } + + pub(crate) fn keyword_in_some_version(&self, stream: &mut Stream) -> bool { + if self.version_is_equal_to_or_greater_than_0_8_0 { + self.keyword_in_some_version__0_8_0(stream) + } else if self.version_is_equal_to_or_greater_than_0_7_0 { + self.keyword_in_some_version__0_7_0(stream) + } else if self.version_is_equal_to_or_greater_than_0_6_5 { + self.keyword_in_some_version__0_6_5(stream) + } else if self.version_is_equal_to_or_greater_than_0_6_0 { + self.keyword_in_some_version__0_6_0(stream) + } else if self.version_is_equal_to_or_greater_than_0_5_3 { + self.keyword_in_some_version__0_5_3(stream) + } else if self.version_is_equal_to_or_greater_than_0_5_0 { + self.keyword_in_some_version__0_5_0(stream) + } else { + self.keyword_in_some_version__0_4_11(stream) + } + } + // (* v0.6.0 *) // LEAVE_KEYWORD = "leave"; @@ -1879,571 +2380,33 @@ impl Language { scan_chars!(stream, '/', '*'), scan_zero_or_more!( stream, - scan_choice!( - stream, - scan_predicate!(stream, |c| c != '*'), - scan_sequence!( - scan_chars!(stream, '*'), - scan_predicate!(stream, |c| c != '/') - ) - ) - ), - scan_chars!(stream, '*', '/') - ) - } - - // NEW_KEYWORD = "new"; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn new_keyword(&self, stream: &mut Stream) -> bool { - scan_not_followed_by!( - stream, - scan_chars!(stream, 'n', 'e', 'w'), - scan_predicate!(stream, |c| c == '$' - || ('0' <= c && c <= '9') - || ('A' <= c && c <= 'Z') - || c == '_' - || ('a' <= c && c <= 'z')) - ) - } - - // NOT_AN_IDENTIFIER_IN_ANY_VERSION = "abstract" - // | "address" - // | "after" - // | "anonymous" - // | "as" - // | "assembly" - // | "bool" - // | "break" - // | "byte" - // | "case" - // | "catch" - // | "constant" - // | "continue" - // | "contract" - // | "days" - // | "default" - // | "delete" - // | "do" - // | "else" - // | "enum" - // | "ether" - // | "event" - // | "external" - // | "false" - // | "final" - // | "for" - // | "function" - // | "hex" - // | "hours" - // | "if" - // | "import" - // | "in" - // | "indexed" - // | "inline" - // | "interface" - // | "internal" - // | "is" - // | "let" - // | "library" - // | "mapping" - // | "match" - // | "memory" - // | "minutes" - // | "modifier" - // | "new" - // | "null" - // | "of" - // | "payable" - // | "pragma" - // | "private" - // | "public" - // | "pure" - // | "relocatable" - // | "return" - // | "returns" - // | "seconds" - // | "static" - // | "storage" - // | "string" - // | "struct" - // | "switch" - // | "throw" - // | "true" - // | "try" - // | "type" - // | "typeof" - // | "using" - // | "var" - // | "view" - // | "weeks" - // | "wei" - // | "while" - // | "years"; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn not_an_identifier_in_any_version(&self, stream: &mut Stream) -> bool { - scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 'b' + scan_chars!(stream, 's', 't', 'r', 'a', 'c', 't'), - 'd' + scan_chars!(stream, 'd', 'r', 'e', 's', 's'), - 'f' + scan_chars!(stream, 't', 'e', 'r'), - 'n' + scan_chars!(stream, 'o', 'n', 'y', 'm', 'o', 'u', 's'), - 's' + scan_trie!( - stream, - EMPTY, - 's' + scan_chars!(stream, 'e', 'm', 'b', 'l', 'y') - ) - ), - 'b' + scan_trie!( - stream, - 'o' + scan_chars!(stream, 'o', 'l'), - 'r' + scan_chars!(stream, 'e', 'a', 'k'), - 'y' + scan_chars!(stream, 't', 'e') - ), - 'c' + scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 's' + scan_chars!(stream, 'e'), - 't' + scan_chars!(stream, 'c', 'h') - ), - 'o' + scan_sequence!( - scan_chars!(stream, 'n'), - scan_trie!( - stream, - 's' + scan_chars!(stream, 't', 'a', 'n', 't'), - 't' + scan_trie!( - stream, - 'i' + scan_chars!(stream, 'n', 'u', 'e'), - 'r' + scan_chars!(stream, 'a', 'c', 't') - ) - ) - ) - ), - 'd' + scan_trie!( - stream, - ['o'], - 'a' + scan_chars!(stream, 'y', 's'), - 'e' + scan_trie!( - stream, - 'f' + scan_chars!(stream, 'a', 'u', 'l', 't'), - 'l' + scan_chars!(stream, 'e', 't', 'e') - ) - ), - 'e' + scan_trie!( - stream, - 'l' + scan_chars!(stream, 's', 'e'), - 'n' + scan_chars!(stream, 'u', 'm'), - 't' + scan_chars!(stream, 'h', 'e', 'r'), - 'v' + scan_chars!(stream, 'e', 'n', 't'), - 'x' + scan_chars!(stream, 't', 'e', 'r', 'n', 'a', 'l') - ), - 'f' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'l', 's', 'e'), - 'i' + scan_chars!(stream, 'n', 'a', 'l'), - 'o' + scan_chars!(stream, 'r'), - 'u' + scan_chars!(stream, 'n', 'c', 't', 'i', 'o', 'n') - ), - 'h' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'x'), - 'o' + scan_chars!(stream, 'u', 'r', 's') - ), - 'i' + scan_trie!( - stream, - ['f' | 's'], - 'm' + scan_chars!(stream, 'p', 'o', 'r', 't'), - 'n' + scan_trie!( - stream, - EMPTY, - 'd' + scan_chars!(stream, 'e', 'x', 'e', 'd'), - 'l' + scan_chars!(stream, 'i', 'n', 'e'), - 't' + scan_sequence!( - scan_chars!(stream, 'e', 'r'), - scan_trie!( - stream, - 'f' + scan_chars!(stream, 'a', 'c', 'e'), - 'n' + scan_chars!(stream, 'a', 'l') - ) - ) - ) - ), - 'l' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 't'), - 'i' + scan_chars!(stream, 'b', 'r', 'a', 'r', 'y') - ), - 'm' + scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 'p' + scan_chars!(stream, 'p', 'i', 'n', 'g'), - 't' + scan_chars!(stream, 'c', 'h') - ), - 'e' + scan_chars!(stream, 'm', 'o', 'r', 'y'), - 'i' + scan_chars!(stream, 'n', 'u', 't', 'e', 's'), - 'o' + scan_chars!(stream, 'd', 'i', 'f', 'i', 'e', 'r') - ), - 'n' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'w'), - 'u' + scan_chars!(stream, 'l', 'l') - ), - 'o' + scan_chars!(stream, 'f'), - 'p' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'y', 'a', 'b', 'l', 'e'), - 'r' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'g', 'm', 'a'), - 'i' + scan_chars!(stream, 'v', 'a', 't', 'e') - ), - 'u' + scan_trie!( - stream, - 'b' + scan_chars!(stream, 'l', 'i', 'c'), - 'r' + scan_chars!(stream, 'e') - ) - ), - 'r' + scan_sequence!( - scan_chars!(stream, 'e'), - scan_trie!( - stream, - 'l' + scan_chars!(stream, 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e'), - 't' + scan_sequence!( - scan_chars!(stream, 'u', 'r', 'n'), - scan_trie!(stream, EMPTY, ['s']) - ) - ) - ), - 's' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'c', 'o', 'n', 'd', 's'), - 't' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 't', 'i', 'c'), - 'o' + scan_chars!(stream, 'r', 'a', 'g', 'e'), - 'r' + scan_trie!( - stream, - 'i' + scan_chars!(stream, 'n', 'g'), - 'u' + scan_chars!(stream, 'c', 't') - ) - ), - 'w' + scan_chars!(stream, 'i', 't', 'c', 'h') - ), - 't' + scan_trie!( - stream, - 'h' + scan_chars!(stream, 'r', 'o', 'w'), - 'r' + scan_trie!(stream, ['y'], 'u' + scan_chars!(stream, 'e')), - 'y' + scan_sequence!( - scan_chars!(stream, 'p', 'e'), - scan_trie!(stream, EMPTY, 'o' + scan_chars!(stream, 'f')) - ) - ), - 'u' + scan_chars!(stream, 's', 'i', 'n', 'g'), - 'v' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'r'), - 'i' + scan_chars!(stream, 'e', 'w') - ), - 'w' + scan_trie!( - stream, - 'e' + scan_trie!(stream, ['i'], 'e' + scan_chars!(stream, 'k', 's')), - 'h' + scan_chars!(stream, 'i', 'l', 'e') - ), - 'y' + scan_chars!(stream, 'e', 'a', 'r', 's') - ) - } - - // (* v0.4.11 *) - // NOT_AN_IDENTIFIER_IN_SOME_VERSIONS = "finney" | "szabo"; - - #[allow(dead_code, non_snake_case)] - fn not_an_identifier_in_some_versions__0_4_11(&self, stream: &mut Stream) -> bool { - scan_trie!( - stream, - 'f' + scan_chars!(stream, 'i', 'n', 'n', 'e', 'y'), - 's' + scan_chars!(stream, 'z', 'a', 'b', 'o') - ) - } - - // (* v0.5.0 *) - // NOT_AN_IDENTIFIER_IN_SOME_VERSIONS = "finney" - // | "szabo" - // | "alias" - // | "apply" - // | "auto" - // | "calldata" - // | "constructor" - // | "copyof" - // | "define" - // | "emit" - // | "immutable" - // | "implements" - // | "macro" - // | "mutable" - // | "override" - // | "partial" - // | "promise" - // | "reference" - // | "sealed" - // | "sizeof" - // | "supports" - // | "typedef" - // | "unchecked"; - - #[allow(dead_code, non_snake_case)] - fn not_an_identifier_in_some_versions__0_5_0(&self, stream: &mut Stream) -> bool { - scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 'l' + scan_chars!(stream, 'i', 'a', 's'), - 'p' + scan_chars!(stream, 'p', 'l', 'y'), - 'u' + scan_chars!(stream, 't', 'o') - ), - 'c' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'l', 'l', 'd', 'a', 't', 'a'), - 'o' + scan_trie!( - stream, - 'n' + scan_chars!(stream, 's', 't', 'r', 'u', 'c', 't', 'o', 'r'), - 'p' + scan_chars!(stream, 'y', 'o', 'f') - ) - ), - 'd' + scan_chars!(stream, 'e', 'f', 'i', 'n', 'e'), - 'e' + scan_chars!(stream, 'm', 'i', 't'), - 'f' + scan_chars!(stream, 'i', 'n', 'n', 'e', 'y'), - 'i' + scan_sequence!( - scan_chars!(stream, 'm'), - scan_trie!( - stream, - 'm' + scan_chars!(stream, 'u', 't', 'a', 'b', 'l', 'e'), - 'p' + scan_chars!(stream, 'l', 'e', 'm', 'e', 'n', 't', 's') - ) - ), - 'm' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'c', 'r', 'o'), - 'u' + scan_chars!(stream, 't', 'a', 'b', 'l', 'e') - ), - 'o' + scan_chars!(stream, 'v', 'e', 'r', 'r', 'i', 'd', 'e'), - 'p' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'r', 't', 'i', 'a', 'l'), - 'r' + scan_chars!(stream, 'o', 'm', 'i', 's', 'e') - ), - 'r' + scan_chars!(stream, 'e', 'f', 'e', 'r', 'e', 'n', 'c', 'e'), - 's' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'a', 'l', 'e', 'd'), - 'i' + scan_chars!(stream, 'z', 'e', 'o', 'f'), - 'u' + scan_chars!(stream, 'p', 'p', 'o', 'r', 't', 's'), - 'z' + scan_chars!(stream, 'a', 'b', 'o') - ), - 't' + scan_chars!(stream, 'y', 'p', 'e', 'd', 'e', 'f'), - 'u' + scan_chars!(stream, 'n', 'c', 'h', 'e', 'c', 'k', 'e', 'd') - ) - } - - // (* v0.6.0 *) - // NOT_AN_IDENTIFIER_IN_SOME_VERSIONS = "finney" - // | "szabo" - // | "alias" - // | "apply" - // | "auto" - // | "calldata" - // | "constructor" - // | "copyof" - // | "define" - // | "emit" - // | "immutable" - // | "implements" - // | "macro" - // | "mutable" - // | "override" - // | "partial" - // | "promise" - // | "reference" - // | "sealed" - // | "sizeof" - // | "supports" - // | "typedef" - // | "unchecked" - // | "fallback" - // | "receive" - // | "virtual"; - - #[allow(dead_code, non_snake_case)] - fn not_an_identifier_in_some_versions__0_6_0(&self, stream: &mut Stream) -> bool { - scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 'l' + scan_chars!(stream, 'i', 'a', 's'), - 'p' + scan_chars!(stream, 'p', 'l', 'y'), - 'u' + scan_chars!(stream, 't', 'o') - ), - 'c' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'l', 'l', 'd', 'a', 't', 'a'), - 'o' + scan_trie!( - stream, - 'n' + scan_chars!(stream, 's', 't', 'r', 'u', 'c', 't', 'o', 'r'), - 'p' + scan_chars!(stream, 'y', 'o', 'f') - ) - ), - 'd' + scan_chars!(stream, 'e', 'f', 'i', 'n', 'e'), - 'e' + scan_chars!(stream, 'm', 'i', 't'), - 'f' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'l', 'l', 'b', 'a', 'c', 'k'), - 'i' + scan_chars!(stream, 'n', 'n', 'e', 'y') - ), - 'i' + scan_sequence!( - scan_chars!(stream, 'm'), - scan_trie!( - stream, - 'm' + scan_chars!(stream, 'u', 't', 'a', 'b', 'l', 'e'), - 'p' + scan_chars!(stream, 'l', 'e', 'm', 'e', 'n', 't', 's') - ) - ), - 'm' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'c', 'r', 'o'), - 'u' + scan_chars!(stream, 't', 'a', 'b', 'l', 'e') - ), - 'o' + scan_chars!(stream, 'v', 'e', 'r', 'r', 'i', 'd', 'e'), - 'p' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'r', 't', 'i', 'a', 'l'), - 'r' + scan_chars!(stream, 'o', 'm', 'i', 's', 'e') - ), - 'r' + scan_sequence!( - scan_chars!(stream, 'e'), - scan_trie!( - stream, - 'c' + scan_chars!(stream, 'e', 'i', 'v', 'e'), - 'f' + scan_chars!(stream, 'e', 'r', 'e', 'n', 'c', 'e') - ) - ), - 's' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'a', 'l', 'e', 'd'), - 'i' + scan_chars!(stream, 'z', 'e', 'o', 'f'), - 'u' + scan_chars!(stream, 'p', 'p', 'o', 'r', 't', 's'), - 'z' + scan_chars!(stream, 'a', 'b', 'o') - ), - 't' + scan_chars!(stream, 'y', 'p', 'e', 'd', 'e', 'f'), - 'u' + scan_chars!(stream, 'n', 'c', 'h', 'e', 'c', 'k', 'e', 'd'), - 'v' + scan_chars!(stream, 'i', 'r', 't', 'u', 'a', 'l') - ) - } - - // (* v0.7.0 *) - // NOT_AN_IDENTIFIER_IN_SOME_VERSIONS = "alias" - // | "apply" - // | "auto" - // | "calldata" - // | "constructor" - // | "copyof" - // | "define" - // | "emit" - // | "immutable" - // | "implements" - // | "macro" - // | "mutable" - // | "override" - // | "partial" - // | "promise" - // | "reference" - // | "sealed" - // | "sizeof" - // | "supports" - // | "typedef" - // | "unchecked" - // | "fallback" - // | "receive" - // | "virtual" - // | "gwei"; - - #[allow(dead_code, non_snake_case)] - fn not_an_identifier_in_some_versions__0_7_0(&self, stream: &mut Stream) -> bool { - scan_trie!( - stream, - 'a' + scan_trie!( - stream, - 'l' + scan_chars!(stream, 'i', 'a', 's'), - 'p' + scan_chars!(stream, 'p', 'l', 'y'), - 'u' + scan_chars!(stream, 't', 'o') - ), - 'c' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'l', 'l', 'd', 'a', 't', 'a'), - 'o' + scan_trie!( - stream, - 'n' + scan_chars!(stream, 's', 't', 'r', 'u', 'c', 't', 'o', 'r'), - 'p' + scan_chars!(stream, 'y', 'o', 'f') - ) - ), - 'd' + scan_chars!(stream, 'e', 'f', 'i', 'n', 'e'), - 'e' + scan_chars!(stream, 'm', 'i', 't'), - 'f' + scan_chars!(stream, 'a', 'l', 'l', 'b', 'a', 'c', 'k'), - 'g' + scan_chars!(stream, 'w', 'e', 'i'), - 'i' + scan_sequence!( - scan_chars!(stream, 'm'), - scan_trie!( - stream, - 'm' + scan_chars!(stream, 'u', 't', 'a', 'b', 'l', 'e'), - 'p' + scan_chars!(stream, 'l', 'e', 'm', 'e', 'n', 't', 's') - ) - ), - 'm' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'c', 'r', 'o'), - 'u' + scan_chars!(stream, 't', 'a', 'b', 'l', 'e') - ), - 'o' + scan_chars!(stream, 'v', 'e', 'r', 'r', 'i', 'd', 'e'), - 'p' + scan_trie!( - stream, - 'a' + scan_chars!(stream, 'r', 't', 'i', 'a', 'l'), - 'r' + scan_chars!(stream, 'o', 'm', 'i', 's', 'e') - ), - 'r' + scan_sequence!( - scan_chars!(stream, 'e'), - scan_trie!( + scan_choice!( stream, - 'c' + scan_chars!(stream, 'e', 'i', 'v', 'e'), - 'f' + scan_chars!(stream, 'e', 'r', 'e', 'n', 'c', 'e') + scan_predicate!(stream, |c| c != '*'), + scan_sequence!( + scan_chars!(stream, '*'), + scan_predicate!(stream, |c| c != '/') + ) ) ), - 's' + scan_trie!( - stream, - 'e' + scan_chars!(stream, 'a', 'l', 'e', 'd'), - 'i' + scan_chars!(stream, 'z', 'e', 'o', 'f'), - 'u' + scan_chars!(stream, 'p', 'p', 'o', 'r', 't', 's') - ), - 't' + scan_chars!(stream, 'y', 'p', 'e', 'd', 'e', 'f'), - 'u' + scan_chars!(stream, 'n', 'c', 'h', 'e', 'c', 'k', 'e', 'd'), - 'v' + scan_chars!(stream, 'i', 'r', 't', 'u', 'a', 'l') + scan_chars!(stream, '*', '/') ) } - pub(crate) fn not_an_identifier_in_some_versions(&self, stream: &mut Stream) -> bool { - if self.version_is_equal_to_or_greater_than_0_7_0 { - self.not_an_identifier_in_some_versions__0_7_0(stream) - } else if self.version_is_equal_to_or_greater_than_0_6_0 { - self.not_an_identifier_in_some_versions__0_6_0(stream) - } else if self.version_is_equal_to_or_greater_than_0_5_0 { - self.not_an_identifier_in_some_versions__0_5_0(stream) - } else { - self.not_an_identifier_in_some_versions__0_4_11(stream) - } + // NEW_KEYWORD = "new"; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn new_keyword(&self, stream: &mut Stream) -> bool { + scan_not_followed_by!( + stream, + scan_chars!(stream, 'n', 'e', 'w'), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) + ) } // OPEN_BRACE = "{"; @@ -2554,33 +2517,6 @@ impl Language { scan_chars!(stream, '+', '+') } - // POSSIBLY_SEPARATED_PAIRS_OF_HEX_DIGITS = «HEX_CHARACTER» «HEX_CHARACTER» ("_"? «HEX_CHARACTER» «HEX_CHARACTER»)*; - - #[allow(dead_code)] - #[allow(unused_assignments, unused_parens)] - pub(crate) fn possibly_separated_pairs_of_hex_digits(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')), - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')), - scan_zero_or_more!( - stream, - scan_sequence!( - scan_optional!(stream, scan_chars!(stream, '_')), - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')), - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')) - ) - ) - ) - } - // PRAGMA_KEYWORD = "pragma"; #[allow(dead_code)] @@ -2653,7 +2589,7 @@ impl Language { scan_chars!(stream, '?') } - // RAW_IDENTIFIER = IDENTIFIER_START IDENTIFIER_PART*; + // «RAW_IDENTIFIER» = «IDENTIFIER_START» «IDENTIFIER_PART»*; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2690,6 +2626,145 @@ impl Language { ) } + // «RESERVED_WORD_IN_ANY_VERSION» = "abstract" + // | "after" + // | "byte" + // | "catch" + // | "final" + // | "finney" + // | "hex" + // | "in" + // | "inline" + // | "match" + // | "null" + // | "of" + // | "relocatable" + // | "static" + // | "szabo" + // | "throw" + // | "try" + // | "type" + // | "typeof" + // | "var" + // | "years"; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn reserved_word_in_any_version(&self, stream: &mut Stream) -> bool { + scan_trie!( + stream, + 'a' + scan_trie!( + stream, + 'b' + scan_chars!(stream, 's', 't', 'r', 'a', 'c', 't'), + 'f' + scan_chars!(stream, 't', 'e', 'r') + ), + 'b' + scan_chars!(stream, 'y', 't', 'e'), + 'c' + scan_chars!(stream, 'a', 't', 'c', 'h'), + 'f' + scan_sequence!( + scan_chars!(stream, 'i', 'n'), + scan_trie!( + stream, + 'a' + scan_chars!(stream, 'l'), + 'n' + scan_chars!(stream, 'e', 'y') + ) + ), + 'h' + scan_chars!(stream, 'e', 'x'), + 'i' + scan_sequence!( + scan_chars!(stream, 'n'), + scan_trie!(stream, EMPTY, 'l' + scan_chars!(stream, 'i', 'n', 'e')) + ), + 'm' + scan_chars!(stream, 'a', 't', 'c', 'h'), + 'n' + scan_chars!(stream, 'u', 'l', 'l'), + 'o' + scan_chars!(stream, 'f'), + 'r' + scan_chars!(stream, 'e', 'l', 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e'), + 's' + scan_trie!( + stream, + 't' + scan_chars!(stream, 'a', 't', 'i', 'c'), + 'z' + scan_chars!(stream, 'a', 'b', 'o') + ), + 't' + scan_trie!( + stream, + 'h' + scan_chars!(stream, 'r', 'o', 'w'), + 'r' + scan_chars!(stream, 'y'), + 'y' + scan_sequence!( + scan_chars!(stream, 'p', 'e'), + scan_trie!(stream, EMPTY, 'o' + scan_chars!(stream, 'f')) + ) + ), + 'v' + scan_chars!(stream, 'a', 'r'), + 'y' + scan_chars!(stream, 'e', 'a', 'r', 's') + ) + } + + // (* v0.5.0 *) + // «RESERVED_WORD_IN_SOME_VERSION» = "alias" + // | "apply" + // | "auto" + // | "copyof" + // | "define" + // | "implements" + // | "macro" + // | "mutable" + // | "partial" + // | "promise" + // | "reference" + // | "sealed" + // | "sizeof" + // | "supports" + // | "typedef"; + + #[allow(dead_code, non_snake_case)] + fn reserved_word_in_some_version__0_5_0(&self, stream: &mut Stream) -> bool { + scan_trie!( + stream, + 'a' + scan_trie!( + stream, + 'l' + scan_chars!(stream, 'i', 'a', 's'), + 'p' + scan_chars!(stream, 'p', 'l', 'y'), + 'u' + scan_chars!(stream, 't', 'o') + ), + 'c' + scan_chars!(stream, 'o', 'p', 'y', 'o', 'f'), + 'd' + scan_chars!(stream, 'e', 'f', 'i', 'n', 'e'), + 'i' + scan_chars!(stream, 'm', 'p', 'l', 'e', 'm', 'e', 'n', 't', 's'), + 'm' + scan_trie!( + stream, + 'a' + scan_chars!(stream, 'c', 'r', 'o'), + 'u' + scan_chars!(stream, 't', 'a', 'b', 'l', 'e') + ), + 'p' + scan_trie!( + stream, + 'a' + scan_chars!(stream, 'r', 't', 'i', 'a', 'l'), + 'r' + scan_chars!(stream, 'o', 'm', 'i', 's', 'e') + ), + 'r' + scan_chars!(stream, 'e', 'f', 'e', 'r', 'e', 'n', 'c', 'e'), + 's' + scan_trie!( + stream, + 'e' + scan_chars!(stream, 'a', 'l', 'e', 'd'), + 'i' + scan_chars!(stream, 'z', 'e', 'o', 'f'), + 'u' + scan_chars!(stream, 'p', 'p', 'o', 'r', 't', 's') + ), + 't' + scan_chars!(stream, 'y', 'p', 'e', 'd', 'e', 'f') + ) + } + + #[allow(non_snake_case)] + pub(crate) fn reserved_word_in_some_version__sparse_dispatch( + &self, + stream: &mut Stream, + ) -> Option { + if self.version_is_equal_to_or_greater_than_0_5_0 { + Some(self.reserved_word_in_some_version__0_5_0(stream)) + } else { + None + } + } + + #[inline] + pub(crate) fn reserved_word_in_some_version(&self, stream: &mut Stream) -> bool { + self.reserved_word_in_some_version__sparse_dispatch(stream) + .expect("Validation should have checked that references are valid between versions") + } + // RETURN_KEYWORD = "return"; #[allow(dead_code)] @@ -2762,7 +2837,7 @@ impl Language { scan_chars!(stream, ';') } - // SIGNED_FIXED_TYPE = "fixed" ("0"…"9"+ "x" "0"…"9"+)?; + // SIGNED_FIXED_TYPE = "fixed" «FIXED_TYPE_SIZE»?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2771,20 +2846,7 @@ impl Language { stream, scan_sequence!( scan_chars!(stream, 'f', 'i', 'x', 'e', 'd'), - scan_optional!( - stream, - scan_sequence!( - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9')) - ), - scan_chars!(stream, 'x'), - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9')) - ) - ) - ) + scan_optional!(stream, self.fixed_type_size(stream)) ), scan_predicate!(stream, |c| c == '$' || ('0' <= c && c <= '9') @@ -2794,7 +2856,7 @@ impl Language { ) } - // SIGNED_INTEGER_TYPE = "int" ("8" | "16" | "24" | "32" | "40" | "48" | "56" | "64" | "72" | "80" | "88" | "96" | "104" | "112" | "120" | "128" | "136" | "144" | "152" | "160" | "168" | "176" | "184" | "192" | "200" | "208" | "216" | "224" | "232" | "240" | "248" | "256")?; + // SIGNED_INTEGER_TYPE = "int" «INTEGER_TYPE_SIZE»?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2858,7 +2920,7 @@ impl Language { ) } - // SINGLE_QUOTED_ASCII_STRING_LITERAL = "'" (ESCAPE_SEQUENCE | (" "…"~" - ("'" | "\\")))* "'"; + // «SINGLE_QUOTED_ASCII_STRING_LITERAL» = "'" («ESCAPE_SEQUENCE» | (" "…"~" - ("'" | "\\")))* "'"; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -2879,8 +2941,21 @@ impl Language { ) } + // «SINGLE_QUOTED_HEX_STRING_LITERAL» = "hex" "'" «HEX_STRING_CONTENTS»? "'"; + + #[allow(dead_code)] + #[allow(unused_assignments, unused_parens)] + pub(crate) fn single_quoted_hex_string_literal(&self, stream: &mut Stream) -> bool { + scan_sequence!( + scan_chars!(stream, 'h', 'e', 'x'), + scan_chars!(stream, '\''), + scan_optional!(stream, self.hex_string_contents(stream)), + scan_chars!(stream, '\'') + ) + } + // (* v0.7.0 *) - // SINGLE_QUOTED_UNICODE_STRING_LITERAL = "unicode'" (ESCAPE_SEQUENCE | !("'" | "\\" | "\n" | "\r"))* "'"; + // «SINGLE_QUOTED_UNICODE_STRING_LITERAL» = "unicode'" («ESCAPE_SEQUENCE» | !("'" | "\\" | "\n" | "\r"))* "'"; #[allow(dead_code, non_snake_case)] fn single_quoted_unicode_string_literal__0_7_0(&self, stream: &mut Stream) -> bool { @@ -3191,7 +3266,7 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // UNICODE_ESCAPE = "u" «HEX_CHARACTER» «HEX_CHARACTER» «HEX_CHARACTER» «HEX_CHARACTER»; + // «UNICODE_ESCAPE» = "u" «HEX_CHARACTER» «HEX_CHARACTER» «HEX_CHARACTER» «HEX_CHARACTER»; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -3214,14 +3289,22 @@ impl Language { } // (* v0.7.0 *) - // UNICODE_STRING_LITERAL = SINGLE_QUOTED_UNICODE_STRING_LITERAL | DOUBLE_QUOTED_UNICODE_STRING_LITERAL; + // UNICODE_STRING_LITERAL = «SINGLE_QUOTED_UNICODE_STRING_LITERAL» | «DOUBLE_QUOTED_UNICODE_STRING_LITERAL»; #[allow(dead_code, non_snake_case)] fn unicode_string_literal__0_7_0(&self, stream: &mut Stream) -> bool { - scan_choice!( + scan_not_followed_by!( stream, - self.single_quoted_unicode_string_literal(stream), - self.double_quoted_unicode_string_literal(stream) + scan_choice!( + stream, + self.single_quoted_unicode_string_literal(stream), + self.double_quoted_unicode_string_literal(stream) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } @@ -3243,20 +3326,76 @@ impl Language { .expect("Validation should have checked that references are valid between versions") } - // UNSIGNED_FIXED_TYPE = "u" SIGNED_FIXED_TYPE; + // UNSIGNED_FIXED_TYPE = "ufixed" «FIXED_TYPE_SIZE»?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn unsigned_fixed_type(&self, stream: &mut Stream) -> bool { - scan_sequence!(scan_chars!(stream, 'u'), self.signed_fixed_type(stream)) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_chars!(stream, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_optional!(stream, self.fixed_type_size(stream)) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) + ) } - // UNSIGNED_INTEGER_TYPE = "u" SIGNED_INTEGER_TYPE; + // UNSIGNED_INTEGER_TYPE = "uint" «INTEGER_TYPE_SIZE»?; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn unsigned_integer_type(&self, stream: &mut Stream) -> bool { - scan_sequence!(scan_chars!(stream, 'u'), self.signed_integer_type(stream)) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_chars!(stream, 'u', 'i', 'n', 't'), + scan_optional!( + stream, + scan_trie!( + stream, + '1' + scan_trie!( + stream, + '0' + scan_chars!(stream, '4'), + '1' + scan_chars!(stream, '2'), + '2' + scan_trie!(stream, ['0' | '8']), + '3' + scan_chars!(stream, '6'), + '4' + scan_chars!(stream, '4'), + '5' + scan_chars!(stream, '2'), + '6' + scan_trie!(stream, EMPTY, ['0' | '8']), + '7' + scan_chars!(stream, '6'), + '8' + scan_chars!(stream, '4'), + '9' + scan_chars!(stream, '2') + ), + '2' + scan_trie!( + stream, + '0' + scan_trie!(stream, ['0' | '8']), + '1' + scan_chars!(stream, '6'), + '2' + scan_chars!(stream, '4'), + '3' + scan_chars!(stream, '2'), + '4' + scan_trie!(stream, EMPTY, ['0' | '8']), + '5' + scan_chars!(stream, '6') + ), + '3' + scan_chars!(stream, '2'), + '4' + scan_trie!(stream, ['0' | '8']), + '5' + scan_chars!(stream, '6'), + '6' + scan_chars!(stream, '4'), + '7' + scan_chars!(stream, '2'), + '8' + scan_trie!(stream, EMPTY, ['0' | '8']), + '9' + scan_chars!(stream, '6') + ) + ) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) + ) } // USING_KEYWORD = "using"; @@ -3459,13 +3598,21 @@ impl Language { #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn yul_decimal_literal(&self, stream: &mut Stream) -> bool { - scan_choice!( + scan_not_followed_by!( stream, - scan_chars!(stream, '0'), - scan_sequence!( - scan_predicate!(stream, |c| ('1' <= c && c <= '9')), - scan_zero_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))) - ) + scan_choice!( + stream, + scan_chars!(stream, '0'), + scan_sequence!( + scan_predicate!(stream, |c| ('1' <= c && c <= '9')), + scan_zero_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))) + ) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } @@ -3474,18 +3621,26 @@ impl Language { #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] pub(crate) fn yul_hex_literal(&self, stream: &mut Stream) -> bool { - scan_sequence!( - scan_chars!(stream, '0', 'x'), - scan_one_or_more!( - stream, - scan_predicate!(stream, |c| ('0' <= c && c <= '9') - || ('A' <= c && c <= 'F') - || ('a' <= c && c <= 'f')) - ) + scan_not_followed_by!( + stream, + scan_sequence!( + scan_chars!(stream, '0', 'x'), + scan_one_or_more!( + stream, + scan_predicate!(stream, |c| ('0' <= c && c <= '9') + || ('A' <= c && c <= 'F') + || ('a' <= c && c <= 'f')) + ) + ), + scan_predicate!(stream, |c| c == '$' + || ('0' <= c && c <= '9') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('a' <= c && c <= 'z')) ) } - // YUL_IDENTIFIER = RAW_IDENTIFIER - (YUL_KEYWORD | YUL_RESERVED_KEYWORD); + // YUL_IDENTIFIER = «RAW_IDENTIFIER» - («YUL_KEYWORD» | «YUL_RESERVED_WORD»); #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] @@ -3502,17 +3657,17 @@ impl Language { } // (* v0.4.11 *) - // YUL_KEYWORD = BREAK_KEYWORD - // | CASE_KEYWORD - // | CONTINUE_KEYWORD - // | DEFAULT_KEYWORD - // | FALSE_KEYWORD - // | FOR_KEYWORD - // | FUNCTION_KEYWORD - // | IF_KEYWORD - // | LET_KEYWORD - // | SWITCH_KEYWORD - // | TRUE_KEYWORD; + // «YUL_KEYWORD» = BREAK_KEYWORD + // | CASE_KEYWORD + // | CONTINUE_KEYWORD + // | DEFAULT_KEYWORD + // | FALSE_KEYWORD + // | FOR_KEYWORD + // | FUNCTION_KEYWORD + // | IF_KEYWORD + // | LET_KEYWORD + // | SWITCH_KEYWORD + // | TRUE_KEYWORD; #[allow(dead_code, non_snake_case)] fn yul_keyword__0_4_11(&self, stream: &mut Stream) -> bool { @@ -3533,18 +3688,18 @@ impl Language { } // (* v0.6.0 *) - // YUL_KEYWORD = BREAK_KEYWORD - // | CASE_KEYWORD - // | CONTINUE_KEYWORD - // | DEFAULT_KEYWORD - // | FALSE_KEYWORD - // | FOR_KEYWORD - // | FUNCTION_KEYWORD - // | IF_KEYWORD - // | LEAVE_KEYWORD - // | LET_KEYWORD - // | SWITCH_KEYWORD - // | TRUE_KEYWORD; + // «YUL_KEYWORD» = BREAK_KEYWORD + // | CASE_KEYWORD + // | CONTINUE_KEYWORD + // | DEFAULT_KEYWORD + // | FALSE_KEYWORD + // | FOR_KEYWORD + // | FUNCTION_KEYWORD + // | IF_KEYWORD + // | LEAVE_KEYWORD + // | LET_KEYWORD + // | SWITCH_KEYWORD + // | TRUE_KEYWORD; #[allow(dead_code, non_snake_case)] fn yul_keyword__0_6_0(&self, stream: &mut Stream) -> bool { @@ -3573,11 +3728,11 @@ impl Language { } } - // YUL_RESERVED_KEYWORD = "hex"; + // «YUL_RESERVED_WORD» = "hex"; #[allow(dead_code)] #[allow(unused_assignments, unused_parens)] - pub(crate) fn yul_reserved_keyword(&self, stream: &mut Stream) -> bool { + pub(crate) fn yul_reserved_word(&self, stream: &mut Stream) -> bool { scan_chars!(stream, 'h', 'e', 'x') } } diff --git a/crates/solidity/outputs/npm/package/generated/index.d.ts b/crates/solidity/outputs/npm/package/generated/index.d.ts index 6c2fed4816..9370934d02 100644 --- a/crates/solidity/outputs/npm/package/generated/index.d.ts +++ b/crates/solidity/outputs/npm/package/generated/index.d.ts @@ -22,7 +22,6 @@ export enum TokenKind { AmpersandEqual = "AmpersandEqual", AnonymousKeyword = "AnonymousKeyword", AsKeyword = "AsKeyword", - AsciiEscape = "AsciiEscape", AsciiStringLiteral = "AsciiStringLiteral", AssemblyKeyword = "AssemblyKeyword", Asterisk = "Asterisk", @@ -35,7 +34,7 @@ export enum TokenKind { BarEqual = "BarEqual", BoolKeyword = "BoolKeyword", BreakKeyword = "BreakKeyword", - ByteType = "ByteType", + ByteKeyword = "ByteKeyword", CalldataKeyword = "CalldataKeyword", Caret = "Caret", CaretEqual = "CaretEqual", @@ -52,14 +51,10 @@ export enum TokenKind { ContinueKeyword = "ContinueKeyword", ContractKeyword = "ContractKeyword", DaysKeyword = "DaysKeyword", - DecimalExponent = "DecimalExponent", DecimalLiteral = "DecimalLiteral", - DecimalNumber = "DecimalNumber", DefaultKeyword = "DefaultKeyword", DeleteKeyword = "DeleteKeyword", DoKeyword = "DoKeyword", - DoubleQuotedAsciiStringLiteral = "DoubleQuotedAsciiStringLiteral", - DoubleQuotedUnicodeStringLiteral = "DoubleQuotedUnicodeStringLiteral", ElseKeyword = "ElseKeyword", EmitKeyword = "EmitKeyword", EndOfLine = "EndOfLine", @@ -68,10 +63,8 @@ export enum TokenKind { EqualEqual = "EqualEqual", EqualGreaterThan = "EqualGreaterThan", ErrorKeyword = "ErrorKeyword", - EscapeSequence = "EscapeSequence", EtherKeyword = "EtherKeyword", EventKeyword = "EventKeyword", - Evmasm = "Evmasm", ExperimentalKeyword = "ExperimentalKeyword", ExternalKeyword = "ExternalKeyword", FallbackKeyword = "FallbackKeyword", @@ -89,13 +82,10 @@ export enum TokenKind { GreaterThanGreaterThanGreaterThan = "GreaterThanGreaterThanGreaterThan", GreaterThanGreaterThanGreaterThanEqual = "GreaterThanGreaterThanGreaterThanEqual", GweiKeyword = "GweiKeyword", - HexByteEscape = "HexByteEscape", HexLiteral = "HexLiteral", HexStringLiteral = "HexStringLiteral", HoursKeyword = "HoursKeyword", Identifier = "Identifier", - IdentifierPart = "IdentifierPart", - IdentifierStart = "IdentifierStart", IfKeyword = "IfKeyword", ImmutableKeyword = "ImmutableKeyword", ImportKeyword = "ImportKeyword", @@ -120,8 +110,6 @@ export enum TokenKind { ModifierKeyword = "ModifierKeyword", MultilineComment = "MultilineComment", NewKeyword = "NewKeyword", - NotAnIdentifierInAnyVersion = "NotAnIdentifierInAnyVersion", - NotAnIdentifierInSomeVersions = "NotAnIdentifierInSomeVersions", OpenBrace = "OpenBrace", OpenBracket = "OpenBracket", OpenParen = "OpenParen", @@ -133,13 +121,11 @@ export enum TokenKind { Plus = "Plus", PlusEqual = "PlusEqual", PlusPlus = "PlusPlus", - PossiblySeparatedPairsOfHexDigits = "PossiblySeparatedPairsOfHexDigits", PragmaKeyword = "PragmaKeyword", PrivateKeyword = "PrivateKeyword", PublicKeyword = "PublicKeyword", PureKeyword = "PureKeyword", QuestionMark = "QuestionMark", - RawIdentifier = "RawIdentifier", ReceiveKeyword = "ReceiveKeyword", ReturnKeyword = "ReturnKeyword", ReturnsKeyword = "ReturnsKeyword", @@ -149,8 +135,6 @@ export enum TokenKind { SignedFixedType = "SignedFixedType", SignedIntegerType = "SignedIntegerType", SingleLineComment = "SingleLineComment", - SingleQuotedAsciiStringLiteral = "SingleQuotedAsciiStringLiteral", - SingleQuotedUnicodeStringLiteral = "SingleQuotedUnicodeStringLiteral", Slash = "Slash", SlashEqual = "SlashEqual", SolidityKeyword = "SolidityKeyword", @@ -165,7 +149,6 @@ export enum TokenKind { TryKeyword = "TryKeyword", TypeKeyword = "TypeKeyword", UncheckedKeyword = "UncheckedKeyword", - UnicodeEscape = "UnicodeEscape", UnicodeStringLiteral = "UnicodeStringLiteral", UnsignedFixedType = "UnsignedFixedType", UnsignedIntegerType = "UnsignedIntegerType", @@ -182,151 +165,135 @@ export enum TokenKind { YulDecimalLiteral = "YulDecimalLiteral", YulHexLiteral = "YulHexLiteral", YulIdentifier = "YulIdentifier", - YulKeyword = "YulKeyword", - YulReservedKeyword = "YulReservedKeyword", } export enum RuleKind { ABICoderPragma = "ABICoderPragma", - AddSubExpression = "AddSubExpression", - AddSubOperator = "AddSubOperator", AddressType = "AddressType", - AndExpression = "AndExpression", - AndOperator = "AndOperator", - ArgumentList = "ArgumentList", - Arguments = "Arguments", - ArrayLiteral = "ArrayLiteral", + ArgumentsDeclaration = "ArgumentsDeclaration", + ArrayExpression = "ArrayExpression", ArrayTypeName = "ArrayTypeName", - AssemblyFlags = "AssemblyFlags", + ArrayValuesList = "ArrayValuesList", + AsciiStringLiteralsList = "AsciiStringLiteralsList", + AssemblyFlagsList = "AssemblyFlagsList", AssemblyStatement = "AssemblyStatement", - AssignmentExpression = "AssignmentExpression", - AssignmentOperator = "AssignmentOperator", - AsteriskImport = "AsteriskImport", - BitAndExpression = "BitAndExpression", - BitAndOperator = "BitAndOperator", - BitOrExpression = "BitOrExpression", - BitOrOperator = "BitOrOperator", - BitXOrExpression = "BitXOrExpression", - BitXOrOperator = "BitXOrOperator", + BinaryExpression = "BinaryExpression", Block = "Block", - BooleanLiteral = "BooleanLiteral", BreakStatement = "BreakStatement", CatchClause = "CatchClause", + CatchClauseError = "CatchClauseError", + CatchClausesList = "CatchClausesList", ConditionalExpression = "ConditionalExpression", - ConditionalOperator = "ConditionalOperator", ConstantDefinition = "ConstantDefinition", - ConstructorAttribute = "ConstructorAttribute", + ConstructorAttributesList = "ConstructorAttributesList", ConstructorDefinition = "ConstructorDefinition", ContinueStatement = "ContinueStatement", - ContractBodyElements = "ContractBodyElements", ContractDefinition = "ContractDefinition", - DataLocation = "DataLocation", - Definition = "Definition", + ContractMembersList = "ContractMembersList", + DeconstructionImport = "DeconstructionImport", + DeconstructionImportSymbol = "DeconstructionImportSymbol", + DeconstructionImportSymbolsList = "DeconstructionImportSymbolsList", DeleteStatement = "DeleteStatement", - Directive = "Directive", DoWhileStatement = "DoWhileStatement", - ElementaryType = "ElementaryType", EmitStatement = "EmitStatement", EndOfFileTrivia = "EndOfFileTrivia", EnumDefinition = "EnumDefinition", - EqualityComparisonExpression = "EqualityComparisonExpression", - EqualityComparisonOperator = "EqualityComparisonOperator", ErrorDefinition = "ErrorDefinition", ErrorParameter = "ErrorParameter", + ErrorParametersList = "ErrorParametersList", EventDefinition = "EventDefinition", EventParameter = "EventParameter", + EventParametersList = "EventParametersList", ExperimentalPragma = "ExperimentalPragma", - ExponentiationExpression = "ExponentiationExpression", - ExponentiationOperator = "ExponentiationOperator", Expression = "Expression", ExpressionStatement = "ExpressionStatement", - FallbackFunctionAttribute = "FallbackFunctionAttribute", + FallbackFunctionAttributesList = "FallbackFunctionAttributesList", FallbackFunctionDefinition = "FallbackFunctionDefinition", ForStatement = "ForStatement", - FunctionAttribute = "FunctionAttribute", + FunctionAttributesList = "FunctionAttributesList", FunctionCallExpression = "FunctionCallExpression", - FunctionCallOperator = "FunctionCallOperator", FunctionCallOptions = "FunctionCallOptions", FunctionDefinition = "FunctionDefinition", FunctionType = "FunctionType", + FunctionTypeAttributesList = "FunctionTypeAttributesList", + HexStringLiteralsList = "HexStringLiteralsList", IdentifierPath = "IdentifierPath", + IdentifierPathsList = "IdentifierPathsList", + IdentifiersList = "IdentifiersList", IfStatement = "IfStatement", - ImportAlias = "ImportAlias", ImportDirective = "ImportDirective", - ImportPath = "ImportPath", IndexAccessExpression = "IndexAccessExpression", - IndexAccessOperator = "IndexAccessOperator", InheritanceSpecifier = "InheritanceSpecifier", - InheritanceSpecifierList = "InheritanceSpecifierList", + InheritanceType = "InheritanceType", + InheritanceTypesList = "InheritanceTypesList", InterfaceDefinition = "InterfaceDefinition", + InterfaceMembersList = "InterfaceMembersList", LeadingTrivia = "LeadingTrivia", LibraryDefinition = "LibraryDefinition", + LibraryMembersList = "LibraryMembersList", MappingKeyType = "MappingKeyType", MappingType = "MappingType", MappingValueType = "MappingValueType", MemberAccessExpression = "MemberAccessExpression", - MemberAccessOperator = "MemberAccessOperator", - ModifierAttribute = "ModifierAttribute", + ModifierAttributesList = "ModifierAttributesList", ModifierDefinition = "ModifierDefinition", ModifierInvocation = "ModifierInvocation", - MulDivModExpression = "MulDivModExpression", - MulDivModOperator = "MulDivModOperator", NamedArgument = "NamedArgument", - NamedArgumentList = "NamedArgumentList", + NamedArgumentsDeclaration = "NamedArgumentsDeclaration", + NamedArgumentsList = "NamedArgumentsList", + NamedImport = "NamedImport", NewExpression = "NewExpression", - NumberUnit = "NumberUnit", NumericExpression = "NumericExpression", - OrExpression = "OrExpression", - OrOperator = "OrOperator", - OrderComparisonExpression = "OrderComparisonExpression", - OrderComparisonOperator = "OrderComparisonOperator", OverrideSpecifier = "OverrideSpecifier", - ParameterDeclaration = "ParameterDeclaration", - ParameterList = "ParameterList", - PayableType = "PayableType", - PositionalArgumentList = "PositionalArgumentList", + Parameter = "Parameter", + ParametersDeclaration = "ParametersDeclaration", + ParametersList = "ParametersList", + PathImport = "PathImport", + PositionalArgumentsList = "PositionalArgumentsList", PragmaDirective = "PragmaDirective", - PrimaryExpression = "PrimaryExpression", - ReceiveFunctionAttribute = "ReceiveFunctionAttribute", + ReceiveFunctionAttributesList = "ReceiveFunctionAttributesList", ReceiveFunctionDefinition = "ReceiveFunctionDefinition", - Results = "Results", ReturnStatement = "ReturnStatement", + ReturnsDeclaration = "ReturnsDeclaration", RevertStatement = "RevertStatement", - SelectiveImport = "SelectiveImport", - ShiftExpression = "ShiftExpression", - ShiftOperator = "ShiftOperator", - SimpleImport = "SimpleImport", - SimpleStatement = "SimpleStatement", SourceUnit = "SourceUnit", - StateVariableAttribute = "StateVariableAttribute", - StateVariableDeclaration = "StateVariableDeclaration", + SourceUnitMembersList = "SourceUnitMembersList", + StateVariableAttributesList = "StateVariableAttributesList", + StateVariableDefinition = "StateVariableDefinition", Statement = "Statement", - StringExpression = "StringExpression", + StatementsList = "StatementsList", StructDefinition = "StructDefinition", StructMember = "StructMember", + StructMembersList = "StructMembersList", ThrowStatement = "ThrowStatement", TrailingTrivia = "TrailingTrivia", TryStatement = "TryStatement", TupleDeconstructionStatement = "TupleDeconstructionStatement", TupleExpression = "TupleExpression", + TupleMember = "TupleMember", + TupleMembersList = "TupleMembersList", + TupleValuesList = "TupleValuesList", TypeExpression = "TypeExpression", TypeName = "TypeName", UnaryPostfixExpression = "UnaryPostfixExpression", - UnaryPostfixOperator = "UnaryPostfixOperator", UnaryPrefixExpression = "UnaryPrefixExpression", - UnaryPrefixOperator = "UnaryPrefixOperator", UncheckedBlock = "UncheckedBlock", - UnnamedFunctionAttribute = "UnnamedFunctionAttribute", + UnicodeStringLiteralsList = "UnicodeStringLiteralsList", + UnnamedFunctionAttributesList = "UnnamedFunctionAttributesList", UnnamedFunctionDefinition = "UnnamedFunctionDefinition", - UserDefinedOperator = "UserDefinedOperator", UserDefinedValueTypeDefinition = "UserDefinedValueTypeDefinition", UsingDirective = "UsingDirective", + UsingDirectiveDeconstruction = "UsingDirectiveDeconstruction", + UsingDirectivePath = "UsingDirectivePath", + UsingDirectiveSymbol = "UsingDirectiveSymbol", + UsingDirectiveSymbolsList = "UsingDirectiveSymbolsList", + VariableDeclaration = "VariableDeclaration", VariableDeclarationStatement = "VariableDeclarationStatement", VersionPragma = "VersionPragma", - VersionPragmaAlternatives = "VersionPragmaAlternatives", - VersionPragmaComparator = "VersionPragmaComparator", - VersionPragmaExpressionList = "VersionPragmaExpressionList", - VersionPragmaRange = "VersionPragmaRange", + VersionPragmaBinaryExpression = "VersionPragmaBinaryExpression", + VersionPragmaExpression = "VersionPragmaExpression", + VersionPragmaExpressionsList = "VersionPragmaExpressionsList", VersionPragmaSpecifier = "VersionPragmaSpecifier", + VersionPragmaUnaryExpression = "VersionPragmaUnaryExpression", WhileStatement = "WhileStatement", YulAssignmentStatement = "YulAssignmentStatement", YulBlock = "YulBlock", @@ -334,60 +301,62 @@ export enum RuleKind { YulContinueStatement = "YulContinueStatement", YulDeclarationStatement = "YulDeclarationStatement", YulExpression = "YulExpression", + YulExpressionsList = "YulExpressionsList", YulForStatement = "YulForStatement", YulFunctionCallExpression = "YulFunctionCallExpression", YulFunctionDefinition = "YulFunctionDefinition", YulIdentifierPath = "YulIdentifierPath", + YulIdentifierPathsList = "YulIdentifierPathsList", + YulIdentifiersList = "YulIdentifiersList", YulIfStatement = "YulIfStatement", YulLeaveStatement = "YulLeaveStatement", - YulLiteral = "YulLiteral", + YulParametersDeclaration = "YulParametersDeclaration", + YulReturnsDeclaration = "YulReturnsDeclaration", YulStatement = "YulStatement", + YulStatementsList = "YulStatementsList", + YulSwitchCase = "YulSwitchCase", + YulSwitchCasesList = "YulSwitchCasesList", YulSwitchStatement = "YulSwitchStatement", } export enum ProductionKind { ABICoderPragma = "ABICoderPragma", AbicoderKeyword = "AbicoderKeyword", AbstractKeyword = "AbstractKeyword", - AddSubOperator = "AddSubOperator", AddressKeyword = "AddressKeyword", AddressType = "AddressType", Ampersand = "Ampersand", AmpersandAmpersand = "AmpersandAmpersand", AmpersandEqual = "AmpersandEqual", - AndOperator = "AndOperator", AnonymousKeyword = "AnonymousKeyword", - ArgumentList = "ArgumentList", - ArrayLiteral = "ArrayLiteral", + ArgumentsDeclaration = "ArgumentsDeclaration", + ArrayExpression = "ArrayExpression", + ArrayValuesList = "ArrayValuesList", AsKeyword = "AsKeyword", - AsciiEscape = "AsciiEscape", AsciiStringLiteral = "AsciiStringLiteral", - AssemblyFlags = "AssemblyFlags", + AsciiStringLiteralsList = "AsciiStringLiteralsList", + AssemblyFlagsList = "AssemblyFlagsList", AssemblyKeyword = "AssemblyKeyword", AssemblyStatement = "AssemblyStatement", - AssignmentOperator = "AssignmentOperator", Asterisk = "Asterisk", AsteriskAsterisk = "AsteriskAsterisk", AsteriskEqual = "AsteriskEqual", - AsteriskImport = "AsteriskImport", Bang = "Bang", BangEqual = "BangEqual", Bar = "Bar", BarBar = "BarBar", BarEqual = "BarEqual", - BitAndOperator = "BitAndOperator", - BitOrOperator = "BitOrOperator", - BitXOrOperator = "BitXOrOperator", Block = "Block", BoolKeyword = "BoolKeyword", - BooleanLiteral = "BooleanLiteral", BreakKeyword = "BreakKeyword", BreakStatement = "BreakStatement", - ByteType = "ByteType", + ByteKeyword = "ByteKeyword", CalldataKeyword = "CalldataKeyword", Caret = "Caret", CaretEqual = "CaretEqual", CaseKeyword = "CaseKeyword", CatchClause = "CatchClause", + CatchClauseError = "CatchClauseError", + CatchClausesList = "CatchClausesList", CatchKeyword = "CatchKeyword", CloseBrace = "CloseBrace", CloseBracket = "CloseBracket", @@ -395,31 +364,26 @@ export enum ProductionKind { Colon = "Colon", ColonEqual = "ColonEqual", Comma = "Comma", - ConditionalOperator = "ConditionalOperator", ConstantDefinition = "ConstantDefinition", ConstantKeyword = "ConstantKeyword", - ConstructorAttribute = "ConstructorAttribute", + ConstructorAttributesList = "ConstructorAttributesList", ConstructorDefinition = "ConstructorDefinition", ConstructorKeyword = "ConstructorKeyword", ContinueKeyword = "ContinueKeyword", ContinueStatement = "ContinueStatement", ContractDefinition = "ContractDefinition", ContractKeyword = "ContractKeyword", - DataLocation = "DataLocation", + ContractMembersList = "ContractMembersList", DaysKeyword = "DaysKeyword", - DecimalExponent = "DecimalExponent", DecimalLiteral = "DecimalLiteral", - DecimalNumber = "DecimalNumber", + DeconstructionImport = "DeconstructionImport", + DeconstructionImportSymbol = "DeconstructionImportSymbol", + DeconstructionImportSymbolsList = "DeconstructionImportSymbolsList", DefaultKeyword = "DefaultKeyword", - Definition = "Definition", DeleteKeyword = "DeleteKeyword", DeleteStatement = "DeleteStatement", - Directive = "Directive", DoKeyword = "DoKeyword", DoWhileStatement = "DoWhileStatement", - DoubleQuotedAsciiStringLiteral = "DoubleQuotedAsciiStringLiteral", - DoubleQuotedUnicodeStringLiteral = "DoubleQuotedUnicodeStringLiteral", - ElementaryType = "ElementaryType", ElseKeyword = "ElseKeyword", EmitKeyword = "EmitKeyword", EmitStatement = "EmitStatement", @@ -430,23 +394,21 @@ export enum ProductionKind { Equal = "Equal", EqualEqual = "EqualEqual", EqualGreaterThan = "EqualGreaterThan", - EqualityComparisonOperator = "EqualityComparisonOperator", ErrorDefinition = "ErrorDefinition", ErrorKeyword = "ErrorKeyword", ErrorParameter = "ErrorParameter", - EscapeSequence = "EscapeSequence", + ErrorParametersList = "ErrorParametersList", EtherKeyword = "EtherKeyword", EventDefinition = "EventDefinition", EventKeyword = "EventKeyword", EventParameter = "EventParameter", - Evmasm = "Evmasm", + EventParametersList = "EventParametersList", ExperimentalKeyword = "ExperimentalKeyword", ExperimentalPragma = "ExperimentalPragma", - ExponentiationOperator = "ExponentiationOperator", Expression = "Expression", ExpressionStatement = "ExpressionStatement", ExternalKeyword = "ExternalKeyword", - FallbackFunctionAttribute = "FallbackFunctionAttribute", + FallbackFunctionAttributesList = "FallbackFunctionAttributesList", FallbackFunctionDefinition = "FallbackFunctionDefinition", FallbackKeyword = "FallbackKeyword", FalseKeyword = "FalseKeyword", @@ -455,12 +417,12 @@ export enum ProductionKind { ForKeyword = "ForKeyword", ForStatement = "ForStatement", FromKeyword = "FromKeyword", - FunctionAttribute = "FunctionAttribute", - FunctionCallOperator = "FunctionCallOperator", + FunctionAttributesList = "FunctionAttributesList", FunctionCallOptions = "FunctionCallOptions", FunctionDefinition = "FunctionDefinition", FunctionKeyword = "FunctionKeyword", FunctionType = "FunctionType", + FunctionTypeAttributesList = "FunctionTypeAttributesList", GlobalKeyword = "GlobalKeyword", GreaterThan = "GreaterThan", GreaterThanEqual = "GreaterThanEqual", @@ -469,27 +431,26 @@ export enum ProductionKind { GreaterThanGreaterThanGreaterThan = "GreaterThanGreaterThanGreaterThan", GreaterThanGreaterThanGreaterThanEqual = "GreaterThanGreaterThanGreaterThanEqual", GweiKeyword = "GweiKeyword", - HexByteEscape = "HexByteEscape", HexLiteral = "HexLiteral", HexStringLiteral = "HexStringLiteral", + HexStringLiteralsList = "HexStringLiteralsList", HoursKeyword = "HoursKeyword", Identifier = "Identifier", - IdentifierPart = "IdentifierPart", IdentifierPath = "IdentifierPath", - IdentifierStart = "IdentifierStart", + IdentifierPathsList = "IdentifierPathsList", + IdentifiersList = "IdentifiersList", IfKeyword = "IfKeyword", IfStatement = "IfStatement", ImmutableKeyword = "ImmutableKeyword", - ImportAlias = "ImportAlias", ImportDirective = "ImportDirective", ImportKeyword = "ImportKeyword", - ImportPath = "ImportPath", - IndexAccessOperator = "IndexAccessOperator", IndexedKeyword = "IndexedKeyword", InheritanceSpecifier = "InheritanceSpecifier", - InheritanceSpecifierList = "InheritanceSpecifierList", + InheritanceType = "InheritanceType", + InheritanceTypesList = "InheritanceTypesList", InterfaceDefinition = "InterfaceDefinition", InterfaceKeyword = "InterfaceKeyword", + InterfaceMembersList = "InterfaceMembersList", InternalKeyword = "InternalKeyword", IsKeyword = "IsKeyword", LeadingTrivia = "LeadingTrivia", @@ -501,90 +462,81 @@ export enum ProductionKind { LetKeyword = "LetKeyword", LibraryDefinition = "LibraryDefinition", LibraryKeyword = "LibraryKeyword", + LibraryMembersList = "LibraryMembersList", MappingKeyType = "MappingKeyType", MappingKeyword = "MappingKeyword", MappingType = "MappingType", MappingValueType = "MappingValueType", - MemberAccessOperator = "MemberAccessOperator", MemoryKeyword = "MemoryKeyword", Minus = "Minus", MinusEqual = "MinusEqual", MinusGreaterThan = "MinusGreaterThan", MinusMinus = "MinusMinus", MinutesKeyword = "MinutesKeyword", - ModifierAttribute = "ModifierAttribute", + ModifierAttributesList = "ModifierAttributesList", ModifierDefinition = "ModifierDefinition", ModifierInvocation = "ModifierInvocation", ModifierKeyword = "ModifierKeyword", - MulDivModOperator = "MulDivModOperator", MultilineComment = "MultilineComment", NamedArgument = "NamedArgument", - NamedArgumentList = "NamedArgumentList", + NamedArgumentsDeclaration = "NamedArgumentsDeclaration", + NamedArgumentsList = "NamedArgumentsList", + NamedImport = "NamedImport", NewExpression = "NewExpression", NewKeyword = "NewKeyword", - NotAnIdentifierInAnyVersion = "NotAnIdentifierInAnyVersion", - NotAnIdentifierInSomeVersions = "NotAnIdentifierInSomeVersions", - NumberUnit = "NumberUnit", NumericExpression = "NumericExpression", OpenBrace = "OpenBrace", OpenBracket = "OpenBracket", OpenParen = "OpenParen", - OrOperator = "OrOperator", - OrderComparisonOperator = "OrderComparisonOperator", OverrideKeyword = "OverrideKeyword", OverrideSpecifier = "OverrideSpecifier", - ParameterDeclaration = "ParameterDeclaration", - ParameterList = "ParameterList", + Parameter = "Parameter", + ParametersDeclaration = "ParametersDeclaration", + ParametersList = "ParametersList", + PathImport = "PathImport", PayableKeyword = "PayableKeyword", - PayableType = "PayableType", Percent = "Percent", PercentEqual = "PercentEqual", Period = "Period", Plus = "Plus", PlusEqual = "PlusEqual", PlusPlus = "PlusPlus", - PositionalArgumentList = "PositionalArgumentList", - PossiblySeparatedPairsOfHexDigits = "PossiblySeparatedPairsOfHexDigits", + PositionalArgumentsList = "PositionalArgumentsList", PragmaDirective = "PragmaDirective", PragmaKeyword = "PragmaKeyword", - PrimaryExpression = "PrimaryExpression", PrivateKeyword = "PrivateKeyword", PublicKeyword = "PublicKeyword", PureKeyword = "PureKeyword", QuestionMark = "QuestionMark", - RawIdentifier = "RawIdentifier", - ReceiveFunctionAttribute = "ReceiveFunctionAttribute", + ReceiveFunctionAttributesList = "ReceiveFunctionAttributesList", ReceiveFunctionDefinition = "ReceiveFunctionDefinition", ReceiveKeyword = "ReceiveKeyword", ReturnKeyword = "ReturnKeyword", ReturnStatement = "ReturnStatement", + ReturnsDeclaration = "ReturnsDeclaration", ReturnsKeyword = "ReturnsKeyword", RevertKeyword = "RevertKeyword", RevertStatement = "RevertStatement", SecondsKeyword = "SecondsKeyword", - SelectiveImport = "SelectiveImport", Semicolon = "Semicolon", - ShiftOperator = "ShiftOperator", SignedFixedType = "SignedFixedType", SignedIntegerType = "SignedIntegerType", - SimpleImport = "SimpleImport", - SimpleStatement = "SimpleStatement", SingleLineComment = "SingleLineComment", - SingleQuotedAsciiStringLiteral = "SingleQuotedAsciiStringLiteral", - SingleQuotedUnicodeStringLiteral = "SingleQuotedUnicodeStringLiteral", Slash = "Slash", SlashEqual = "SlashEqual", SolidityKeyword = "SolidityKeyword", SourceUnit = "SourceUnit", - StateVariableAttribute = "StateVariableAttribute", - StateVariableDeclaration = "StateVariableDeclaration", + SourceUnitMembersList = "SourceUnitMembersList", + StateVariableAttributesList = "StateVariableAttributesList", + StateVariableDefinition = "StateVariableDefinition", Statement = "Statement", + StatementsList = "StatementsList", StorageKeyword = "StorageKeyword", - StringExpression = "StringExpression", StringKeyword = "StringKeyword", StructDefinition = "StructDefinition", StructKeyword = "StructKeyword", StructMember = "StructMember", + StructMembersList = "StructMembersList", SwitchKeyword = "SwitchKeyword", SzaboKeyword = "SzaboKeyword", ThrowKeyword = "ThrowKeyword", @@ -596,26 +548,33 @@ export enum ProductionKind { TryStatement = "TryStatement", TupleDeconstructionStatement = "TupleDeconstructionStatement", TupleExpression = "TupleExpression", + TupleMember = "TupleMember", + TupleMembersList = "TupleMembersList", + TupleValuesList = "TupleValuesList", TypeExpression = "TypeExpression", TypeKeyword = "TypeKeyword", TypeName = "TypeName", - UnaryPostfixOperator = "UnaryPostfixOperator", - UnaryPrefixOperator = "UnaryPrefixOperator", UncheckedBlock = "UncheckedBlock", UncheckedKeyword = "UncheckedKeyword", - UnicodeEscape = "UnicodeEscape", UnicodeStringLiteral = "UnicodeStringLiteral", - UnnamedFunctionAttribute = "UnnamedFunctionAttribute", + UnicodeStringLiteralsList = "UnicodeStringLiteralsList", + UnnamedFunctionAttributesList = "UnnamedFunctionAttributesList", UnnamedFunctionDefinition = "UnnamedFunctionDefinition", UnsignedFixedType = "UnsignedFixedType", UnsignedIntegerType = "UnsignedIntegerType", - UserDefinedOperator = "UserDefinedOperator", UserDefinedValueTypeDefinition = "UserDefinedValueTypeDefinition", UsingDirective = "UsingDirective", + UsingDirectiveDeconstruction = "UsingDirectiveDeconstruction", + UsingDirectivePath = "UsingDirectivePath", + UsingDirectiveSymbol = "UsingDirectiveSymbol", + UsingDirectiveSymbolsList = "UsingDirectiveSymbolsList", UsingKeyword = "UsingKeyword", VarKeyword = "VarKeyword", + VariableDeclaration = "VariableDeclaration", VariableDeclarationStatement = "VariableDeclarationStatement", VersionPragma = "VersionPragma", + VersionPragmaExpression = "VersionPragmaExpression", + VersionPragmaExpressionsList = "VersionPragmaExpressionsList", VersionPragmaSpecifier = "VersionPragmaSpecifier", VersionPragmaValue = "VersionPragmaValue", ViewKeyword = "ViewKeyword", @@ -633,17 +592,22 @@ export enum ProductionKind { YulDecimalLiteral = "YulDecimalLiteral", YulDeclarationStatement = "YulDeclarationStatement", YulExpression = "YulExpression", + YulExpressionsList = "YulExpressionsList", YulForStatement = "YulForStatement", YulFunctionDefinition = "YulFunctionDefinition", YulHexLiteral = "YulHexLiteral", YulIdentifier = "YulIdentifier", YulIdentifierPath = "YulIdentifierPath", + YulIdentifierPathsList = "YulIdentifierPathsList", + YulIdentifiersList = "YulIdentifiersList", YulIfStatement = "YulIfStatement", - YulKeyword = "YulKeyword", YulLeaveStatement = "YulLeaveStatement", - YulLiteral = "YulLiteral", - YulReservedKeyword = "YulReservedKeyword", + YulParametersDeclaration = "YulParametersDeclaration", + YulReturnsDeclaration = "YulReturnsDeclaration", YulStatement = "YulStatement", + YulStatementsList = "YulStatementsList", + YulSwitchCase = "YulSwitchCase", + YulSwitchCasesList = "YulSwitchCasesList", YulSwitchStatement = "YulSwitchStatement", } export class RuleNode { diff --git a/crates/solidity/outputs/npm/tests/src/cst-output.ts b/crates/solidity/outputs/npm/tests/src/cst-output.ts index 095e6da938..3234c30ece 100644 --- a/crates/solidity/outputs/npm/tests/src/cst-output.ts +++ b/crates/solidity/outputs/npm/tests/src/cst-output.ts @@ -7,11 +7,11 @@ test("parse token", (t) => { const source = "5_286_981"; const language = new Language("0.8.1"); - const { parseTree } = language.parse(ProductionKind.DecimalNumber, source); + const { parseTree } = language.parse(ProductionKind.DecimalLiteral, source); if (parseTree instanceof TokenNode) { t.is(parseTree.type, NodeType.Token); - t.is(parseTree.kind, TokenKind.DecimalNumber); + t.is(parseTree.kind, TokenKind.DecimalLiteral); } else { t.fail("Expected TokenNode"); } diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md deleted file mode 100644 index 9aebb9da01..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md +++ /dev/null @@ -1,12 +0,0 @@ - - -```{ .ebnf .slang-ebnf #Definition } -Definition = ConstantDefinition - | ContractDefinition - | EnumDefinition - | ErrorDefinition - | FunctionDefinition - | InterfaceDefinition - | LibraryDefinition - | StructDefinition; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.8.8.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.8.8.md deleted file mode 100644 index b24824dee9..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.8.8.md +++ /dev/null @@ -1,13 +0,0 @@ - - -```{ .ebnf .slang-ebnf #Definition } -Definition = ConstantDefinition - | ContractDefinition - | EnumDefinition - | ErrorDefinition - | FunctionDefinition - | InterfaceDefinition - | LibraryDefinition - | StructDefinition - | UserDefinedValueTypeDefinition; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md deleted file mode 100644 index 06579adab2..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md +++ /dev/null @@ -1,7 +0,0 @@ - - -```{ .ebnf .slang-ebnf #Directive } -Directive = PragmaDirective - | ImportDirective - | UsingDirective; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md new file mode 100644 index 0000000000..389ab4c2bd --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md @@ -0,0 +1,15 @@ + + +```{ .ebnf .slang-ebnf #SourceUnitMember } +«SourceUnitMember» = ContractDefinition + | LibraryDefinition + | InterfaceDefinition + | StructDefinition + | EnumDefinition + | ConstantDefinition + | FunctionDefinition + | ErrorDefinition + | ImportDirective + | PragmaDirective + | UsingDirective; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.8.8.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.8.8.md new file mode 100644 index 0000000000..818956b648 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.8.8.md @@ -0,0 +1,16 @@ + + +```{ .ebnf .slang-ebnf #SourceUnitMember } +«SourceUnitMember» = ContractDefinition + | LibraryDefinition + | InterfaceDefinition + | StructDefinition + | EnumDefinition + | ConstantDefinition + | FunctionDefinition + | ErrorDefinition + | ImportDirective + | PragmaDirective + | UsingDirective + | UserDefinedValueTypeDefinition; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md new file mode 100644 index 0000000000..ed8acf487e --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #SourceUnitMembersList } +SourceUnitMembersList = «SourceUnitMember»+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md index f491165f25..daf931c9a8 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #SourceUnit } -SourceUnit = (Directive | Definition)* EndOfFileTrivia?; +SourceUnit = SourceUnitMembersList? EndOfFileTrivia?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md index bc856c87a7..0474659c91 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #PragmaDirective } -PragmaDirective = PRAGMA_KEYWORD (VersionPragma | ABICoderPragma | ExperimentalPragma) SEMICOLON; +PragmaDirective = PRAGMA_KEYWORD (ABICoderPragma | ExperimentalPragma | VersionPragma) SEMICOLON; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md index 1bcf0906ec..a784bc85a2 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md @@ -1,11 +1,10 @@ ```{ .ebnf .slang-ebnf #VersionPragmaExpression } -«VersionPragmaExpression» = VersionPragmaAlternatives - | VersionPragmaRange - | VersionPragmaComparator - | VersionPragmaSpecifier; -VersionPragmaAlternatives = «VersionPragmaExpression» BAR_BAR «VersionPragmaExpression»; -VersionPragmaRange = «VersionPragmaExpression» MINUS «VersionPragmaExpression»; -VersionPragmaComparator = (CARET | TILDE | EQUAL | LESS_THAN | GREATER_THAN | LESS_THAN_EQUAL | GREATER_THAN_EQUAL) «VersionPragmaExpression»; +VersionPragmaExpression = VersionPragmaBinaryExpression + | VersionPragmaUnaryExpression + | VersionPragmaSpecifier; +VersionPragmaBinaryExpression = VersionPragmaExpression «VersionPragmaOrOperator» VersionPragmaExpression; +VersionPragmaBinaryExpression = VersionPragmaExpression «VersionPragmaRangeOperator» VersionPragmaExpression; +VersionPragmaUnaryExpression = «VersionPragmaUnaryOperator» VersionPragmaExpression; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md new file mode 100644 index 0000000000..846c8af5e7 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #VersionPragmaExpressionsList } +VersionPragmaExpressionsList = VersionPragmaExpression+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md new file mode 100644 index 0000000000..702194c570 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #VersionPragmaOrOperator } +«VersionPragmaOrOperator» = BAR_BAR; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md new file mode 100644 index 0000000000..359b19fb4a --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #VersionPragmaRangeOperator } +«VersionPragmaRangeOperator» = MINUS; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md new file mode 100644 index 0000000000..1fe86a2c6d --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md @@ -0,0 +1,11 @@ + + +```{ .ebnf .slang-ebnf #VersionPragmaUnaryOperator } +«VersionPragmaUnaryOperator» = CARET + | TILDE + | EQUAL + | LESS_THAN + | GREATER_THAN + | LESS_THAN_EQUAL + | GREATER_THAN_EQUAL; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md index 6e61cf0835..382148b6c5 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md @@ -1,6 +1,5 @@ ```{ .ebnf .slang-ebnf #VersionPragma } -VersionPragma = SOLIDITY_KEYWORD VersionPragmaExpressionList; -VersionPragmaExpressionList = «VersionPragmaExpression»+; +VersionPragma = SOLIDITY_KEYWORD VersionPragmaExpressionsList; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md new file mode 100644 index 0000000000..4f4c17a101 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #DeconstructionImportSymbol } +DeconstructionImportSymbol = IDENTIFIER (AS_KEYWORD IDENTIFIER)?; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md new file mode 100644 index 0000000000..ffdb5f0c38 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #DeconstructionImportSymbolsList } +DeconstructionImportSymbolsList = DeconstructionImportSymbol (COMMA DeconstructionImportSymbol)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md new file mode 100644 index 0000000000..d944acc1ef --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #DeconstructionImport } +DeconstructionImport = OPEN_BRACE DeconstructionImportSymbolsList CLOSE_BRACE FROM_KEYWORD ASCII_STRING_LITERAL; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md index 5f5f983ddd..0da8e0d32e 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ImportDirective } -ImportDirective = IMPORT_KEYWORD (SimpleImport | AsteriskImport | SelectiveImport) SEMICOLON; +ImportDirective = IMPORT_KEYWORD (PathImport | NamedImport | DeconstructionImport) SEMICOLON; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md new file mode 100644 index 0000000000..9dc2596c9a --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #NamedImport } +NamedImport = ASTERISK AS_KEYWORD IDENTIFIER FROM_KEYWORD ASCII_STRING_LITERAL; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md new file mode 100644 index 0000000000..2a45e76bb5 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #PathImport } +PathImport = ASCII_STRING_LITERAL (AS_KEYWORD IDENTIFIER)?; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md deleted file mode 100644 index 5b816c8441..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #SelectiveImport } -SelectiveImport = OPEN_BRACE IDENTIFIER ImportAlias? (COMMA IDENTIFIER ImportAlias?)* CLOSE_BRACE FROM_KEYWORD ImportPath; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/user-defined-operator/0.8.19.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/user-defined-operator/0.8.19.md deleted file mode 100644 index d222defedf..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/user-defined-operator/0.8.19.md +++ /dev/null @@ -1,19 +0,0 @@ - - -```{ .ebnf .slang-ebnf #UserDefinedOperator } -UserDefinedOperator = AMPERSAND - | BANG_EQUAL - | BAR - | CARET - | EQUAL_EQUAL - | GREATER_THAN - | GREATER_THAN_EQUAL - | LESS_THAN - | LESS_THAN_EQUAL - | MINUS - | PERCENT - | PLUS - | SLASH - | ASTERISK - | TILDE; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md new file mode 100644 index 0000000000..9cc1590112 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #UsingDirectiveDeconstruction } +UsingDirectiveDeconstruction = OPEN_BRACE UsingDirectiveSymbolsList CLOSE_BRACE; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-operator/0.8.19.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-operator/0.8.19.md new file mode 100644 index 0000000000..01a7b58545 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-operator/0.8.19.md @@ -0,0 +1,19 @@ + + +```{ .ebnf .slang-ebnf #UsingDirectiveOperator } +«UsingDirectiveOperator» = AMPERSAND + | ASTERISK + | BANG_EQUAL + | BAR + | CARET + | EQUAL_EQUAL + | GREATER_THAN + | GREATER_THAN_EQUAL + | LESS_THAN + | LESS_THAN_EQUAL + | MINUS + | PERCENT + | PLUS + | SLASH + | TILDE; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md new file mode 100644 index 0000000000..c44b7e4ca7 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #UsingDirectivePath } +UsingDirectivePath = IdentifierPath; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md new file mode 100644 index 0000000000..5d723a875a --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #UsingDirectiveSymbol } +UsingDirectiveSymbol = IdentifierPath; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.8.19.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.8.19.md new file mode 100644 index 0000000000..d03fc1819a --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.8.19.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #UsingDirectiveSymbol } +UsingDirectiveSymbol = IdentifierPath (AS_KEYWORD «UsingDirectiveOperator»)?; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md new file mode 100644 index 0000000000..6623fe5885 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #UsingDirectiveSymbolsList } +UsingDirectiveSymbolsList = UsingDirectiveSymbol (COMMA UsingDirectiveSymbol)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md deleted file mode 100644 index c48fe71ecb..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #UsingDirective } -UsingDirective = USING_KEYWORD (IdentifierPath | (OPEN_BRACE IdentifierPath (COMMA IdentifierPath)* CLOSE_BRACE)) FOR_KEYWORD (ASTERISK | TypeName) GLOBAL_KEYWORD? SEMICOLON; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.8.19.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.8.19.md deleted file mode 100644 index 2233ad43ce..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.8.19.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #UsingDirective } -UsingDirective = USING_KEYWORD (IdentifierPath | (OPEN_BRACE IdentifierPath (AS_KEYWORD UserDefinedOperator)? (COMMA IdentifierPath (AS_KEYWORD UserDefinedOperator)?)* CLOSE_BRACE)) FOR_KEYWORD (ASTERISK | TypeName) GLOBAL_KEYWORD? SEMICOLON; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md new file mode 100644 index 0000000000..c175e6eeaa --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #UsingDirective } +UsingDirective = USING_KEYWORD (UsingDirectivePath | UsingDirectiveDeconstruction) FOR_KEYWORD (ASTERISK | TypeName) GLOBAL_KEYWORD? SEMICOLON; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md similarity index 62% rename from crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md rename to crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md index b1738161bd..924e5dbf8d 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md @@ -1,5 +1,5 @@ -```{ .ebnf .slang-ebnf #BYTE_TYPE } -BYTE_TYPE = "byte"; +```{ .ebnf .slang-ebnf #BYTE_KEYWORD } +BYTE_KEYWORD = "byte"; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.4.11.md deleted file mode 100644 index da822bb446..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.4.11.md +++ /dev/null @@ -1,13 +0,0 @@ - - -```{ .ebnf .slang-ebnf #ContractBodyElement } -«ContractBodyElement» = UsingDirective - | FunctionDefinition - | UnnamedFunctionDefinition - | ModifierDefinition - | StructDefinition - | EnumDefinition - | EventDefinition - | ErrorDefinition - | StateVariableDeclaration; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.4.22.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.4.22.md deleted file mode 100644 index d170e43f43..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.4.22.md +++ /dev/null @@ -1,14 +0,0 @@ - - -```{ .ebnf .slang-ebnf #ContractBodyElement } -«ContractBodyElement» = UsingDirective - | ConstructorDefinition - | FunctionDefinition - | UnnamedFunctionDefinition - | ModifierDefinition - | StructDefinition - | EnumDefinition - | EventDefinition - | ErrorDefinition - | StateVariableDeclaration; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.6.0.md deleted file mode 100644 index 8237f16b44..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.6.0.md +++ /dev/null @@ -1,15 +0,0 @@ - - -```{ .ebnf .slang-ebnf #ContractBodyElement } -«ContractBodyElement» = UsingDirective - | ConstructorDefinition - | FunctionDefinition - | FallbackFunctionDefinition - | ReceiveFunctionDefinition - | ModifierDefinition - | StructDefinition - | EnumDefinition - | EventDefinition - | ErrorDefinition - | StateVariableDeclaration; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.8.8.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.8.8.md deleted file mode 100644 index 53a4d393c1..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.8.8.md +++ /dev/null @@ -1,16 +0,0 @@ - - -```{ .ebnf .slang-ebnf #ContractBodyElement } -«ContractBodyElement» = UsingDirective - | ConstructorDefinition - | FunctionDefinition - | FallbackFunctionDefinition - | ReceiveFunctionDefinition - | ModifierDefinition - | StructDefinition - | EnumDefinition - | UserDefinedValueTypeDefinition - | EventDefinition - | ErrorDefinition - | StateVariableDeclaration; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.4.11.md index 580087f138..36494d8513 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.4.11.md @@ -1,6 +1,5 @@ ```{ .ebnf .slang-ebnf #ContractDefinition } -ContractDefinition = CONTRACT_KEYWORD IDENTIFIER InheritanceSpecifierList? OPEN_BRACE ContractBodyElements CLOSE_BRACE; -ContractBodyElements = «ContractBodyElement»*; +ContractDefinition = CONTRACT_KEYWORD IDENTIFIER InheritanceSpecifier? OPEN_BRACE ContractMembersList? CLOSE_BRACE; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md index 26a0345100..2c3645dfe3 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md @@ -1,6 +1,5 @@ ```{ .ebnf .slang-ebnf #ContractDefinition } -ContractDefinition = ABSTRACT_KEYWORD? CONTRACT_KEYWORD IDENTIFIER InheritanceSpecifierList? OPEN_BRACE ContractBodyElements CLOSE_BRACE; -ContractBodyElements = «ContractBodyElement»*; +ContractDefinition = ABSTRACT_KEYWORD? CONTRACT_KEYWORD IDENTIFIER InheritanceSpecifier? OPEN_BRACE ContractMembersList? CLOSE_BRACE; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.4.11.md new file mode 100644 index 0000000000..70869be051 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.4.11.md @@ -0,0 +1,13 @@ + + +```{ .ebnf .slang-ebnf #ContractMember } +«ContractMember» = UsingDirective + | FunctionDefinition + | UnnamedFunctionDefinition + | ModifierDefinition + | StructDefinition + | EnumDefinition + | EventDefinition + | ErrorDefinition + | StateVariableDefinition; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.4.22.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.4.22.md new file mode 100644 index 0000000000..2ec01a4f6c --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.4.22.md @@ -0,0 +1,14 @@ + + +```{ .ebnf .slang-ebnf #ContractMember } +«ContractMember» = UsingDirective + | ConstructorDefinition + | FunctionDefinition + | UnnamedFunctionDefinition + | ModifierDefinition + | StructDefinition + | EnumDefinition + | EventDefinition + | ErrorDefinition + | StateVariableDefinition; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.6.0.md new file mode 100644 index 0000000000..a5b86ee7e5 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.6.0.md @@ -0,0 +1,15 @@ + + +```{ .ebnf .slang-ebnf #ContractMember } +«ContractMember» = UsingDirective + | ConstructorDefinition + | FunctionDefinition + | FallbackFunctionDefinition + | ReceiveFunctionDefinition + | ModifierDefinition + | StructDefinition + | EnumDefinition + | EventDefinition + | ErrorDefinition + | StateVariableDefinition; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.8.8.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.8.8.md new file mode 100644 index 0000000000..e37429db0c --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.8.8.md @@ -0,0 +1,16 @@ + + +```{ .ebnf .slang-ebnf #ContractMember } +«ContractMember» = UsingDirective + | ConstructorDefinition + | FunctionDefinition + | FallbackFunctionDefinition + | ReceiveFunctionDefinition + | ModifierDefinition + | StructDefinition + | EnumDefinition + | EventDefinition + | ErrorDefinition + | StateVariableDefinition + | UserDefinedValueTypeDefinition; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md new file mode 100644 index 0000000000..5fa934cbff --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #ContractMembersList } +ContractMembersList = «ContractMember»+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md deleted file mode 100644 index e7d4476c7d..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #InheritanceSpecifierList } -InheritanceSpecifierList = IS_KEYWORD InheritanceSpecifier (COMMA InheritanceSpecifier)*; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md index 4af74c76cb..eca61dd057 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #InheritanceSpecifier } -InheritanceSpecifier = IdentifierPath ArgumentList?; +InheritanceSpecifier = IS_KEYWORD InheritanceTypesList; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md new file mode 100644 index 0000000000..bf60cc3d33 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #InheritanceType } +InheritanceType = IdentifierPath ArgumentsDeclaration?; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md new file mode 100644 index 0000000000..366d144762 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #InheritanceTypesList } +InheritanceTypesList = InheritanceType (COMMA InheritanceType)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md index 0ae8d7615a..f97bdad274 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #InterfaceDefinition } -InterfaceDefinition = INTERFACE_KEYWORD IDENTIFIER InheritanceSpecifierList? OPEN_BRACE «ContractBodyElement»* CLOSE_BRACE; +InterfaceDefinition = INTERFACE_KEYWORD IDENTIFIER InheritanceSpecifier? OPEN_BRACE InterfaceMembersList? CLOSE_BRACE; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md new file mode 100644 index 0000000000..7eec167139 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #InterfaceMembersList } +InterfaceMembersList = «ContractMember»+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md index 8af35d04e8..b0280f73f3 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #LibraryDefinition } -LibraryDefinition = LIBRARY_KEYWORD IDENTIFIER OPEN_BRACE «ContractBodyElement»* CLOSE_BRACE; +LibraryDefinition = LIBRARY_KEYWORD IDENTIFIER OPEN_BRACE LibraryMembersList? CLOSE_BRACE; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md new file mode 100644 index 0000000000..2add3f85a5 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #LibraryMembersList } +LibraryMembersList = «ContractMember»+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md index d89816fd88..89de48210f 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #StructDefinition } -StructDefinition = STRUCT_KEYWORD IDENTIFIER OPEN_BRACE StructMember+ CLOSE_BRACE; +StructDefinition = STRUCT_KEYWORD IDENTIFIER OPEN_BRACE StructMembersList? CLOSE_BRACE; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md similarity index 57% rename from crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md index 2ccbd57e12..bba1261bad 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md @@ -1,5 +1,5 @@ -```{ .ebnf .slang-ebnf #SimpleImport } -SimpleImport = ImportPath ImportAlias?; +```{ .ebnf .slang-ebnf #StructMembersList } +StructMembersList = StructMember+; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/05-enums/enum-definition/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/05-enums/enum-definition/unversioned.md index d6effc912c..5fefc7818a 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/05-enums/enum-definition/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/05-enums/enum-definition/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #EnumDefinition } -EnumDefinition = ENUM_KEYWORD IDENTIFIER OPEN_BRACE (IDENTIFIER (COMMA IDENTIFIER)*)? CLOSE_BRACE; +EnumDefinition = ENUM_KEYWORD IDENTIFIER OPEN_BRACE IdentifiersList? CLOSE_BRACE; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.4.11.md index c389d3f1f3..52b23a09dd 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.4.11.md @@ -1,9 +1,9 @@ ```{ .ebnf .slang-ebnf #StateVariableAttribute } -StateVariableAttribute = OverrideSpecifier - | CONSTANT_KEYWORD - | INTERNAL_KEYWORD - | PRIVATE_KEYWORD - | PUBLIC_KEYWORD; +«StateVariableAttribute» = OverrideSpecifier + | CONSTANT_KEYWORD + | INTERNAL_KEYWORD + | PRIVATE_KEYWORD + | PUBLIC_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.6.5.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.6.5.md index 603b0dfba9..4fdcd83f38 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.6.5.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.6.5.md @@ -1,10 +1,10 @@ ```{ .ebnf .slang-ebnf #StateVariableAttribute } -StateVariableAttribute = OverrideSpecifier - | CONSTANT_KEYWORD - | IMMUTABLE_KEYWORD - | INTERNAL_KEYWORD - | PRIVATE_KEYWORD - | PUBLIC_KEYWORD; +«StateVariableAttribute» = OverrideSpecifier + | CONSTANT_KEYWORD + | IMMUTABLE_KEYWORD + | INTERNAL_KEYWORD + | PRIVATE_KEYWORD + | PUBLIC_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md new file mode 100644 index 0000000000..0d23ea904a --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #StateVariableAttributesList } +StateVariableAttributesList = «StateVariableAttribute»+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md deleted file mode 100644 index 331fea9935..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #StateVariableDeclaration } -StateVariableDeclaration = TypeName StateVariableAttribute* IDENTIFIER (EQUAL Expression)? SEMICOLON; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md new file mode 100644 index 0000000000..562cc74183 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #StateVariableDefinition } +StateVariableDefinition = TypeName StateVariableAttributesList? IDENTIFIER (EQUAL Expression)? SEMICOLON; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md deleted file mode 100644 index 72c9b1b975..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #ArgumentList } -ArgumentList = OPEN_PAREN (PositionalArgumentList | NamedArgumentList)? CLOSE_PAREN; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md index 45e418bfd8..bcda741b75 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md @@ -1,8 +1,8 @@ ```{ .ebnf .slang-ebnf #ConstructorAttribute } -ConstructorAttribute = ModifierInvocation - | INTERNAL_KEYWORD - | PAYABLE_KEYWORD - | PUBLIC_KEYWORD; +«ConstructorAttribute» = ModifierInvocation + | INTERNAL_KEYWORD + | PAYABLE_KEYWORD + | PUBLIC_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md new file mode 100644 index 0000000000..166723c022 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #ConstructorAttributesList } +ConstructorAttributesList = «ConstructorAttribute»+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md index 726c1969dd..07cf8dd605 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ConstructorDefinition } -ConstructorDefinition = CONSTRUCTOR_KEYWORD ParameterList ConstructorAttribute* Block; +ConstructorDefinition = CONSTRUCTOR_KEYWORD ParametersDeclaration ConstructorAttributesList? Block; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md index c8d6c2875e..2bdd7fc88d 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md @@ -1,11 +1,11 @@ ```{ .ebnf .slang-ebnf #FallbackFunctionAttribute } -FallbackFunctionAttribute = ModifierInvocation - | OverrideSpecifier - | EXTERNAL_KEYWORD - | PAYABLE_KEYWORD - | PURE_KEYWORD - | VIEW_KEYWORD - | VIRTUAL_KEYWORD; +«FallbackFunctionAttribute» = ModifierInvocation + | OverrideSpecifier + | EXTERNAL_KEYWORD + | PAYABLE_KEYWORD + | PURE_KEYWORD + | VIEW_KEYWORD + | VIRTUAL_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attributes-list/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attributes-list/0.6.0.md new file mode 100644 index 0000000000..f6ec1f7e4b --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attributes-list/0.6.0.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #FallbackFunctionAttributesList } +FallbackFunctionAttributesList = «FallbackFunctionAttribute»+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md index cb07162cba..a3bb6ec4f5 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #FallbackFunctionDefinition } -FallbackFunctionDefinition = FALLBACK_KEYWORD ParameterList FallbackFunctionAttribute* (RETURNS_KEYWORD ParameterList)? (SEMICOLON | Block); +FallbackFunctionDefinition = FALLBACK_KEYWORD ParametersDeclaration FallbackFunctionAttributesList? ReturnsDeclaration? (SEMICOLON | Block); ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.4.11.md index f8aa62a4ce..d1fe44eb6b 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.4.11.md @@ -1,14 +1,14 @@ ```{ .ebnf .slang-ebnf #FunctionAttribute } -FunctionAttribute = CONSTANT_KEYWORD - | EXTERNAL_KEYWORD - | INTERNAL_KEYWORD - | ModifierInvocation - | OverrideSpecifier - | PAYABLE_KEYWORD - | PRIVATE_KEYWORD - | PUBLIC_KEYWORD - | PURE_KEYWORD - | VIEW_KEYWORD; +«FunctionAttribute» = ModifierInvocation + | OverrideSpecifier + | CONSTANT_KEYWORD + | EXTERNAL_KEYWORD + | INTERNAL_KEYWORD + | PAYABLE_KEYWORD + | PRIVATE_KEYWORD + | PUBLIC_KEYWORD + | PURE_KEYWORD + | VIEW_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.5.0.md index b5eefde1db..50e8d3e0c4 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.5.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.5.0.md @@ -1,13 +1,13 @@ ```{ .ebnf .slang-ebnf #FunctionAttribute } -FunctionAttribute = EXTERNAL_KEYWORD - | INTERNAL_KEYWORD - | ModifierInvocation - | OverrideSpecifier - | PAYABLE_KEYWORD - | PRIVATE_KEYWORD - | PUBLIC_KEYWORD - | PURE_KEYWORD - | VIEW_KEYWORD; +«FunctionAttribute» = ModifierInvocation + | OverrideSpecifier + | EXTERNAL_KEYWORD + | INTERNAL_KEYWORD + | PAYABLE_KEYWORD + | PRIVATE_KEYWORD + | PUBLIC_KEYWORD + | PURE_KEYWORD + | VIEW_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md index 0fb2a6d73c..640475ad44 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md @@ -1,14 +1,14 @@ ```{ .ebnf .slang-ebnf #FunctionAttribute } -FunctionAttribute = EXTERNAL_KEYWORD - | INTERNAL_KEYWORD - | ModifierInvocation - | OverrideSpecifier - | PAYABLE_KEYWORD - | PRIVATE_KEYWORD - | PUBLIC_KEYWORD - | PURE_KEYWORD - | VIEW_KEYWORD - | VIRTUAL_KEYWORD; +«FunctionAttribute» = ModifierInvocation + | OverrideSpecifier + | EXTERNAL_KEYWORD + | INTERNAL_KEYWORD + | PAYABLE_KEYWORD + | PRIVATE_KEYWORD + | PUBLIC_KEYWORD + | PURE_KEYWORD + | VIEW_KEYWORD + | VIRTUAL_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md new file mode 100644 index 0000000000..32c2c09924 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #FunctionAttributesList } +FunctionAttributesList = «FunctionAttribute»+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md index ac755418b0..2f9c07ef12 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #FunctionDefinition } -FunctionDefinition = FUNCTION_KEYWORD (IDENTIFIER | FALLBACK_KEYWORD | RECEIVE_KEYWORD) ParameterList FunctionAttribute* (RETURNS_KEYWORD ParameterList)? (SEMICOLON | Block); +FunctionDefinition = FUNCTION_KEYWORD (IDENTIFIER | FALLBACK_KEYWORD | RECEIVE_KEYWORD) ParametersDeclaration FunctionAttributesList? ReturnsDeclaration? (SEMICOLON | Block); ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md deleted file mode 100644 index 4c309b6cde..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #NamedArgumentList } -NamedArgumentList = OPEN_BRACE (NamedArgument (COMMA NamedArgument)*)? CLOSE_BRACE; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md index 600208efcc..83f8d859c9 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #OverrideSpecifier } -OverrideSpecifier = OVERRIDE_KEYWORD (OPEN_PAREN IdentifierPath (COMMA IdentifierPath)* CLOSE_PAREN)?; +OverrideSpecifier = OVERRIDE_KEYWORD (OPEN_PAREN IdentifierPathsList? CLOSE_PAREN)?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md deleted file mode 100644 index a82d6483da..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #ParameterDeclaration } -ParameterDeclaration = TypeName DataLocation? IDENTIFIER?; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md deleted file mode 100644 index bbbc23ae58..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #ParameterList } -ParameterList = OPEN_PAREN (ParameterDeclaration (COMMA ParameterDeclaration)*)? CLOSE_PAREN; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md new file mode 100644 index 0000000000..26da340c51 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #Parameter } +Parameter = TypeName «DataLocation»? IDENTIFIER?; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md new file mode 100644 index 0000000000..5aef464758 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #ParametersDeclaration } +ParametersDeclaration = OPEN_PAREN ParametersList? CLOSE_PAREN; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md new file mode 100644 index 0000000000..d93c4cbbb8 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #ParametersList } +ParametersList = Parameter (COMMA Parameter)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md deleted file mode 100644 index b76c576fb8..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #PositionalArgumentList } -PositionalArgumentList = Expression (COMMA Expression)*; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md index 31c082074b..df0753bf36 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md @@ -1,9 +1,9 @@ ```{ .ebnf .slang-ebnf #ReceiveFunctionAttribute } -ReceiveFunctionAttribute = ModifierInvocation - | OverrideSpecifier - | EXTERNAL_KEYWORD - | PAYABLE_KEYWORD - | VIRTUAL_KEYWORD; +«ReceiveFunctionAttribute» = ModifierInvocation + | OverrideSpecifier + | EXTERNAL_KEYWORD + | PAYABLE_KEYWORD + | VIRTUAL_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attributes-list/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attributes-list/0.6.0.md new file mode 100644 index 0000000000..4b098d8617 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attributes-list/0.6.0.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #ReceiveFunctionAttributesList } +ReceiveFunctionAttributesList = «ReceiveFunctionAttribute»+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md index 2827920d61..3b352d14f4 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ReceiveFunctionDefinition } -ReceiveFunctionDefinition = RECEIVE_KEYWORD ParameterList ReceiveFunctionAttribute* (SEMICOLON | Block); +ReceiveFunctionDefinition = RECEIVE_KEYWORD ParametersDeclaration ReceiveFunctionAttributesList? (SEMICOLON | Block); ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md new file mode 100644 index 0000000000..46783057d9 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #ReturnsDeclaration } +ReturnsDeclaration = RETURNS_KEYWORD ParametersDeclaration; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attribute/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attribute/0.4.11.md index bb2b8725a7..d381194cb7 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attribute/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attribute/0.4.11.md @@ -1,10 +1,10 @@ ```{ .ebnf .slang-ebnf #UnnamedFunctionAttribute } -UnnamedFunctionAttribute = ModifierInvocation - | OverrideSpecifier - | EXTERNAL_KEYWORD - | PAYABLE_KEYWORD - | PURE_KEYWORD - | VIEW_KEYWORD; +«UnnamedFunctionAttribute» = ModifierInvocation + | OverrideSpecifier + | EXTERNAL_KEYWORD + | PAYABLE_KEYWORD + | PURE_KEYWORD + | VIEW_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attributes-list/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attributes-list/0.4.11.md new file mode 100644 index 0000000000..2bcf4060ba --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attributes-list/0.4.11.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #UnnamedFunctionAttributesList } +UnnamedFunctionAttributesList = «UnnamedFunctionAttribute»+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-definition/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-definition/0.4.11.md index f8e9718388..eac20f3708 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-definition/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-definition/0.4.11.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #UnnamedFunctionDefinition } -UnnamedFunctionDefinition = FUNCTION_KEYWORD ParameterList UnnamedFunctionAttribute* (SEMICOLON | Block); +UnnamedFunctionDefinition = FUNCTION_KEYWORD ParametersDeclaration UnnamedFunctionAttributesList? (SEMICOLON | Block); ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.4.11.md index bbdaf91bd8..78332d9f0c 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.4.11.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ModifierAttribute } -ModifierAttribute = OverrideSpecifier; +«ModifierAttribute» = OverrideSpecifier; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md index e8f0f46cc9..50c36135ac 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ModifierAttribute } -ModifierAttribute = OverrideSpecifier | VIRTUAL_KEYWORD; +«ModifierAttribute» = OverrideSpecifier | VIRTUAL_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md new file mode 100644 index 0000000000..f1cd31892a --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #ModifierAttributesList } +ModifierAttributesList = «ModifierAttribute»+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md index 7137190388..26c5652e88 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ModifierDefinition } -ModifierDefinition = MODIFIER_KEYWORD IDENTIFIER ParameterList? ModifierAttribute* (SEMICOLON | Block); +ModifierDefinition = MODIFIER_KEYWORD IDENTIFIER ParametersDeclaration? ModifierAttributesList? (SEMICOLON | Block); ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md index 3c11749985..e2d6af30aa 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ModifierInvocation } -ModifierInvocation = IdentifierPath ArgumentList?; +ModifierInvocation = IdentifierPath ArgumentsDeclaration?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md index 0730f99137..80bf375614 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #EventDefinition } -EventDefinition = EVENT_KEYWORD IDENTIFIER OPEN_PAREN (EventParameter (COMMA EventParameter)*)? CLOSE_PAREN ANONYMOUS_KEYWORD? SEMICOLON; +EventDefinition = EVENT_KEYWORD IDENTIFIER OPEN_PAREN EventParametersList? CLOSE_PAREN ANONYMOUS_KEYWORD? SEMICOLON; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md new file mode 100644 index 0000000000..7a862519a1 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #EventParametersList } +EventParametersList = EventParameter (COMMA EventParameter)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/11-user-defined-value-types/user-defined-value-type-definition/0.8.8.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/11-user-defined-value-types/user-defined-value-type-definition/0.8.8.md index b5c0c572bc..5f0c5cd9bd 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/11-user-defined-value-types/user-defined-value-type-definition/0.8.8.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/11-user-defined-value-types/user-defined-value-type-definition/0.8.8.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #UserDefinedValueTypeDefinition } -UserDefinedValueTypeDefinition = TYPE_KEYWORD IDENTIFIER IS_KEYWORD ElementaryType SEMICOLON; +UserDefinedValueTypeDefinition = TYPE_KEYWORD IDENTIFIER IS_KEYWORD «ElementaryType» SEMICOLON; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md index c121a03857..1e1c8c18af 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ErrorDefinition } -ErrorDefinition = ERROR_KEYWORD IDENTIFIER OPEN_PAREN (ErrorParameter (COMMA ErrorParameter)*)? CLOSE_PAREN SEMICOLON; +ErrorDefinition = ERROR_KEYWORD IDENTIFIER OPEN_PAREN ErrorParametersList? CLOSE_PAREN SEMICOLON; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md new file mode 100644 index 0000000000..001d5cbfd7 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #ErrorParametersList } +ErrorParametersList = ErrorParameter (COMMA ErrorParameter)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md new file mode 100644 index 0000000000..2a93991ef1 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #ArrayTypeNameOperator } +«ArrayTypeNameOperator» = OPEN_BRACKET Expression? CLOSE_BRACKET; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md new file mode 100644 index 0000000000..5d107f09e6 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md @@ -0,0 +1,11 @@ + + +```{ .ebnf .slang-ebnf #FunctionTypeAttribute } +«FunctionTypeAttribute» = INTERNAL_KEYWORD + | EXTERNAL_KEYWORD + | PRIVATE_KEYWORD + | PUBLIC_KEYWORD + | PURE_KEYWORD + | VIEW_KEYWORD + | PAYABLE_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md new file mode 100644 index 0000000000..d53a11348e --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #FunctionTypeAttributesList } +FunctionTypeAttributesList = «FunctionTypeAttribute»+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md index fe5a944156..cb9f65b001 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #FunctionType } -FunctionType = FUNCTION_KEYWORD ParameterList (INTERNAL_KEYWORD | EXTERNAL_KEYWORD | PRIVATE_KEYWORD | PUBLIC_KEYWORD | PURE_KEYWORD | VIEW_KEYWORD | PAYABLE_KEYWORD)* (RETURNS_KEYWORD ParameterList)?; +FunctionType = FUNCTION_KEYWORD ParametersDeclaration FunctionTypeAttributesList? ReturnsDeclaration?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md index f37da9c6e4..e35363edda 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #MappingKeyType } -MappingKeyType = (ElementaryType | IdentifierPath); +MappingKeyType = «ElementaryType» | IdentifierPath; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.8.18.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.8.18.md index c0b4e267d1..b171763bd1 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.8.18.md +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.8.18.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #MappingKeyType } -MappingKeyType = (ElementaryType | IdentifierPath) IDENTIFIER?; +MappingKeyType = («ElementaryType» | IdentifierPath) IDENTIFIER?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md index 161bfa0f0a..f0f2a6be4d 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md @@ -1,6 +1,6 @@ ```{ .ebnf .slang-ebnf #TypeName } -TypeName = ArrayTypeName | FunctionType | MappingType | ElementaryType | IdentifierPath; -ArrayTypeName = TypeName OPEN_BRACKET Expression? CLOSE_BRACKET; +TypeName = ArrayTypeName | FunctionType | MappingType | «ElementaryType» | IdentifierPath; +ArrayTypeName = TypeName «ArrayTypeNameOperator»; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md index 2223de3dd0..ef86de83d4 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #AddressType } -AddressType = ADDRESS_KEYWORD PAYABLE_KEYWORD?; +AddressType = (ADDRESS_KEYWORD PAYABLE_KEYWORD?) | PAYABLE_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md index 79fc36287e..66adbe7c26 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md @@ -1,14 +1,13 @@ ```{ .ebnf .slang-ebnf #ElementaryType } -ElementaryType = BOOL_KEYWORD - | STRING_KEYWORD - | AddressType - | PayableType - | BYTE_TYPE - | FIXED_BYTES_TYPE - | SIGNED_INTEGER_TYPE - | UNSIGNED_INTEGER_TYPE - | SIGNED_FIXED_TYPE - | UNSIGNED_FIXED_TYPE; +«ElementaryType» = BOOL_KEYWORD + | BYTE_KEYWORD + | STRING_KEYWORD + | AddressType + | FIXED_BYTES_TYPE + | SIGNED_INTEGER_TYPE + | UNSIGNED_INTEGER_TYPE + | SIGNED_FIXED_TYPE + | UNSIGNED_FIXED_TYPE; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.8.0.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.8.0.md index 58472d215b..e33d4352f2 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.8.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.8.0.md @@ -1,13 +1,12 @@ ```{ .ebnf .slang-ebnf #ElementaryType } -ElementaryType = BOOL_KEYWORD - | STRING_KEYWORD - | AddressType - | PayableType - | FIXED_BYTES_TYPE - | SIGNED_INTEGER_TYPE - | UNSIGNED_INTEGER_TYPE - | SIGNED_FIXED_TYPE - | UNSIGNED_FIXED_TYPE; +«ElementaryType» = BOOL_KEYWORD + | STRING_KEYWORD + | AddressType + | FIXED_BYTES_TYPE + | SIGNED_INTEGER_TYPE + | UNSIGNED_INTEGER_TYPE + | SIGNED_FIXED_TYPE + | UNSIGNED_FIXED_TYPE; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md new file mode 100644 index 0000000000..fa4c147b63 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md @@ -0,0 +1,36 @@ + + +```{ .ebnf .slang-ebnf #FIXED_BYTES_TYPE_SIZE } +«FIXED_BYTES_TYPE_SIZE» = "1" + | "2" + | "3" + | "4" + | "5" + | "6" + | "7" + | "8" + | "9" + | "10" + | "11" + | "12" + | "13" + | "14" + | "15" + | "16" + | "17" + | "18" + | "19" + | "20" + | "21" + | "22" + | "23" + | "24" + | "25" + | "26" + | "27" + | "28" + | "29" + | "30" + | "31" + | "32"; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md index 90ab8be82b..282921301e 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #FIXED_BYTES_TYPE } -FIXED_BYTES_TYPE = "bytes" ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" | "18" | "19" | "20" | "21" | "22" | "23" | "24" | "25" | "26" | "27" | "28" | "29" | "30" | "31" | "32"); +FIXED_BYTES_TYPE = "bytes" «FIXED_BYTES_TYPE_SIZE»; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md new file mode 100644 index 0000000000..9ddcf18355 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #FIXED_TYPE_SIZE } +«FIXED_TYPE_SIZE» = "0"…"9"+ "x" "0"…"9"+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md new file mode 100644 index 0000000000..08cdec6d8c --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md @@ -0,0 +1,36 @@ + + +```{ .ebnf .slang-ebnf #INTEGER_TYPE_SIZE } +«INTEGER_TYPE_SIZE» = "8" + | "16" + | "24" + | "32" + | "40" + | "48" + | "56" + | "64" + | "72" + | "80" + | "88" + | "96" + | "104" + | "112" + | "120" + | "128" + | "136" + | "144" + | "152" + | "160" + | "168" + | "176" + | "184" + | "192" + | "200" + | "208" + | "216" + | "224" + | "232" + | "240" + | "248" + | "256"; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md index e029a3997c..69406b08e2 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #SIGNED_FIXED_TYPE } -SIGNED_FIXED_TYPE = "fixed" ("0"…"9"+ "x" "0"…"9"+)?; +SIGNED_FIXED_TYPE = "fixed" «FIXED_TYPE_SIZE»?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md index cad751cc8d..d05a98581f 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #SIGNED_INTEGER_TYPE } -SIGNED_INTEGER_TYPE = "int" ("8" | "16" | "24" | "32" | "40" | "48" | "56" | "64" | "72" | "80" | "88" | "96" | "104" | "112" | "120" | "128" | "136" | "144" | "152" | "160" | "168" | "176" | "184" | "192" | "200" | "208" | "216" | "224" | "232" | "240" | "248" | "256")?; +SIGNED_INTEGER_TYPE = "int" «INTEGER_TYPE_SIZE»?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md index f546c8c5b6..5de0645ec2 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #UNSIGNED_FIXED_TYPE } -UNSIGNED_FIXED_TYPE = "u" SIGNED_FIXED_TYPE; +UNSIGNED_FIXED_TYPE = "ufixed" «FIXED_TYPE_SIZE»?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md index 3af08fe20b..0b904a0e68 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #UNSIGNED_INTEGER_TYPE } -UNSIGNED_INTEGER_TYPE = "u" SIGNED_INTEGER_TYPE; +UNSIGNED_INTEGER_TYPE = "uint" «INTEGER_TYPE_SIZE»?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md similarity index 74% rename from crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md rename to crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md index 814a6df373..c726be4e40 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #Block } -Block = OPEN_BRACE Statement* CLOSE_BRACE; +Block = OPEN_BRACE StatementsList? CLOSE_BRACE; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.4.11.md new file mode 100644 index 0000000000..c44a3ca248 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.4.11.md @@ -0,0 +1,14 @@ + + +```{ .ebnf .slang-ebnf #ControlStatement } +«ControlStatement» = IfStatement + | ForStatement + | WhileStatement + | DoWhileStatement + | ContinueStatement + | BreakStatement + | DeleteStatement + | ReturnStatement + | RevertStatement + | ThrowStatement; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.4.21.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.4.21.md new file mode 100644 index 0000000000..b06ce615c4 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.4.21.md @@ -0,0 +1,15 @@ + + +```{ .ebnf .slang-ebnf #ControlStatement } +«ControlStatement» = IfStatement + | ForStatement + | WhileStatement + | DoWhileStatement + | ContinueStatement + | BreakStatement + | DeleteStatement + | ReturnStatement + | RevertStatement + | ThrowStatement + | EmitStatement; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.5.0.md new file mode 100644 index 0000000000..1546d36778 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.5.0.md @@ -0,0 +1,14 @@ + + +```{ .ebnf .slang-ebnf #ControlStatement } +«ControlStatement» = IfStatement + | ForStatement + | WhileStatement + | DoWhileStatement + | ContinueStatement + | BreakStatement + | DeleteStatement + | ReturnStatement + | RevertStatement + | EmitStatement; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.6.0.md new file mode 100644 index 0000000000..c59144ce13 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.6.0.md @@ -0,0 +1,15 @@ + + +```{ .ebnf .slang-ebnf #ControlStatement } +«ControlStatement» = IfStatement + | ForStatement + | WhileStatement + | DoWhileStatement + | ContinueStatement + | BreakStatement + | DeleteStatement + | ReturnStatement + | RevertStatement + | EmitStatement + | TryStatement; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md index 91054942db..9652b53104 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md @@ -1,7 +1,7 @@ ```{ .ebnf .slang-ebnf #SimpleStatement } -SimpleStatement = TupleDeconstructionStatement - | VariableDeclarationStatement - | ExpressionStatement; +«SimpleStatement» = ExpressionStatement + | VariableDeclarationStatement + | TupleDeconstructionStatement; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md index ae77ff65b3..6363f88dcf 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md @@ -1,17 +1,8 @@ ```{ .ebnf .slang-ebnf #Statement } -Statement = Block - | SimpleStatement - | IfStatement - | ForStatement - | WhileStatement - | DoWhileStatement - | ContinueStatement - | BreakStatement - | ReturnStatement - | ThrowStatement - | RevertStatement - | DeleteStatement - | AssemblyStatement; +Statement = «SimpleStatement» + | «ControlStatement» + | AssemblyStatement + | Block; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.21.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.21.md deleted file mode 100644 index c520435397..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.21.md +++ /dev/null @@ -1,18 +0,0 @@ - - -```{ .ebnf .slang-ebnf #Statement } -Statement = Block - | SimpleStatement - | IfStatement - | ForStatement - | WhileStatement - | DoWhileStatement - | ContinueStatement - | BreakStatement - | ReturnStatement - | EmitStatement - | ThrowStatement - | RevertStatement - | DeleteStatement - | AssemblyStatement; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.5.0.md deleted file mode 100644 index 62289b1783..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.5.0.md +++ /dev/null @@ -1,17 +0,0 @@ - - -```{ .ebnf .slang-ebnf #Statement } -Statement = Block - | SimpleStatement - | IfStatement - | ForStatement - | WhileStatement - | DoWhileStatement - | ContinueStatement - | BreakStatement - | ReturnStatement - | EmitStatement - | RevertStatement - | DeleteStatement - | AssemblyStatement; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.6.0.md deleted file mode 100644 index 88fce78d55..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.6.0.md +++ /dev/null @@ -1,18 +0,0 @@ - - -```{ .ebnf .slang-ebnf #Statement } -Statement = Block - | SimpleStatement - | IfStatement - | ForStatement - | WhileStatement - | DoWhileStatement - | ContinueStatement - | BreakStatement - | TryStatement - | ReturnStatement - | EmitStatement - | RevertStatement - | DeleteStatement - | AssemblyStatement; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.8.0.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.8.0.md new file mode 100644 index 0000000000..b3f4ea7ea1 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.8.0.md @@ -0,0 +1,9 @@ + + +```{ .ebnf .slang-ebnf #Statement } +Statement = «SimpleStatement» + | «ControlStatement» + | AssemblyStatement + | Block + | UncheckedBlock; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md similarity index 60% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md index e3dc36b0d9..709f3f05af 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md @@ -1,5 +1,5 @@ -```{ .ebnf .slang-ebnf #BitOrOperator } -BitOrOperator = BAR; +```{ .ebnf .slang-ebnf #StatementsList } +StatementsList = Statement+; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.4.11.md index 86d4618c2c..d24bd3f0b8 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.4.11.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #DataLocation } -DataLocation = MEMORY_KEYWORD | STORAGE_KEYWORD; +«DataLocation» = MEMORY_KEYWORD | STORAGE_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md index 5b99aa16a6..e46a82e73c 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md @@ -1,7 +1,7 @@ ```{ .ebnf .slang-ebnf #DataLocation } -DataLocation = MEMORY_KEYWORD - | STORAGE_KEYWORD - | CALLDATA_KEYWORD; +«DataLocation» = MEMORY_KEYWORD + | STORAGE_KEYWORD + | CALLDATA_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md index b3c8fa9f1a..e7a597a207 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #TupleDeconstructionStatement } -TupleDeconstructionStatement = OPEN_PAREN (((TypeName DataLocation? IDENTIFIER) | (DataLocation? IDENTIFIER))? (COMMA ((TypeName DataLocation? IDENTIFIER) | (DataLocation? IDENTIFIER))?)*)? CLOSE_PAREN EQUAL Expression SEMICOLON; +TupleDeconstructionStatement = OPEN_PAREN TupleMembersList? CLOSE_PAREN EQUAL Expression SEMICOLON; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md new file mode 100644 index 0000000000..9a17e404eb --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #TupleMember } +TupleMember = ((TypeName «DataLocation»? IDENTIFIER) | («DataLocation»? IDENTIFIER))?; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md new file mode 100644 index 0000000000..11aeeef25a --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #TupleMembersList } +TupleMembersList = TupleMember (COMMA TupleMember)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.4.11.md deleted file mode 100644 index 292e18d61e..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.4.11.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #VariableDeclarationStatement } -VariableDeclarationStatement = ((TypeName DataLocation?) | VAR_KEYWORD) IDENTIFIER (EQUAL Expression)? SEMICOLON; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md similarity index 62% rename from crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md rename to crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md index 1e233fc2ef..a9258168c4 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #VariableDeclarationStatement } -VariableDeclarationStatement = TypeName DataLocation? IDENTIFIER (EQUAL Expression)? SEMICOLON; +VariableDeclarationStatement = VariableDeclaration (EQUAL Expression)? SEMICOLON; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.4.11.md new file mode 100644 index 0000000000..fa67b4c739 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.4.11.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #VariableDeclaration } +VariableDeclaration = (VAR_KEYWORD | TypeName) «DataLocation»? IDENTIFIER; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md new file mode 100644 index 0000000000..db64d0dd38 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #VariableDeclaration } +VariableDeclaration = TypeName «DataLocation»? IDENTIFIER; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/03-control-statements/emit-statement/0.4.21.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/03-control-statements/emit-statement/0.4.21.md index 947b9974b1..98bbee466a 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/03-control-statements/emit-statement/0.4.21.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/03-control-statements/emit-statement/0.4.21.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #EmitStatement } -EmitStatement = EMIT_KEYWORD IdentifierPath ArgumentList SEMICOLON; +EmitStatement = EMIT_KEYWORD IdentifierPath ArgumentsDeclaration SEMICOLON; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/03-control-statements/for-statement/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/03-control-statements/for-statement/unversioned.md index e1b9b731d7..89ca18dd1c 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/03-control-statements/for-statement/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/03-control-statements/for-statement/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ForStatement } -ForStatement = FOR_KEYWORD OPEN_PAREN (SimpleStatement | SEMICOLON) (ExpressionStatement | SEMICOLON) Expression? CLOSE_PAREN Statement; +ForStatement = FOR_KEYWORD OPEN_PAREN («SimpleStatement» | SEMICOLON) (ExpressionStatement | SEMICOLON) Expression? CLOSE_PAREN Statement; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause-error/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause-error/0.6.0.md new file mode 100644 index 0000000000..1d31ce4557 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause-error/0.6.0.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #CatchClauseError } +CatchClauseError = IDENTIFIER? ParametersDeclaration; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md index cab312cb1d..afbe0b9d64 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #CatchClause } -CatchClause = CATCH_KEYWORD (IDENTIFIER? ParameterList)? Block; +CatchClause = CATCH_KEYWORD CatchClauseError? Block; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clauses-list/0.6.0.md similarity index 58% rename from crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clauses-list/0.6.0.md index 7242f7acdc..68dc10a173 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clauses-list/0.6.0.md @@ -1,5 +1,5 @@ -```{ .ebnf .slang-ebnf #ImportAlias } -ImportAlias = AS_KEYWORD IDENTIFIER; +```{ .ebnf .slang-ebnf #CatchClausesList } +CatchClausesList = CatchClause+; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md index 5da5c08762..39fb62af04 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #RevertStatement } -RevertStatement = REVERT_KEYWORD IdentifierPath? ArgumentList SEMICOLON; +RevertStatement = REVERT_KEYWORD IdentifierPath? ArgumentsDeclaration SEMICOLON; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md index f562b59b6b..0cfa7c751d 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #TryStatement } -TryStatement = TRY_KEYWORD Expression (RETURNS_KEYWORD ParameterList)? Block CatchClause+; +TryStatement = TRY_KEYWORD Expression ReturnsDeclaration? Block CatchClausesList; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md index 5cd8ae6947..93d848c12f 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #AddSubOperator } -AddSubOperator = PLUS | MINUS; +«AddSubOperator» = PLUS | MINUS; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md index 07d844de51..be1417c391 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #AndOperator } -AndOperator = AMPERSAND_AMPERSAND; +«AndOperator» = AMPERSAND_AMPERSAND; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/assignment-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/assignment-operator/unversioned.md index f078528e6c..c372ef0314 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/assignment-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/assignment-operator/unversioned.md @@ -1,16 +1,16 @@ ```{ .ebnf .slang-ebnf #AssignmentOperator } -AssignmentOperator = EQUAL - | BAR_EQUAL - | CARET_EQUAL - | AMPERSAND_EQUAL - | LESS_THAN_LESS_THAN_EQUAL - | GREATER_THAN_GREATER_THAN_EQUAL - | GREATER_THAN_GREATER_THAN_GREATER_THAN_EQUAL - | PLUS_EQUAL - | MINUS_EQUAL - | ASTERISK_EQUAL - | SLASH_EQUAL - | PERCENT_EQUAL; +«AssignmentOperator» = EQUAL + | BAR_EQUAL + | PLUS_EQUAL + | MINUS_EQUAL + | CARET_EQUAL + | SLASH_EQUAL + | PERCENT_EQUAL + | ASTERISK_EQUAL + | AMPERSAND_EQUAL + | LESS_THAN_LESS_THAN_EQUAL + | GREATER_THAN_GREATER_THAN_EQUAL + | GREATER_THAN_GREATER_THAN_GREATER_THAN_EQUAL; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md deleted file mode 100644 index 3219864391..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #BitXOrOperator } -BitXOrOperator = CARET; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md new file mode 100644 index 0000000000..b553b63f8d --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #BitwiseAndOperator } +«BitwiseAndOperator» = AMPERSAND; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md similarity index 58% rename from crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md index 0b428756e2..d7cd5d93c7 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md @@ -1,5 +1,5 @@ -```{ .ebnf .slang-ebnf #ImportPath } -ImportPath = ASCII_STRING_LITERAL; +```{ .ebnf .slang-ebnf #BitwiseOrOperator } +«BitwiseOrOperator» = BAR; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md similarity index 57% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md index 3ee6daac97..c84b142cfc 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md @@ -1,5 +1,5 @@ -```{ .ebnf .slang-ebnf #BitAndOperator } -BitAndOperator = AMPERSAND; +```{ .ebnf .slang-ebnf #BitwiseXOrOperator } +«BitwiseXOrOperator» = CARET; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/conditional-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/conditional-operator/unversioned.md index 90cb1ee0e3..799f85eb72 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/conditional-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/conditional-operator/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ConditionalOperator } -ConditionalOperator = QUESTION_MARK Expression COLON Expression; +«ConditionalOperator» = QUESTION_MARK Expression COLON Expression; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md index dbe58e88a0..ebc7fd6851 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #EqualityComparisonOperator } -EqualityComparisonOperator = EQUAL_EQUAL | BANG_EQUAL; +«EqualityComparisonOperator» = EQUAL_EQUAL | BANG_EQUAL; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/exponentiation-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/exponentiation-operator/unversioned.md index 35df8ca768..3a4b746696 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/exponentiation-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/exponentiation-operator/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ExponentiationOperator } -ExponentiationOperator = ASTERISK_ASTERISK; +«ExponentiationOperator» = ASTERISK_ASTERISK; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/expression/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/expression/0.4.11.md index 322831d19f..e3712a5173 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/expression/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/expression/0.4.11.md @@ -1,41 +1,30 @@ ```{ .ebnf .slang-ebnf #Expression } -Expression = AssignmentExpression +Expression = BinaryExpression | ConditionalExpression - | OrExpression - | AndExpression - | EqualityComparisonExpression - | OrderComparisonExpression - | BitOrExpression - | BitXOrExpression - | BitAndExpression - | ShiftExpression - | AddSubExpression - | MulDivModExpression - | ExponentiationExpression | UnaryPostfixExpression | UnaryPrefixExpression | FunctionCallExpression | MemberAccessExpression | IndexAccessExpression - | PrimaryExpression; -AssignmentExpression = Expression AssignmentOperator Expression; -ConditionalExpression = Expression ConditionalOperator; -OrExpression = Expression OrOperator Expression; -AndExpression = Expression AndOperator Expression; -EqualityComparisonExpression = Expression EqualityComparisonOperator Expression; -OrderComparisonExpression = Expression OrderComparisonOperator Expression; -BitOrExpression = Expression BitOrOperator Expression; -BitXOrExpression = Expression BitXOrOperator Expression; -BitAndExpression = Expression BitAndOperator Expression; -ShiftExpression = Expression ShiftOperator Expression; -AddSubExpression = Expression AddSubOperator Expression; -MulDivModExpression = Expression MulDivModOperator Expression; -ExponentiationExpression = Expression ExponentiationOperator Expression; -UnaryPostfixExpression = Expression UnaryPostfixOperator; -UnaryPrefixExpression = UnaryPrefixOperator Expression; -FunctionCallExpression = Expression FunctionCallOperator; -MemberAccessExpression = Expression MemberAccessOperator; -IndexAccessExpression = Expression IndexAccessOperator; + | «PrimaryExpression»; +BinaryExpression = Expression «AssignmentOperator» Expression; +ConditionalExpression = Expression «ConditionalOperator»; +BinaryExpression = Expression «OrOperator» Expression; +BinaryExpression = Expression «AndOperator» Expression; +BinaryExpression = Expression «EqualityComparisonOperator» Expression; +BinaryExpression = Expression «OrderComparisonOperator» Expression; +BinaryExpression = Expression «BitwiseOrOperator» Expression; +BinaryExpression = Expression «BitwiseXOrOperator» Expression; +BinaryExpression = Expression «BitwiseAndOperator» Expression; +BinaryExpression = Expression «ShiftOperator» Expression; +BinaryExpression = Expression «AddSubOperator» Expression; +BinaryExpression = Expression «MulDivModOperator» Expression; +BinaryExpression = Expression «ExponentiationOperator» Expression; +UnaryPostfixExpression = Expression «UnaryPostfixOperator»; +UnaryPrefixExpression = «UnaryPrefixOperator» Expression; +FunctionCallExpression = Expression «FunctionCallOperator»; +MemberAccessExpression = Expression «MemberAccessOperator»; +IndexAccessExpression = Expression «IndexAccessOperator»; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/expression/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/expression/0.6.0.md index a7c0da0cda..633eb356d2 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/expression/0.6.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/expression/0.6.0.md @@ -1,41 +1,30 @@ ```{ .ebnf .slang-ebnf #Expression } -Expression = AssignmentExpression +Expression = BinaryExpression | ConditionalExpression - | OrExpression - | AndExpression - | EqualityComparisonExpression - | OrderComparisonExpression - | BitOrExpression - | BitXOrExpression - | BitAndExpression - | ShiftExpression - | AddSubExpression - | MulDivModExpression - | ExponentiationExpression | UnaryPostfixExpression | UnaryPrefixExpression | FunctionCallExpression | MemberAccessExpression | IndexAccessExpression - | PrimaryExpression; -AssignmentExpression = Expression AssignmentOperator Expression; -ConditionalExpression = Expression ConditionalOperator; -OrExpression = Expression OrOperator Expression; -AndExpression = Expression AndOperator Expression; -EqualityComparisonExpression = Expression EqualityComparisonOperator Expression; -OrderComparisonExpression = Expression OrderComparisonOperator Expression; -BitOrExpression = Expression BitOrOperator Expression; -BitXOrExpression = Expression BitXOrOperator Expression; -BitAndExpression = Expression BitAndOperator Expression; -ShiftExpression = Expression ShiftOperator Expression; -AddSubExpression = Expression AddSubOperator Expression; -MulDivModExpression = Expression MulDivModOperator Expression; -ExponentiationExpression = Expression ExponentiationOperator Expression; (* Right Associative *) -UnaryPostfixExpression = Expression UnaryPostfixOperator; -UnaryPrefixExpression = UnaryPrefixOperator Expression; -FunctionCallExpression = Expression FunctionCallOperator; -MemberAccessExpression = Expression MemberAccessOperator; -IndexAccessExpression = Expression IndexAccessOperator; + | «PrimaryExpression»; +BinaryExpression = Expression «AssignmentOperator» Expression; +ConditionalExpression = Expression «ConditionalOperator»; +BinaryExpression = Expression «OrOperator» Expression; +BinaryExpression = Expression «AndOperator» Expression; +BinaryExpression = Expression «EqualityComparisonOperator» Expression; +BinaryExpression = Expression «OrderComparisonOperator» Expression; +BinaryExpression = Expression «BitwiseOrOperator» Expression; +BinaryExpression = Expression «BitwiseXOrOperator» Expression; +BinaryExpression = Expression «BitwiseAndOperator» Expression; +BinaryExpression = Expression «ShiftOperator» Expression; +BinaryExpression = Expression «AddSubOperator» Expression; +BinaryExpression = Expression «MulDivModOperator» Expression; +BinaryExpression = Expression «ExponentiationOperator» Expression; (* Right Associative *) +UnaryPostfixExpression = Expression «UnaryPostfixOperator»; +UnaryPrefixExpression = «UnaryPrefixOperator» Expression; +FunctionCallExpression = Expression «FunctionCallOperator»; +MemberAccessExpression = Expression «MemberAccessOperator»; +IndexAccessExpression = Expression «IndexAccessOperator»; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.4.11.md index ffe970b1b3..98e4ff29ca 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.4.11.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #FunctionCallOperator } -FunctionCallOperator = ArgumentList; +«FunctionCallOperator» = ArgumentsDeclaration; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.6.2.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.6.2.md index 9ae966b84d..4bc09616da 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.6.2.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.6.2.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #FunctionCallOperator } -FunctionCallOperator = FunctionCallOptions* ArgumentList; +«FunctionCallOperator» = FunctionCallOptions? ArgumentsDeclaration; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.8.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.8.0.md deleted file mode 100644 index 4b3aa69bd7..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.8.0.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #FunctionCallOperator } -FunctionCallOperator = FunctionCallOptions? ArgumentList; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md index 2627da7ce4..b23f707cf2 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #IndexAccessOperator } -IndexAccessOperator = OPEN_BRACKET ((Expression (COLON Expression?)?) | (COLON Expression?)) CLOSE_BRACKET; +«IndexAccessOperator» = OPEN_BRACKET ((Expression (COLON Expression?)?) | (COLON Expression?)) CLOSE_BRACKET; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md index 3cc6bb8716..bb48f21df6 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #MemberAccessOperator } -MemberAccessOperator = PERIOD (IDENTIFIER | ADDRESS_KEYWORD); +«MemberAccessOperator» = PERIOD (IDENTIFIER | ADDRESS_KEYWORD); ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md index fff44f9ee1..1af3eabb09 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md @@ -1,7 +1,7 @@ ```{ .ebnf .slang-ebnf #MulDivModOperator } -MulDivModOperator = ASTERISK - | SLASH - | PERCENT; +«MulDivModOperator» = ASTERISK + | SLASH + | PERCENT; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/or-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/or-operator/unversioned.md index f8c77545b6..a51f47ba0d 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/or-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/or-operator/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #OrOperator } -OrOperator = BAR_BAR; +«OrOperator» = BAR_BAR; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md index 1e9126df8b..5305c3d0ac 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md @@ -1,8 +1,8 @@ ```{ .ebnf .slang-ebnf #OrderComparisonOperator } -OrderComparisonOperator = LESS_THAN - | GREATER_THAN - | LESS_THAN_EQUAL - | GREATER_THAN_EQUAL; +«OrderComparisonOperator» = LESS_THAN + | GREATER_THAN + | LESS_THAN_EQUAL + | GREATER_THAN_EQUAL; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md index 7a20885b94..34ad753058 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md @@ -1,7 +1,7 @@ ```{ .ebnf .slang-ebnf #ShiftOperator } -ShiftOperator = LESS_THAN_LESS_THAN - | GREATER_THAN_GREATER_THAN - | GREATER_THAN_GREATER_THAN_GREATER_THAN; +«ShiftOperator» = LESS_THAN_LESS_THAN + | GREATER_THAN_GREATER_THAN + | GREATER_THAN_GREATER_THAN_GREATER_THAN; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-postfix-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-postfix-operator/unversioned.md index 553bc2b461..4ddb004eda 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-postfix-operator/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-postfix-operator/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #UnaryPostfixOperator } -UnaryPostfixOperator = PLUS_PLUS | MINUS_MINUS; +«UnaryPostfixOperator» = PLUS_PLUS | MINUS_MINUS; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-prefix-operator/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-prefix-operator/0.4.11.md index 9ed28cb179..a0a4fb2661 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-prefix-operator/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-prefix-operator/0.4.11.md @@ -1,10 +1,10 @@ ```{ .ebnf .slang-ebnf #UnaryPrefixOperator } -UnaryPrefixOperator = PLUS_PLUS - | MINUS_MINUS - | TILDE - | BANG - | MINUS - | PLUS; +«UnaryPrefixOperator» = PLUS_PLUS + | MINUS_MINUS + | TILDE + | BANG + | MINUS + | PLUS; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-prefix-operator/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-prefix-operator/0.5.0.md index e297b20d5c..505a1e4021 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-prefix-operator/0.5.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-prefix-operator/0.5.0.md @@ -1,9 +1,9 @@ ```{ .ebnf .slang-ebnf #UnaryPrefixOperator } -UnaryPrefixOperator = PLUS_PLUS - | MINUS_MINUS - | TILDE - | BANG - | MINUS; +«UnaryPrefixOperator» = PLUS_PLUS + | MINUS_MINUS + | TILDE + | BANG + | MINUS; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md new file mode 100644 index 0000000000..7949a078a8 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #ArgumentsDeclaration } +ArgumentsDeclaration = OPEN_PAREN (PositionalArgumentsList | NamedArgumentsDeclaration)? CLOSE_PAREN; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-call-options/0.6.2.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.6.2.md similarity index 63% rename from crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-call-options/0.6.2.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.6.2.md index d4e94d3513..a2e4f1d32b 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-call-options/0.6.2.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.6.2.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #FunctionCallOptions } -FunctionCallOptions = OPEN_BRACE (NamedArgument (COMMA NamedArgument)*)? CLOSE_BRACE; +FunctionCallOptions = NamedArgumentsDeclaration+; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.8.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.8.0.md similarity index 52% rename from crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.8.0.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.8.0.md index f518c05c93..5aa95a1f58 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.8.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.8.0.md @@ -1,5 +1,5 @@ -```{ .ebnf .slang-ebnf #Block } -Block = OPEN_BRACE (Statement | UncheckedBlock)* CLOSE_BRACE; +```{ .ebnf .slang-ebnf #FunctionCallOptions } +FunctionCallOptions = NamedArgumentsDeclaration; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md similarity index 100% rename from crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md new file mode 100644 index 0000000000..e4660b3338 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #NamedArgumentsDeclaration } +NamedArgumentsDeclaration = OPEN_BRACE NamedArgumentsList? CLOSE_BRACE; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md similarity index 50% rename from crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md index 2ae459c3a5..8a682daf40 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md @@ -1,5 +1,5 @@ -```{ .ebnf .slang-ebnf #AsteriskImport } -AsteriskImport = ASTERISK ImportAlias FROM_KEYWORD ImportPath; +```{ .ebnf .slang-ebnf #NamedArgumentsList } +NamedArgumentsList = NamedArgument (COMMA NamedArgument)*; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md new file mode 100644 index 0000000000..4401811cec --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #PositionalArgumentsList } +PositionalArgumentsList = Expression (COMMA Expression)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md deleted file mode 100644 index 944bc8791c..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #ArrayLiteral } -ArrayLiteral = OPEN_BRACKET Expression (COMMA Expression)* CLOSE_BRACKET; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md deleted file mode 100644 index c76b669baa..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #BooleanLiteral } -BooleanLiteral = TRUE_KEYWORD | FALSE_KEYWORD; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.4.11.md deleted file mode 100644 index 915f310e6a..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.4.11.md +++ /dev/null @@ -1,12 +0,0 @@ - - -```{ .ebnf .slang-ebnf #PrimaryExpression } -PrimaryExpression = NewExpression - | TupleExpression - | ArrayLiteral - | BooleanLiteral - | NumericExpression - | StringExpression - | ElementaryType - | IDENTIFIER; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md deleted file mode 100644 index c49f48afda..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md +++ /dev/null @@ -1,13 +0,0 @@ - - -```{ .ebnf .slang-ebnf #PrimaryExpression } -PrimaryExpression = NewExpression - | TupleExpression - | TypeExpression - | ArrayLiteral - | BooleanLiteral - | NumericExpression - | StringExpression - | ElementaryType - | IDENTIFIER; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md deleted file mode 100644 index 27e1201b06..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #DECIMAL_NUMBER } -DECIMAL_NUMBER = "0"…"9"+ ("_" "0"…"9"+)*; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.4.11.md deleted file mode 100644 index f8d62333a6..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.4.11.md +++ /dev/null @@ -1,14 +0,0 @@ - - -```{ .ebnf .slang-ebnf #NumberUnit } -NumberUnit = DAYS_KEYWORD - | ETHER_KEYWORD - | FINNEY_KEYWORD - | HOURS_KEYWORD - | MINUTES_KEYWORD - | SECONDS_KEYWORD - | SZABO_KEYWORD - | WEEKS_KEYWORD - | WEI_KEYWORD - | YEARS_KEYWORD; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.5.0.md deleted file mode 100644 index dd58b56b46..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.5.0.md +++ /dev/null @@ -1,13 +0,0 @@ - - -```{ .ebnf .slang-ebnf #NumberUnit } -NumberUnit = DAYS_KEYWORD - | ETHER_KEYWORD - | FINNEY_KEYWORD - | HOURS_KEYWORD - | MINUTES_KEYWORD - | SECONDS_KEYWORD - | SZABO_KEYWORD - | WEEKS_KEYWORD - | WEI_KEYWORD; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.6.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.6.11.md deleted file mode 100644 index 8a796a00c7..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.6.11.md +++ /dev/null @@ -1,14 +0,0 @@ - - -```{ .ebnf .slang-ebnf #NumberUnit } -NumberUnit = DAYS_KEYWORD - | ETHER_KEYWORD - | FINNEY_KEYWORD - | GWEI_KEYWORD - | HOURS_KEYWORD - | MINUTES_KEYWORD - | SECONDS_KEYWORD - | SZABO_KEYWORD - | WEEKS_KEYWORD - | WEI_KEYWORD; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.7.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.7.0.md deleted file mode 100644 index f64c1765f8..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.7.0.md +++ /dev/null @@ -1,12 +0,0 @@ - - -```{ .ebnf .slang-ebnf #NumberUnit } -NumberUnit = DAYS_KEYWORD - | ETHER_KEYWORD - | GWEI_KEYWORD - | HOURS_KEYWORD - | MINUTES_KEYWORD - | SECONDS_KEYWORD - | WEEKS_KEYWORD - | WEI_KEYWORD; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md new file mode 100644 index 0000000000..2a16d18250 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #ArrayExpression } +ArrayExpression = OPEN_BRACKET ArrayValuesList CLOSE_BRACKET; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md new file mode 100644 index 0000000000..aa21e98e9e --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #ArrayValuesList } +ArrayValuesList = Expression (COMMA Expression)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md new file mode 100644 index 0000000000..7eba82d9d2 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #BooleanExpression } +«BooleanExpression» = TRUE_KEYWORD | FALSE_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md similarity index 100% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.4.11.md new file mode 100644 index 0000000000..832f50ae44 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.4.11.md @@ -0,0 +1,12 @@ + + +```{ .ebnf .slang-ebnf #PrimaryExpression } +«PrimaryExpression» = NewExpression + | TupleExpression + | ArrayExpression + | «BooleanExpression» + | NumericExpression + | «StringExpression» + | «ElementaryType» + | IDENTIFIER; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md new file mode 100644 index 0000000000..0ab87460f4 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md @@ -0,0 +1,13 @@ + + +```{ .ebnf .slang-ebnf #PrimaryExpression } +«PrimaryExpression» = NewExpression + | TupleExpression + | TypeExpression + | ArrayExpression + | «BooleanExpression» + | NumericExpression + | «StringExpression» + | «ElementaryType» + | IDENTIFIER; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md similarity index 66% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md index d8ab2f0497..1573c89ff5 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #TupleExpression } -TupleExpression = OPEN_PAREN Expression? (COMMA Expression?)* CLOSE_PAREN; +TupleExpression = OPEN_PAREN TupleValuesList CLOSE_PAREN; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md new file mode 100644 index 0000000000..ec4be8e731 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #TupleValuesList } +TupleValuesList = Expression? (COMMA Expression?)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/type-expression/0.5.3.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/type-expression/0.5.3.md similarity index 100% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/type-expression/0.5.3.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/type-expression/0.5.3.md diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md new file mode 100644 index 0000000000..c2426c4638 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #DECIMAL_DIGITS } +«DECIMAL_DIGITS» = "0"…"9"+ ("_" "0"…"9"+)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md similarity index 71% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md index bad532c4d6..b893360268 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #DECIMAL_EXPONENT } -DECIMAL_EXPONENT = ("e" | "E") "-"? DECIMAL_NUMBER; +«DECIMAL_EXPONENT» = ("e" | "E") "-"? «DECIMAL_DIGITS»; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.4.11.md similarity index 55% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.4.11.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.4.11.md index 6c21518aa3..9f9238c55b 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.4.11.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #DECIMAL_LITERAL } -DECIMAL_LITERAL = ((DECIMAL_NUMBER ("." DECIMAL_NUMBER?)?) | ("." DECIMAL_NUMBER)) DECIMAL_EXPONENT?; +DECIMAL_LITERAL = ((«DECIMAL_DIGITS» ("." «DECIMAL_DIGITS»?)?) | ("." «DECIMAL_DIGITS»)) «DECIMAL_EXPONENT»?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md similarity index 55% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md index adf3f12048..4afcae49fc 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #DECIMAL_LITERAL } -DECIMAL_LITERAL = ((DECIMAL_NUMBER ("." DECIMAL_NUMBER)?) | ("." DECIMAL_NUMBER)) DECIMAL_EXPONENT?; +DECIMAL_LITERAL = ((«DECIMAL_DIGITS» ("." «DECIMAL_DIGITS»)?) | ("." «DECIMAL_DIGITS»)) «DECIMAL_EXPONENT»?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.4.11.md similarity index 65% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.4.11.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.4.11.md index c15b1a5474..0da3657168 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.4.11.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #HEX_LITERAL } -HEX_LITERAL = "0" ("x" | "X") «HEX_CHARACTER»+ ("_" «HEX_CHARACTER»+)*; +HEX_LITERAL = ("0x" | "0X") «HEX_CHARACTER»+ ("_" «HEX_CHARACTER»+)*; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md similarity index 100% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.4.11.md new file mode 100644 index 0000000000..4def4a9174 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.4.11.md @@ -0,0 +1,14 @@ + + +```{ .ebnf .slang-ebnf #NumberUnit } +«NumberUnit» = DAYS_KEYWORD + | ETHER_KEYWORD + | FINNEY_KEYWORD + | HOURS_KEYWORD + | MINUTES_KEYWORD + | SECONDS_KEYWORD + | SZABO_KEYWORD + | WEEKS_KEYWORD + | WEI_KEYWORD + | YEARS_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.5.0.md new file mode 100644 index 0000000000..8b1498dfc8 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.5.0.md @@ -0,0 +1,13 @@ + + +```{ .ebnf .slang-ebnf #NumberUnit } +«NumberUnit» = DAYS_KEYWORD + | ETHER_KEYWORD + | FINNEY_KEYWORD + | HOURS_KEYWORD + | MINUTES_KEYWORD + | SECONDS_KEYWORD + | SZABO_KEYWORD + | WEEKS_KEYWORD + | WEI_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.6.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.6.11.md new file mode 100644 index 0000000000..87eea50a8c --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.6.11.md @@ -0,0 +1,14 @@ + + +```{ .ebnf .slang-ebnf #NumberUnit } +«NumberUnit» = DAYS_KEYWORD + | ETHER_KEYWORD + | FINNEY_KEYWORD + | GWEI_KEYWORD + | HOURS_KEYWORD + | MINUTES_KEYWORD + | SECONDS_KEYWORD + | SZABO_KEYWORD + | WEEKS_KEYWORD + | WEI_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.7.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.7.0.md new file mode 100644 index 0000000000..86bd7cbea3 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.7.0.md @@ -0,0 +1,12 @@ + + +```{ .ebnf .slang-ebnf #NumberUnit } +«NumberUnit» = DAYS_KEYWORD + | ETHER_KEYWORD + | GWEI_KEYWORD + | HOURS_KEYWORD + | MINUTES_KEYWORD + | SECONDS_KEYWORD + | WEEKS_KEYWORD + | WEI_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.4.11.md similarity index 68% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.4.11.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.4.11.md index cdae8ccd37..351727f59a 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.4.11.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #NumericExpression } -NumericExpression = (HEX_LITERAL | DECIMAL_LITERAL) NumberUnit?; +NumericExpression = (HEX_LITERAL | DECIMAL_LITERAL) «NumberUnit»?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md similarity index 68% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md index cca4e9d118..85b4bc4409 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #NumericExpression } -NumericExpression = HEX_LITERAL | (DECIMAL_LITERAL NumberUnit?); +NumericExpression = HEX_LITERAL | (DECIMAL_LITERAL «NumberUnit»?); ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md deleted file mode 100644 index 4fd4dd7e0f..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md +++ /dev/null @@ -1,12 +0,0 @@ - - -```{ .ebnf .slang-ebnf #ASCII_ESCAPE } -ASCII_ESCAPE = "n" - | "r" - | "t" - | "'" - | '"' - | "\\" - | "\n" - | "\r"; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md deleted file mode 100644 index a1150e0d8b..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #POSSIBLY_SEPARATED_PAIRS_OF_HEX_DIGITS } -POSSIBLY_SEPARATED_PAIRS_OF_HEX_DIGITS = «HEX_CHARACTER» «HEX_CHARACTER» ("_"? «HEX_CHARACTER» «HEX_CHARACTER»)*; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md deleted file mode 100644 index 9ff90f7d7f..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #IDENTIFIER } -IDENTIFIER = RAW_IDENTIFIER - (NOT_AN_IDENTIFIER_IN_ANY_VERSION | NOT_AN_IDENTIFIER_IN_SOME_VERSIONS | FIXED_BYTES_TYPE | SIGNED_FIXED_TYPE | UNSIGNED_FIXED_TYPE | SIGNED_INTEGER_TYPE | UNSIGNED_INTEGER_TYPE); -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md deleted file mode 100644 index 3f99040749..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md +++ /dev/null @@ -1,77 +0,0 @@ - - -```{ .ebnf .slang-ebnf #NOT_AN_IDENTIFIER_IN_ANY_VERSION } -NOT_AN_IDENTIFIER_IN_ANY_VERSION = "abstract" - | "address" - | "after" - | "anonymous" - | "as" - | "assembly" - | "bool" - | "break" - | "byte" - | "case" - | "catch" - | "constant" - | "continue" - | "contract" - | "days" - | "default" - | "delete" - | "do" - | "else" - | "enum" - | "ether" - | "event" - | "external" - | "false" - | "final" - | "for" - | "function" - | "hex" - | "hours" - | "if" - | "import" - | "in" - | "indexed" - | "inline" - | "interface" - | "internal" - | "is" - | "let" - | "library" - | "mapping" - | "match" - | "memory" - | "minutes" - | "modifier" - | "new" - | "null" - | "of" - | "payable" - | "pragma" - | "private" - | "public" - | "pure" - | "relocatable" - | "return" - | "returns" - | "seconds" - | "static" - | "storage" - | "string" - | "struct" - | "switch" - | "throw" - | "true" - | "try" - | "type" - | "typeof" - | "using" - | "var" - | "view" - | "weeks" - | "wei" - | "while" - | "years"; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.4.11.md deleted file mode 100644 index a8ffeaf6e4..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.4.11.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #NOT_AN_IDENTIFIER_IN_SOME_VERSIONS } -NOT_AN_IDENTIFIER_IN_SOME_VERSIONS = "finney" | "szabo"; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.5.0.md deleted file mode 100644 index 45da668b21..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.5.0.md +++ /dev/null @@ -1,27 +0,0 @@ - - -```{ .ebnf .slang-ebnf #NOT_AN_IDENTIFIER_IN_SOME_VERSIONS } -NOT_AN_IDENTIFIER_IN_SOME_VERSIONS = "finney" - | "szabo" - | "alias" - | "apply" - | "auto" - | "calldata" - | "constructor" - | "copyof" - | "define" - | "emit" - | "immutable" - | "implements" - | "macro" - | "mutable" - | "override" - | "partial" - | "promise" - | "reference" - | "sealed" - | "sizeof" - | "supports" - | "typedef" - | "unchecked"; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.6.0.md deleted file mode 100644 index 6abe398f85..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.6.0.md +++ /dev/null @@ -1,30 +0,0 @@ - - -```{ .ebnf .slang-ebnf #NOT_AN_IDENTIFIER_IN_SOME_VERSIONS } -NOT_AN_IDENTIFIER_IN_SOME_VERSIONS = "finney" - | "szabo" - | "alias" - | "apply" - | "auto" - | "calldata" - | "constructor" - | "copyof" - | "define" - | "emit" - | "immutable" - | "implements" - | "macro" - | "mutable" - | "override" - | "partial" - | "promise" - | "reference" - | "sealed" - | "sizeof" - | "supports" - | "typedef" - | "unchecked" - | "fallback" - | "receive" - | "virtual"; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.7.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.7.0.md deleted file mode 100644 index 3c32293818..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.7.0.md +++ /dev/null @@ -1,29 +0,0 @@ - - -```{ .ebnf .slang-ebnf #NOT_AN_IDENTIFIER_IN_SOME_VERSIONS } -NOT_AN_IDENTIFIER_IN_SOME_VERSIONS = "alias" - | "apply" - | "auto" - | "calldata" - | "constructor" - | "copyof" - | "define" - | "emit" - | "immutable" - | "implements" - | "macro" - | "mutable" - | "override" - | "partial" - | "promise" - | "reference" - | "sealed" - | "sizeof" - | "supports" - | "typedef" - | "unchecked" - | "fallback" - | "receive" - | "virtual" - | "gwei"; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md new file mode 100644 index 0000000000..11db139796 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md @@ -0,0 +1,12 @@ + + +```{ .ebnf .slang-ebnf #ASCII_ESCAPE } +«ASCII_ESCAPE» = "n" + | "r" + | "t" + | "'" + | '"' + | "\\" + | "\n" + | "\r"; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md similarity index 59% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md index 807362744b..52bf4be4b4 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ASCII_STRING_LITERAL } -ASCII_STRING_LITERAL = SINGLE_QUOTED_ASCII_STRING_LITERAL | DOUBLE_QUOTED_ASCII_STRING_LITERAL; +ASCII_STRING_LITERAL = «SINGLE_QUOTED_ASCII_STRING_LITERAL» | «DOUBLE_QUOTED_ASCII_STRING_LITERAL»; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md new file mode 100644 index 0000000000..6f98a30ae5 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #AsciiStringLiteralsList } +AsciiStringLiteralsList = ASCII_STRING_LITERAL+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md similarity index 61% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md index 71fbb88b5b..935cd9fa81 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #DOUBLE_QUOTED_ASCII_STRING_LITERAL } -DOUBLE_QUOTED_ASCII_STRING_LITERAL = '"' (ESCAPE_SEQUENCE | (" "…"~" - ('"' | "\\")))* '"'; +«DOUBLE_QUOTED_ASCII_STRING_LITERAL» = '"' («ESCAPE_SEQUENCE» | (" "…"~" - ('"' | "\\")))* '"'; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md new file mode 100644 index 0000000000..90914a6714 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #DOUBLE_QUOTED_HEX_STRING_LITERAL } +«DOUBLE_QUOTED_HEX_STRING_LITERAL» = "hex" '"' «HEX_STRING_CONTENTS»? '"'; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-unicode-string-literal/0.7.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-unicode-string-literal/0.7.0.md similarity index 60% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-unicode-string-literal/0.7.0.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-unicode-string-literal/0.7.0.md index 5ba672fb1b..74f4301279 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-unicode-string-literal/0.7.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-unicode-string-literal/0.7.0.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #DOUBLE_QUOTED_UNICODE_STRING_LITERAL } -DOUBLE_QUOTED_UNICODE_STRING_LITERAL = 'unicode"' (ESCAPE_SEQUENCE | !('"' | "\\" | "\n" | "\r"))* '"'; +«DOUBLE_QUOTED_UNICODE_STRING_LITERAL» = 'unicode"' («ESCAPE_SEQUENCE» | !('"' | "\\" | "\n" | "\r"))* '"'; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md similarity index 62% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md index 382a43b59b..7b8040b62e 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #ESCAPE_SEQUENCE } -ESCAPE_SEQUENCE = "\\" (ASCII_ESCAPE | HEX_BYTE_ESCAPE | UNICODE_ESCAPE); +«ESCAPE_SEQUENCE» = "\\" («ASCII_ESCAPE» | «HEX_BYTE_ESCAPE» | «UNICODE_ESCAPE»); ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md similarity index 70% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md index 9e6f2c8608..c099b217b5 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #HEX_BYTE_ESCAPE } -HEX_BYTE_ESCAPE = "x" «HEX_CHARACTER» «HEX_CHARACTER»; +«HEX_BYTE_ESCAPE» = "x" «HEX_CHARACTER» «HEX_CHARACTER»; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md similarity index 100% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md new file mode 100644 index 0000000000..3d1291a89e --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #HEX_STRING_CONTENTS } +«HEX_STRING_CONTENTS» = «HEX_CHARACTER» «HEX_CHARACTER» ("_"? «HEX_CHARACTER» «HEX_CHARACTER»)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md similarity index 53% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md index a4cce47d0e..7aa64db95d 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #HEX_STRING_LITERAL } -HEX_STRING_LITERAL = "hex" (('"' POSSIBLY_SEPARATED_PAIRS_OF_HEX_DIGITS? '"') | ("'" POSSIBLY_SEPARATED_PAIRS_OF_HEX_DIGITS? "'")); +HEX_STRING_LITERAL = «SINGLE_QUOTED_HEX_STRING_LITERAL» | «DOUBLE_QUOTED_HEX_STRING_LITERAL»; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md new file mode 100644 index 0000000000..952c673b1c --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #HexStringLiteralsList } +HexStringLiteralsList = HEX_STRING_LITERAL+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md similarity index 61% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md index 25ff8bacfc..09f639a292 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #SINGLE_QUOTED_ASCII_STRING_LITERAL } -SINGLE_QUOTED_ASCII_STRING_LITERAL = "'" (ESCAPE_SEQUENCE | (" "…"~" - ("'" | "\\")))* "'"; +«SINGLE_QUOTED_ASCII_STRING_LITERAL» = "'" («ESCAPE_SEQUENCE» | (" "…"~" - ("'" | "\\")))* "'"; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md new file mode 100644 index 0000000000..9fc8c6d8cd --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #SINGLE_QUOTED_HEX_STRING_LITERAL } +«SINGLE_QUOTED_HEX_STRING_LITERAL» = "hex" "'" «HEX_STRING_CONTENTS»? "'"; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-unicode-string-literal/0.7.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-unicode-string-literal/0.7.0.md similarity index 60% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-unicode-string-literal/0.7.0.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-unicode-string-literal/0.7.0.md index 56c7c162aa..76960f182f 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-unicode-string-literal/0.7.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-unicode-string-literal/0.7.0.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #SINGLE_QUOTED_UNICODE_STRING_LITERAL } -SINGLE_QUOTED_UNICODE_STRING_LITERAL = "unicode'" (ESCAPE_SEQUENCE | !("'" | "\\" | "\n" | "\r"))* "'"; +«SINGLE_QUOTED_UNICODE_STRING_LITERAL» = "unicode'" («ESCAPE_SEQUENCE» | !("'" | "\\" | "\n" | "\r"))* "'"; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.4.11.md similarity index 67% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.4.11.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.4.11.md index cc8d2a084a..2575fb1e1b 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.4.11.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #StringExpression } -StringExpression = HEX_STRING_LITERAL+ | ASCII_STRING_LITERAL+; +«StringExpression» = HexStringLiteralsList | AsciiStringLiteralsList; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.7.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.7.0.md similarity index 51% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.7.0.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.7.0.md index 307b464959..f17e366b14 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.7.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.7.0.md @@ -1,5 +1,7 @@ ```{ .ebnf .slang-ebnf #StringExpression } -StringExpression = HEX_STRING_LITERAL+ | ASCII_STRING_LITERAL+ | UNICODE_STRING_LITERAL+; +«StringExpression» = HexStringLiteralsList + | AsciiStringLiteralsList + | UnicodeStringLiteralsList; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md similarity index 59% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md index ad779b4e59..5531d771a3 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #UNICODE_ESCAPE } -UNICODE_ESCAPE = "u" «HEX_CHARACTER» «HEX_CHARACTER» «HEX_CHARACTER» «HEX_CHARACTER»; +«UNICODE_ESCAPE» = "u" «HEX_CHARACTER» «HEX_CHARACTER» «HEX_CHARACTER» «HEX_CHARACTER»; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-string-literal/0.7.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literal/0.7.0.md similarity index 58% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-string-literal/0.7.0.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literal/0.7.0.md index b19b724722..a5c1f74238 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-string-literal/0.7.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literal/0.7.0.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #UNICODE_STRING_LITERAL } -UNICODE_STRING_LITERAL = SINGLE_QUOTED_UNICODE_STRING_LITERAL | DOUBLE_QUOTED_UNICODE_STRING_LITERAL; +UNICODE_STRING_LITERAL = «SINGLE_QUOTED_UNICODE_STRING_LITERAL» | «DOUBLE_QUOTED_UNICODE_STRING_LITERAL»; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literals-list/0.7.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literals-list/0.7.0.md new file mode 100644 index 0000000000..7e8e02b04c --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literals-list/0.7.0.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #UnicodeStringLiteralsList } +UnicodeStringLiteralsList = UNICODE_STRING_LITERAL+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md similarity index 72% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md index f555ea3742..6025100858 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #IDENTIFIER_PART } -IDENTIFIER_PART = IDENTIFIER_START | "0"…"9"; +«IDENTIFIER_PART» = «IDENTIFIER_START» | "0"…"9"; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md similarity index 100% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md new file mode 100644 index 0000000000..9f75273877 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #IdentifierPathsList } +IdentifierPathsList = IdentifierPath (COMMA IdentifierPath)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md similarity index 71% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md index 33cd68aba4..a5170e2ca6 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #IDENTIFIER_START } -IDENTIFIER_START = "_" | "$" | "a"…"z" | "A"…"Z"; +«IDENTIFIER_START» = "_" | "$" | "a"…"z" | "A"…"Z"; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.4.11.md new file mode 100644 index 0000000000..1533a44e76 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.4.11.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #IDENTIFIER } +IDENTIFIER = «RAW_IDENTIFIER» - («KEYWORD_IN_ANY_VERSION» | «KEYWORD_IN_SOME_VERSION» | «RESERVED_WORD_IN_ANY_VERSION»); +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md new file mode 100644 index 0000000000..35c6e0ac53 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #IDENTIFIER } +IDENTIFIER = «RAW_IDENTIFIER» - («KEYWORD_IN_ANY_VERSION» | «KEYWORD_IN_SOME_VERSION» | «RESERVED_WORD_IN_ANY_VERSION» | «RESERVED_WORD_IN_SOME_VERSION»); +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md new file mode 100644 index 0000000000..991b451193 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #IdentifiersList } +IdentifiersList = IDENTIFIER (COMMA IDENTIFIER)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md new file mode 100644 index 0000000000..0169642094 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md @@ -0,0 +1,63 @@ + + +```{ .ebnf .slang-ebnf #KEYWORD_IN_ANY_VERSION } +«KEYWORD_IN_ANY_VERSION» = FIXED_BYTES_TYPE + | SIGNED_FIXED_TYPE + | UNSIGNED_FIXED_TYPE + | SIGNED_INTEGER_TYPE + | UNSIGNED_INTEGER_TYPE + | ADDRESS_KEYWORD + | ANONYMOUS_KEYWORD + | AS_KEYWORD + | ASSEMBLY_KEYWORD + | BOOL_KEYWORD + | BREAK_KEYWORD + | CASE_KEYWORD + | CONSTANT_KEYWORD + | CONTINUE_KEYWORD + | CONTRACT_KEYWORD + | DAYS_KEYWORD + | DEFAULT_KEYWORD + | DELETE_KEYWORD + | DO_KEYWORD + | ELSE_KEYWORD + | ENUM_KEYWORD + | ETHER_KEYWORD + | EVENT_KEYWORD + | EXTERNAL_KEYWORD + | FALSE_KEYWORD + | FOR_KEYWORD + | FUNCTION_KEYWORD + | HOURS_KEYWORD + | IF_KEYWORD + | IMPORT_KEYWORD + | INDEXED_KEYWORD + | INTERFACE_KEYWORD + | INTERNAL_KEYWORD + | IS_KEYWORD + | LET_KEYWORD + | LIBRARY_KEYWORD + | MAPPING_KEYWORD + | MEMORY_KEYWORD + | MINUTES_KEYWORD + | MODIFIER_KEYWORD + | NEW_KEYWORD + | PAYABLE_KEYWORD + | PRAGMA_KEYWORD + | PRIVATE_KEYWORD + | PUBLIC_KEYWORD + | PURE_KEYWORD + | RETURN_KEYWORD + | RETURNS_KEYWORD + | SECONDS_KEYWORD + | STORAGE_KEYWORD + | STRING_KEYWORD + | STRUCT_KEYWORD + | SWITCH_KEYWORD + | TRUE_KEYWORD + | USING_KEYWORD + | VIEW_KEYWORD + | WEEKS_KEYWORD + | WEI_KEYWORD + | WHILE_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.4.11.md new file mode 100644 index 0000000000..49e18239c3 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.4.11.md @@ -0,0 +1,10 @@ + + +```{ .ebnf .slang-ebnf #KEYWORD_IN_SOME_VERSION } +«KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + | FINNEY_KEYWORD + | SZABO_KEYWORD + | THROW_KEYWORD + | VAR_KEYWORD + | YEARS_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.5.0.md new file mode 100644 index 0000000000..ea39478f9c --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.5.0.md @@ -0,0 +1,11 @@ + + +```{ .ebnf .slang-ebnf #KEYWORD_IN_SOME_VERSION } +«KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + | FINNEY_KEYWORD + | SZABO_KEYWORD + | CALLDATA_KEYWORD + | CONSTRUCTOR_KEYWORD + | EMIT_KEYWORD + | OVERRIDE_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.5.3.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.5.3.md new file mode 100644 index 0000000000..71edffb3c4 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.5.3.md @@ -0,0 +1,12 @@ + + +```{ .ebnf .slang-ebnf #KEYWORD_IN_SOME_VERSION } +«KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + | FINNEY_KEYWORD + | SZABO_KEYWORD + | CALLDATA_KEYWORD + | CONSTRUCTOR_KEYWORD + | EMIT_KEYWORD + | OVERRIDE_KEYWORD + | TYPE_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.6.0.md new file mode 100644 index 0000000000..0dacb31c7e --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.6.0.md @@ -0,0 +1,18 @@ + + +```{ .ebnf .slang-ebnf #KEYWORD_IN_SOME_VERSION } +«KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + | FINNEY_KEYWORD + | SZABO_KEYWORD + | CALLDATA_KEYWORD + | CONSTRUCTOR_KEYWORD + | EMIT_KEYWORD + | OVERRIDE_KEYWORD + | TYPE_KEYWORD + | ABSTRACT_KEYWORD + | CATCH_KEYWORD + | FALLBACK_KEYWORD + | RECEIVE_KEYWORD + | TRY_KEYWORD + | VIRTUAL_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.6.5.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.6.5.md new file mode 100644 index 0000000000..4a51647332 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.6.5.md @@ -0,0 +1,19 @@ + + +```{ .ebnf .slang-ebnf #KEYWORD_IN_SOME_VERSION } +«KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + | FINNEY_KEYWORD + | SZABO_KEYWORD + | CALLDATA_KEYWORD + | CONSTRUCTOR_KEYWORD + | EMIT_KEYWORD + | OVERRIDE_KEYWORD + | TYPE_KEYWORD + | ABSTRACT_KEYWORD + | CATCH_KEYWORD + | FALLBACK_KEYWORD + | RECEIVE_KEYWORD + | TRY_KEYWORD + | VIRTUAL_KEYWORD + | IMMUTABLE_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.7.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.7.0.md new file mode 100644 index 0000000000..8ef48be018 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.7.0.md @@ -0,0 +1,18 @@ + + +```{ .ebnf .slang-ebnf #KEYWORD_IN_SOME_VERSION } +«KEYWORD_IN_SOME_VERSION» = BYTE_KEYWORD + | CALLDATA_KEYWORD + | CONSTRUCTOR_KEYWORD + | EMIT_KEYWORD + | OVERRIDE_KEYWORD + | TYPE_KEYWORD + | ABSTRACT_KEYWORD + | CATCH_KEYWORD + | FALLBACK_KEYWORD + | RECEIVE_KEYWORD + | TRY_KEYWORD + | VIRTUAL_KEYWORD + | IMMUTABLE_KEYWORD + | GWEI_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.8.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.8.0.md new file mode 100644 index 0000000000..69cafbde93 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.8.0.md @@ -0,0 +1,18 @@ + + +```{ .ebnf .slang-ebnf #KEYWORD_IN_SOME_VERSION } +«KEYWORD_IN_SOME_VERSION» = CALLDATA_KEYWORD + | CONSTRUCTOR_KEYWORD + | EMIT_KEYWORD + | OVERRIDE_KEYWORD + | TYPE_KEYWORD + | ABSTRACT_KEYWORD + | CATCH_KEYWORD + | FALLBACK_KEYWORD + | RECEIVE_KEYWORD + | TRY_KEYWORD + | VIRTUAL_KEYWORD + | IMMUTABLE_KEYWORD + | GWEI_KEYWORD + | UNCHECKED_KEYWORD; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md similarity index 69% rename from crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md index 5fc5cd9e2e..be87b0c318 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #RAW_IDENTIFIER } -RAW_IDENTIFIER = IDENTIFIER_START IDENTIFIER_PART*; +«RAW_IDENTIFIER» = «IDENTIFIER_START» «IDENTIFIER_PART»*; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md new file mode 100644 index 0000000000..1d0e4e8948 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md @@ -0,0 +1,25 @@ + + +```{ .ebnf .slang-ebnf #RESERVED_WORD_IN_ANY_VERSION } +«RESERVED_WORD_IN_ANY_VERSION» = "abstract" + | "after" + | "byte" + | "catch" + | "final" + | "finney" + | "hex" + | "in" + | "inline" + | "match" + | "null" + | "of" + | "relocatable" + | "static" + | "szabo" + | "throw" + | "try" + | "type" + | "typeof" + | "var" + | "years"; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md new file mode 100644 index 0000000000..75483fc966 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md @@ -0,0 +1,19 @@ + + +```{ .ebnf .slang-ebnf #RESERVED_WORD_IN_SOME_VERSION } +«RESERVED_WORD_IN_SOME_VERSION» = "alias" + | "apply" + | "auto" + | "copyof" + | "define" + | "implements" + | "macro" + | "mutable" + | "partial" + | "promise" + | "reference" + | "sealed" + | "sizeof" + | "supports" + | "typedef"; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md new file mode 100644 index 0000000000..cf88014be6 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #AssemblyFlagsList } +AssemblyFlagsList = ASCII_STRING_LITERAL (COMMA ASCII_STRING_LITERAL)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md deleted file mode 100644 index f88796e37d..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #AssemblyFlags } -AssemblyFlags = OPEN_PAREN DOUBLE_QUOTED_ASCII_STRING_LITERAL (COMMA DOUBLE_QUOTED_ASCII_STRING_LITERAL)* CLOSE_PAREN; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md index ff2c38b662..69082646bb 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #AssemblyStatement } -AssemblyStatement = ASSEMBLY_KEYWORD EVMASM? AssemblyFlags? YulBlock; +AssemblyStatement = ASSEMBLY_KEYWORD ASCII_STRING_LITERAL? (OPEN_PAREN AssemblyFlagsList CLOSE_PAREN)? YulBlock; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md deleted file mode 100644 index 1a5bdc9802..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #EVMASM } -EVMASM = '"evmasm"'; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md index c1bfb9274d..9b7cded517 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #YulAssignmentStatement } -YulAssignmentStatement = YulIdentifierPath (COMMA YulIdentifierPath)* COLON_EQUAL YulExpression; +YulAssignmentStatement = YulIdentifierPathsList COLON_EQUAL YulExpression; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md index 3350a49de5..0c68d15808 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #YulBlock } -YulBlock = OPEN_BRACE YulStatement* CLOSE_BRACE; +YulBlock = OPEN_BRACE YulStatementsList? CLOSE_BRACE; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md index 03f7afe84d..40601c9423 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #YulDeclarationStatement } -YulDeclarationStatement = LET_KEYWORD YulIdentifierPath (COMMA YulIdentifierPath)* (COLON_EQUAL YulExpression)?; +YulDeclarationStatement = LET_KEYWORD YulIdentifierPathsList (COLON_EQUAL YulExpression)?; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md index 596fd43a7b..942dab90fc 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md @@ -1,7 +1,5 @@ ```{ .ebnf .slang-ebnf #YulFunctionDefinition } -YulFunctionDefinition = FUNCTION_KEYWORD YUL_IDENTIFIER OPEN_PAREN Arguments? CLOSE_PAREN (MINUS_GREATER_THAN Results)? YulBlock; -Arguments = YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*; -Results = YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*; +YulFunctionDefinition = FUNCTION_KEYWORD YUL_IDENTIFIER YulParametersDeclaration YulReturnsDeclaration? YulBlock; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md new file mode 100644 index 0000000000..c71083489e --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #YulParametersDeclaration } +YulParametersDeclaration = OPEN_PAREN YulIdentifiersList? CLOSE_PAREN; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md new file mode 100644 index 0000000000..0bd933d45d --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #YulReturnsDeclaration } +YulReturnsDeclaration = MINUS_GREATER_THAN YulIdentifiersList; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md new file mode 100644 index 0000000000..2c25ac8d3a --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #YulStatementsList } +YulStatementsList = YulStatement+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md new file mode 100644 index 0000000000..8f4b54292c --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #YulSwitchCase } +YulSwitchCase = (DEFAULT_KEYWORD | (CASE_KEYWORD «YulLiteral»)) YulBlock; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md new file mode 100644 index 0000000000..95788c6af9 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #YulSwitchCasesList } +YulSwitchCasesList = YulSwitchCase+; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md index 84b183de3f..26788d6f69 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #YulSwitchStatement } -YulSwitchStatement = SWITCH_KEYWORD YulExpression (((CASE_KEYWORD YulLiteral) | DEFAULT_KEYWORD) YulBlock)+; +YulSwitchStatement = SWITCH_KEYWORD YulExpression YulSwitchCasesList; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md index b0f7e45d7d..c2e2e87a92 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md @@ -1,6 +1,6 @@ ```{ .ebnf .slang-ebnf #YulExpression } -YulExpression = YulFunctionCallExpression | YulLiteral | YulIdentifierPath; -YulFunctionCallExpression = YulExpression OPEN_PAREN (YulExpression (COMMA YulExpression)*)? CLOSE_PAREN; +YulExpression = YulFunctionCallExpression | «YulLiteral» | YulIdentifierPath; +YulFunctionCallExpression = YulExpression «YulFunctionCallOperator»; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md new file mode 100644 index 0000000000..71332c73f6 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #YulExpressionsList } +YulExpressionsList = YulExpression (COMMA YulExpression)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md new file mode 100644 index 0000000000..05e65b73c6 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #YulFunctionCallOperator } +«YulFunctionCallOperator» = OPEN_PAREN YulExpressionsList? CLOSE_PAREN; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md new file mode 100644 index 0000000000..807015bdff --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #YulIdentifierPathsList } +YulIdentifierPathsList = YulIdentifierPath (COMMA YulIdentifierPath)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md index 1c1c2415ee..aeb2c3c76a 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #YUL_IDENTIFIER } -YUL_IDENTIFIER = RAW_IDENTIFIER - (YUL_KEYWORD | YUL_RESERVED_KEYWORD); +YUL_IDENTIFIER = «RAW_IDENTIFIER» - («YUL_KEYWORD» | «YUL_RESERVED_WORD»); ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md new file mode 100644 index 0000000000..eabcb4f59c --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #YulIdentifiersList } +YulIdentifiersList = YUL_IDENTIFIER (COMMA YUL_IDENTIFIER)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.4.11.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.4.11.md index 40251e6d4c..560e2870d6 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.4.11.md +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.4.11.md @@ -1,15 +1,15 @@ ```{ .ebnf .slang-ebnf #YUL_KEYWORD } -YUL_KEYWORD = BREAK_KEYWORD - | CASE_KEYWORD - | CONTINUE_KEYWORD - | DEFAULT_KEYWORD - | FALSE_KEYWORD - | FOR_KEYWORD - | FUNCTION_KEYWORD - | IF_KEYWORD - | LET_KEYWORD - | SWITCH_KEYWORD - | TRUE_KEYWORD; +«YUL_KEYWORD» = BREAK_KEYWORD + | CASE_KEYWORD + | CONTINUE_KEYWORD + | DEFAULT_KEYWORD + | FALSE_KEYWORD + | FOR_KEYWORD + | FUNCTION_KEYWORD + | IF_KEYWORD + | LET_KEYWORD + | SWITCH_KEYWORD + | TRUE_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md index 8e874575b6..a8ad4c0e83 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md @@ -1,16 +1,16 @@ ```{ .ebnf .slang-ebnf #YUL_KEYWORD } -YUL_KEYWORD = BREAK_KEYWORD - | CASE_KEYWORD - | CONTINUE_KEYWORD - | DEFAULT_KEYWORD - | FALSE_KEYWORD - | FOR_KEYWORD - | FUNCTION_KEYWORD - | IF_KEYWORD - | LEAVE_KEYWORD - | LET_KEYWORD - | SWITCH_KEYWORD - | TRUE_KEYWORD; +«YUL_KEYWORD» = BREAK_KEYWORD + | CASE_KEYWORD + | CONTINUE_KEYWORD + | DEFAULT_KEYWORD + | FALSE_KEYWORD + | FOR_KEYWORD + | FUNCTION_KEYWORD + | IF_KEYWORD + | LEAVE_KEYWORD + | LET_KEYWORD + | SWITCH_KEYWORD + | TRUE_KEYWORD; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md index b1a6d41464..8d0de7d786 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md @@ -1,9 +1,10 @@ ```{ .ebnf .slang-ebnf #YulLiteral } -YulLiteral = BooleanLiteral - | YUL_HEX_LITERAL - | YUL_DECIMAL_LITERAL - | HEX_STRING_LITERAL - | ASCII_STRING_LITERAL; +«YulLiteral» = TRUE_KEYWORD + | FALSE_KEYWORD + | YUL_HEX_LITERAL + | YUL_DECIMAL_LITERAL + | HEX_STRING_LITERAL + | ASCII_STRING_LITERAL; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md deleted file mode 100644 index 6383040968..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #YUL_RESERVED_KEYWORD } -YUL_RESERVED_KEYWORD = "hex"; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md similarity index 58% rename from crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md index 0ad57ec3ac..edb400da9d 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md @@ -1,5 +1,5 @@ -```{ .ebnf .slang-ebnf #PayableType } -PayableType = PAYABLE_KEYWORD; +```{ .ebnf .slang-ebnf #YUL_RESERVED_WORD } +«YUL_RESERVED_WORD» = "hex"; ``` diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.4.11/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.4.11/index.md index 3a7aec011d..05389c3352 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.4.11/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.4.11/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -49,6 +57,7 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/assembly-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/bool-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/break-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/case-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/constant-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/continue-keyword/unversioned.md" @@ -170,21 +179,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.4.11.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -197,37 +211,41 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.4.11.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attributes-list/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attribute/0.4.11.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -235,7 +253,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.4.11.md" @@ -244,27 +265,33 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.4.11.md" ### 4.3. Control Statements @@ -294,9 +321,9 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" @@ -307,75 +334,100 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.4.11.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.4.11.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-break-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.4.21/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.4.21/index.md index edbd29aaeb..30ed6d7f15 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.4.21/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.4.21/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -49,6 +57,7 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/assembly-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/bool-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/break-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/case-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/constant-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/continue-keyword/unversioned.md" @@ -171,21 +180,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.4.11.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -198,37 +212,41 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.4.11.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attributes-list/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attribute/0.4.11.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -236,7 +254,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.4.11.md" @@ -245,27 +266,33 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.21.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.4.21.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.4.11.md" ### 4.3. Control Statements @@ -296,9 +323,9 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" @@ -309,75 +336,100 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.4.11.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.4.11.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-break-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.4.22/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.4.22/index.md index 975c3d34df..0cbdaa727f 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.4.22/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.4.22/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -49,6 +57,7 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/assembly-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/bool-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/break-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/case-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/constant-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/constructor-keyword/0.4.22.md" @@ -172,21 +181,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.4.22.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -199,39 +213,44 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.4.11.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attributes-list/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attribute/0.4.11.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -239,7 +258,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.4.11.md" @@ -248,27 +270,33 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.21.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.4.21.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.4.11.md" ### 4.3. Control Statements @@ -299,9 +327,9 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" @@ -312,75 +340,100 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.4.11.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.4.11.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-break-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.5.0/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.5.0/index.md index 3e423caf88..f2cfdd185d 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.5.0/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.5.0/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -49,6 +57,7 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/assembly-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/bool-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/break-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/calldata-keyword/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/case-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/constant-keyword/unversioned.md" @@ -170,21 +179,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.4.22.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -197,39 +211,44 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.4.11.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attributes-list/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attribute/0.4.11.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -237,7 +256,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.4.11.md" @@ -246,27 +268,33 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" ### 4.3. Control Statements @@ -296,9 +324,9 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" @@ -309,75 +337,101 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.5.0.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.5.0.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-break-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.5.3/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.5.3/index.md index 7ae2938170..1eec2c1847 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.5.3/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.5.3/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -49,6 +57,7 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/assembly-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/bool-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/break-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/calldata-keyword/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/case-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/constant-keyword/unversioned.md" @@ -171,21 +180,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.4.22.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -198,39 +212,44 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.4.11.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attributes-list/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/unnamed-function-attribute/0.4.11.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -238,7 +257,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.4.11.md" @@ -247,27 +269,33 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" ### 4.3. Control Statements @@ -297,9 +325,9 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" @@ -310,76 +338,102 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/type-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.5.0.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/type-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.5.0.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-break-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.0/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.0/index.md index 28e68709ef..fee4a1f953 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.0/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.0/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -50,6 +58,7 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/assembly-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/bool-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/break-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/calldata-keyword/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/case-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/catch-keyword/0.6.0.md" @@ -176,21 +185,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.6.0.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -203,41 +217,47 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.4.11.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -245,7 +265,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.4.11.md" @@ -254,27 +277,33 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" ### 4.3. Control Statements @@ -292,7 +321,9 @@ ### 4.4. Error Handling --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clauses-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause-error/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md" ## 5. Expressions @@ -306,9 +337,9 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" @@ -319,62 +350,82 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/type-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.5.0.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/type-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.5.0.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-leave-statement/0.6.0.md" @@ -382,14 +433,20 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.11/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.11/index.md index 384f872fc0..cbeb87ac6a 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.11/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.11/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -50,6 +58,7 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/assembly-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/bool-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/break-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/calldata-keyword/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/case-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/catch-keyword/0.6.0.md" @@ -178,21 +187,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.6.0.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -205,42 +219,47 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.6.5.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-call-options/0.6.2.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -248,7 +267,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.4.11.md" @@ -257,27 +279,33 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" ### 4.3. Control Statements @@ -295,7 +323,9 @@ ### 4.4. Error Handling --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clauses-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause-error/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md" ## 5. Expressions @@ -309,9 +339,9 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" @@ -322,62 +352,83 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/type-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.6.11.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.6.2.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/type-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.6.11.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.6.5.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-leave-statement/0.6.0.md" @@ -385,14 +436,20 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.2/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.2/index.md index 5eb0fe776a..01e7e2d7a1 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.2/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.2/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -50,6 +58,7 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/assembly-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/bool-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/break-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/calldata-keyword/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/case-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/catch-keyword/0.6.0.md" @@ -176,21 +185,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.6.0.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -203,42 +217,47 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.4.11.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-call-options/0.6.2.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -246,7 +265,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.4.11.md" @@ -255,27 +277,33 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" ### 4.3. Control Statements @@ -293,7 +321,9 @@ ### 4.4. Error Handling --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clauses-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause-error/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md" ## 5. Expressions @@ -307,9 +337,9 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" @@ -320,62 +350,83 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/type-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.5.0.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.6.2.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/type-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.5.0.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-leave-statement/0.6.0.md" @@ -383,14 +434,20 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.5/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.5/index.md index faa7b0e1e2..6e6c40f717 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.5/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.5/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -50,6 +58,7 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/assembly-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/bool-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/break-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/calldata-keyword/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/case-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/catch-keyword/0.6.0.md" @@ -177,21 +186,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.6.0.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -204,42 +218,47 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.6.5.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-call-options/0.6.2.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -247,7 +266,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.4.11.md" @@ -256,27 +278,33 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" ### 4.3. Control Statements @@ -294,7 +322,9 @@ ### 4.4. Error Handling --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clauses-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause-error/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md" ## 5. Expressions @@ -308,9 +338,9 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" @@ -321,62 +351,83 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/type-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.5.0.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.6.2.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/type-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.5.0.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.6.5.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-leave-statement/0.6.0.md" @@ -384,14 +435,20 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.7.0/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.7.0/index.md index 54e524ecc0..83bfbe896a 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.7.0/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.7.0/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -50,6 +58,7 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/assembly-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/bool-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/break-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/byte-keyword/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/calldata-keyword/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/case-keyword/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/07-keywords/catch-keyword/0.6.0.md" @@ -176,21 +185,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.6.0.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -203,42 +217,47 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.6.5.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-call-options/0.6.2.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -246,7 +265,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.4.11.md" @@ -255,27 +277,33 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/byte-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.4.11.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" ### 4.3. Control Statements @@ -293,7 +321,9 @@ ### 4.4. Error Handling --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clauses-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause-error/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md" ## 5. Expressions @@ -307,9 +337,9 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" @@ -320,65 +350,87 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/type-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.7.0.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.6.2.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/type-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.7.0.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literals-list/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-leave-statement/0.6.0.md" @@ -386,14 +438,20 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.0/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.0/index.md index 97b2cb8856..b2a41ce4eb 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.0/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.0/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.4.11.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -177,21 +185,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.6.0.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -204,42 +217,47 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.6.5.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-call-options/0.6.2.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -247,7 +265,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.4.11.md" @@ -256,27 +277,34 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.8.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.8.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/unchecked-block/0.8.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/unchecked-block/0.8.0.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" ### 4.3. Control Statements @@ -294,7 +322,9 @@ ### 4.4. Error Handling --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clauses-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause-error/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md" ## 5. Expressions @@ -308,78 +338,100 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/exponentiation-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-postfix-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-prefix-operator/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.6.2.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/type-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.7.0.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/type-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.7.0.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literals-list/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-leave-statement/0.6.0.md" @@ -387,14 +439,20 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.18/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.18/index.md index a91e117137..4e9a210a99 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.18/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.18/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.8.8.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.8.8.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -177,21 +185,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.8.8.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.8.8.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -204,37 +217,41 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.6.5.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-call-options/0.6.2.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.11. User Defined Value Types @@ -244,6 +261,7 @@ ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -251,7 +269,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.8.18.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.8.18.md" @@ -260,27 +281,34 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.8.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.8.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/unchecked-block/0.8.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/unchecked-block/0.8.0.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" ### 4.3. Control Statements @@ -298,7 +326,9 @@ ### 4.4. Error Handling --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clauses-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause-error/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md" ## 5. Expressions @@ -312,78 +342,100 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/exponentiation-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-postfix-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-prefix-operator/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.6.2.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/type-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.7.0.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/type-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.7.0.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literals-list/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-leave-statement/0.6.0.md" @@ -391,14 +443,20 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.19/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.19/index.md index ea8d365073..8e8fc6ea33 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.19/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.19/index.md @@ -7,29 +7,37 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.8.8.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.8.8.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.8.19.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/user-defined-operator/0.8.19.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.8.19.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-operator/0.8.19.md" ### 1.5. Trivia @@ -178,21 +186,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.8.8.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.8.8.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -205,37 +218,41 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.6.5.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-call-options/0.6.2.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.11. User Defined Value Types @@ -245,6 +262,7 @@ ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -252,7 +270,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.8.18.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.8.18.md" @@ -261,27 +282,34 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.8.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.8.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/unchecked-block/0.8.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/unchecked-block/0.8.0.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" ### 4.3. Control Statements @@ -299,7 +327,9 @@ ### 4.4. Error Handling --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clauses-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause-error/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md" ## 5. Expressions @@ -313,78 +343,100 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/exponentiation-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-postfix-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-prefix-operator/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.6.2.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/type-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.7.0.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/type-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.7.0.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literals-list/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-leave-statement/0.6.0.md" @@ -392,14 +444,20 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.8/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.8/index.md index fadb7113bf..b25d28d457 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.8/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.8/index.md @@ -7,28 +7,36 @@ ### 1.2. Source Unit --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/definition/0.8.8.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/02-source-unit/source-unit-member/0.8.8.md" ### 1.3. Pragmas --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/pragma-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-range-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-unary-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-specifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/version-pragma-value/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/abi-coder-pragma/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/03-pragmas/experimental-pragma/unversioned.md" ### 1.4. Imports --8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-directive/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/simple-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/asterisk-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/selective-import/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-alias/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/import-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/0.4.11.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/path-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/named-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/deconstruction-import-symbol/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-deconstruction/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbols-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/01-file-structure/04-imports/using-directive-symbol/0.4.11.md" ### 1.5. Trivia @@ -177,21 +185,26 @@ ### 2.1. Contracts --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-definition/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-body-element/0.8.8.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-types-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/inheritance-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/01-contracts/contract-member/0.8.8.md" ### 2.2. Interfaces --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/02-interfaces/interface-members-list/unversioned.md" ### 2.3. Libraries --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/03-libraries/library-members-list/unversioned.md" ### 2.4. Structs --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-members-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/04-structs/struct-member/unversioned.md" ### 2.5. Enums @@ -204,37 +217,41 @@ ### 2.7. State Variables ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/07-state-variables/state-variable-attribute/0.6.5.md" ### 2.8. Functions --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/returns-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/override-specifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter-declaration/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/positional-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument-list/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/function-call-options/0.6.2.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/named-argument/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameters-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/parameter/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-definition/0.4.22.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attributes-list/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/constructor-attribute/0.4.22.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/fallback-function-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-definition/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attributes-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/08-functions/receive-function-attribute/0.6.0.md" ### 2.9. Modifiers --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attributes-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-attribute/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/09-modifiers/modifier-invocation/unversioned.md" ### 2.10 Events --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/10-events/event-parameter/unversioned.md" ### 2.11. User Defined Value Types @@ -244,6 +261,7 @@ ### 2.12. Errors --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameters-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/02-definitions/12-errors/error-parameter/unversioned.md" ## 3. Types @@ -251,7 +269,10 @@ ### 3.1. Advanced Types --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/type-name/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/array-type-name-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attributes-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/function-type-attribute/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-key-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/01-advanced-types/mapping-value-type/0.4.11.md" @@ -260,27 +281,34 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/elementary-type/0.8.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/address-type/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/payable-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-bytes-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-integer-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-integer-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/integer-type-size/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/signed-fixed-type/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/unsigned-fixed-type/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/03-types/02-elementary-types/fixed-type-size/unversioned.md" ## 4. Statements ### 4.1. Blocks ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/0.8.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/unchecked-block/0.8.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statements-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/statement/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/control-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/simple-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/expression-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/01-blocks/unchecked-block/0.8.0.md" ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" ### 4.3. Control Statements @@ -298,7 +326,9 @@ ### 4.4. Error Handling --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/try-statement/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clauses-list/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause/0.6.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/catch-clause-error/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/04-error-handling/revert-statement/unversioned.md" ## 5. Expressions @@ -312,78 +342,100 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/equality-comparison-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/order-comparison-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-x-or-operator/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bit-and-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-x-or-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/bitwise-and-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/shift-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/add-sub-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/mul-div-mod-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/exponentiation-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-postfix-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/unary-prefix-operator/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/function-call-operator/0.6.2.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/member-access-operator/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/01-base-expressions/index-access-operator/unversioned.md" -### 5.2. Primary Expressions - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/primary-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/type-expression/0.5.3.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/new-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/tuple-expression/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/array-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-primary-expressions/boolean-literal/unversioned.md" - -### 5.3. Numbers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/numeric-expression/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/hex-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-literal/0.5.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-number/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/decimal-exponent/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-numbers/number-unit/0.7.0.md" - -### 5.4. Strings - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/string-expression/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/possibly-separated-pairs-of-hex-digits/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-character/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-ascii-string-literal/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/single-quoted-unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/double-quoted-unicode-string-literal/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/escape-sequence/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/ascii-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/hex-byte-escape/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-strings/unicode-escape/unversioned.md" - -### 5.5. Identifiers - ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-path/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-any-version/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/not-an-identifier-in-some-versions/0.7.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/raw-identifier/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-start/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-identifiers/identifier-part/unversioned.md" +### 5.2. Function Calls + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/positional-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/function-call-options/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-arguments-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/02-function-calls/named-argument/unversioned.md" + +### 5.3. Primary Expressions + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/primary-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/type-expression/0.5.3.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/new-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/tuple-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/array-values-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/03-primary-expressions/boolean-expression/unversioned.md" + +### 5.4. Numbers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/numeric-expression/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/hex-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-literal/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-digits/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/decimal-exponent/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/04-numbers/number-unit/0.7.0.md" + +### 5.5. Strings + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/string-expression/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-hex-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-string-contents/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-character/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literals-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-ascii-string-literal/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literals-list/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/single-quoted-unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/double-quoted-unicode-string-literal/0.7.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/escape-sequence/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/ascii-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/hex-byte-escape/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/05-strings/unicode-escape/unversioned.md" + +### 5.6. Identifiers + +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-paths-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifiers-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/keyword-in-some-version/0.8.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-any-version/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/reserved-word-in-some-version/0.5.0.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/raw-identifier/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-start/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/05-expressions/06-identifiers/identifier-part/unversioned.md" ## 6. Yul ### 6.1. Assembly Block --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/evmasm/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/01-assembly-block/assembly-flags-list/unversioned.md" ### 6.2. Yul Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-block/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statements-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-statement/0.6.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-function-definition/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-parameters-declaration/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-returns-declaration/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-assignment-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-if-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-leave-statement/0.6.0.md" @@ -391,14 +443,20 @@ --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-continue-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-for-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-statement/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-cases-list/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/02-yul-statements/yul-switch-case/unversioned.md" ### 6.3. Yul Expressions +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expressions-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-expression/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-function-call-operator/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-paths-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier-path/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifiers-list/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-identifier/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-keyword/0.6.0.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-keyword/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-reserved-word/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-hex-literal/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/06-yul/03-yul-expressions/yul-decimal-literal/unversioned.md" diff --git a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/02-primary-expressions/index.md b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/02-function-calls/index.md similarity index 72% rename from crates/solidity/outputs/spec/generated/public/reference/05-expressions/02-primary-expressions/index.md rename to crates/solidity/outputs/spec/generated/public/reference/05-expressions/02-function-calls/index.md index 231c02da87..333a77675a 100644 --- a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/02-primary-expressions/index.md +++ b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/02-function-calls/index.md @@ -1,5 +1,5 @@ -# 5.2. Primary Expressions +# 5.2. Function Calls ---8<-- "crates/solidity/inputs/language/definition/05-expressions/02-primary-expressions/notes.md" +--8<-- "crates/solidity/inputs/language/definition/05-expressions/02-function-calls/notes.md" diff --git a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/03-primary-expressions/index.md b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/03-primary-expressions/index.md new file mode 100644 index 0000000000..c328d1153e --- /dev/null +++ b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/03-primary-expressions/index.md @@ -0,0 +1,5 @@ + + +# 5.3. Primary Expressions + +--8<-- "crates/solidity/inputs/language/definition/05-expressions/03-primary-expressions/notes.md" diff --git a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/03-numbers/index.md b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/04-numbers/index.md similarity index 81% rename from crates/solidity/outputs/spec/generated/public/reference/05-expressions/03-numbers/index.md rename to crates/solidity/outputs/spec/generated/public/reference/05-expressions/04-numbers/index.md index fa434fdf29..3b1773ad11 100644 --- a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/03-numbers/index.md +++ b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/04-numbers/index.md @@ -1,5 +1,5 @@ -# 5.3. Numbers +# 5.4. Numbers ---8<-- "crates/solidity/inputs/language/definition/05-expressions/03-numbers/notes.md" +--8<-- "crates/solidity/inputs/language/definition/05-expressions/04-numbers/notes.md" diff --git a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/04-strings/index.md b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/05-strings/index.md similarity index 81% rename from crates/solidity/outputs/spec/generated/public/reference/05-expressions/04-strings/index.md rename to crates/solidity/outputs/spec/generated/public/reference/05-expressions/05-strings/index.md index e61b48d17a..4dbb8904dc 100644 --- a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/04-strings/index.md +++ b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/05-strings/index.md @@ -1,5 +1,5 @@ -# 5.4. Strings +# 5.5. Strings ---8<-- "crates/solidity/inputs/language/definition/05-expressions/04-strings/notes.md" +--8<-- "crates/solidity/inputs/language/definition/05-expressions/05-strings/notes.md" diff --git a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/05-identifiers/index.md b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/06-identifiers/index.md similarity index 78% rename from crates/solidity/outputs/spec/generated/public/reference/05-expressions/05-identifiers/index.md rename to crates/solidity/outputs/spec/generated/public/reference/05-expressions/06-identifiers/index.md index fff2fee74a..43935e8cc4 100644 --- a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/05-identifiers/index.md +++ b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/06-identifiers/index.md @@ -1,5 +1,5 @@ -# 5.5. Identifiers +# 5.6. Identifiers ---8<-- "crates/solidity/inputs/language/definition/05-expressions/05-identifiers/notes.md" +--8<-- "crates/solidity/inputs/language/definition/05-expressions/06-identifiers/notes.md" diff --git a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/NAV.md b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/NAV.md index 075dc08d37..a8d32d8b53 100644 --- a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/NAV.md +++ b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/NAV.md @@ -2,7 +2,8 @@ - [5. Expressions](./index.md) - [5.1. Base Expressions](./01-base-expressions/index.md) -- [5.2. Primary Expressions](./02-primary-expressions/index.md) -- [5.3. Numbers](./03-numbers/index.md) -- [5.4. Strings](./04-strings/index.md) -- [5.5. Identifiers](./05-identifiers/index.md) +- [5.2. Function Calls](./02-function-calls/index.md) +- [5.3. Primary Expressions](./03-primary-expressions/index.md) +- [5.4. Numbers](./04-numbers/index.md) +- [5.5. Strings](./05-strings/index.md) +- [5.6. Identifiers](./06-identifiers/index.md) diff --git a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/index.md b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/index.md index 1b548c9fe8..df9a4afbd2 100644 --- a/crates/solidity/outputs/spec/generated/public/reference/05-expressions/index.md +++ b/crates/solidity/outputs/spec/generated/public/reference/05-expressions/index.md @@ -3,7 +3,8 @@ # 5. Expressions - [5.1. Base Expressions](./01-base-expressions/index.md) -- [5.2. Primary Expressions](./02-primary-expressions/index.md) -- [5.3. Numbers](./03-numbers/index.md) -- [5.4. Strings](./04-strings/index.md) -- [5.5. Identifiers](./05-identifiers/index.md) +- [5.2. Function Calls](./02-function-calls/index.md) +- [5.3. Primary Expressions](./03-primary-expressions/index.md) +- [5.4. Numbers](./04-numbers/index.md) +- [5.5. Strings](./05-strings/index.md) +- [5.6. Identifiers](./06-identifiers/index.md) diff --git a/crates/solidity/testing/smoke/src/main.rs b/crates/solidity/testing/smoke/src/main.rs index 2961973814..db688e1970 100644 --- a/crates/solidity/testing/smoke/src/main.rs +++ b/crates/solidity/testing/smoke/src/main.rs @@ -94,8 +94,7 @@ fn process_source_file( continue; } - // solc doesn't follow SemVer, and introduces breaking changes during minor version upgrades. - // Let's run against the latest release of each minor release. + // Let's test each minor version only once: let unique_key = version.major ^ version.minor; if !tested_versions.insert(unique_key) { continue; diff --git a/crates/solidity/testing/snapshots/cst_output/StringExpression/ascii_multiple/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiteralsList/multiple/generated/0.4.11.yml similarity index 84% rename from crates/solidity/testing/snapshots/cst_output/StringExpression/ascii_multiple/generated/0.4.11.yml rename to crates/solidity/testing/snapshots/cst_output/AsciiStringLiteralsList/multiple/generated/0.4.11.yml index 92a013e92a..0043a357a5 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringExpression/ascii_multiple/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiteralsList/multiple/generated/0.4.11.yml @@ -6,6 +6,6 @@ Source: > Errors: [] Tree: - - StringExpression (Rule): # 0..11 '"foo" ''bar''' + - AsciiStringLiteralsList (Rule): # 0..11 '"foo" ''bar''' - AsciiStringLiteral (Token): '"foo"' # 0..5 - AsciiStringLiteral (Token): "'bar'" # 6..11 diff --git a/crates/solidity/testing/snapshots/cst_output/StringExpression/ascii_multiple/input.sol b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiteralsList/multiple/input.sol similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/StringExpression/ascii_multiple/input.sol rename to crates/solidity/testing/snapshots/cst_output/AsciiStringLiteralsList/multiple/input.sol diff --git a/crates/solidity/testing/snapshots/cst_output/StringExpression/ascii_single/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiteralsList/single/generated/0.4.11.yml similarity index 84% rename from crates/solidity/testing/snapshots/cst_output/StringExpression/ascii_single/generated/0.4.11.yml rename to crates/solidity/testing/snapshots/cst_output/AsciiStringLiteralsList/single/generated/0.4.11.yml index 2a4a4b548e..4fb0ede882 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringExpression/ascii_single/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiteralsList/single/generated/0.4.11.yml @@ -6,5 +6,5 @@ Source: > Errors: [] Tree: - - StringExpression (Rule): # 0..5 '"foo"' + - AsciiStringLiteralsList (Rule): # 0..5 '"foo"' - AsciiStringLiteral (Token): '"foo"' # 0..5 diff --git a/crates/solidity/testing/snapshots/cst_output/StringExpression/ascii_single/input.sol b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiteralsList/single/input.sol similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/StringExpression/ascii_single/input.sol rename to crates/solidity/testing/snapshots/cst_output/AsciiStringLiteralsList/single/input.sol diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.4.11.yml index f3a19eb1b1..a884f81710 100644 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.4.11.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected Identifier or MemoryKeyword or Period or StorageKeyword. + Error: Expected Semicolon. ╭─[crates/solidity/testing/snapshots/cst_output/Block/unchecked/input.sol:1:2] │ 1 │ { unchecked { x = 1; } } @@ -16,10 +16,9 @@ Errors: # 1 total Tree: - Block (Rule): # 0..34 "{ unchecked { x = 1; } }" - OpenBrace (Token): "{" # 0..1 - - Statement (Rule): # 1..11 " unchecked" - - SimpleStatement (Rule): # 1..11 " unchecked" - - VariableDeclarationStatement (Rule): # 1..11 " unchecked" - - TypeName (Rule): # 1..11 " unchecked" - - IdentifierPath (Rule): # 1..11 " unchecked" - - Identifier (Token): "unchecked" # 2..11 + - StatementsList (Rule): # 1..11 " unchecked" + - Statement (Rule): # 1..11 " unchecked" + - ExpressionStatement (Rule): # 1..11 " unchecked" + - Expression (Rule): # 1..11 " unchecked" + - Identifier (Token): "unchecked" # 2..11 - SKIPPED (Token): " { x = 1; } }" # 11..34 diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.0.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.0.yml deleted file mode 100644 index 525d5ec925..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.0.yml +++ /dev/null @@ -1,19 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ { unchecked { x = 1; } } │ 0..24 - -Errors: # 1 total - - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteType or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. - ╭─[crates/solidity/testing/snapshots/cst_output/Block/unchecked/input.sol:1:2] - │ - 1 │ { unchecked { x = 1; } } - │ ───────────┬─────────── - │ ╰───────────── Error occurred here. - ───╯ - -Tree: - - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - - OpenBrace (Token): "{" # 0..1 - - SKIPPED (Token): " unchecked { x = 1; } }" # 1..24 diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.3.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.3.yml deleted file mode 100644 index 9ce266b7f0..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.3.yml +++ /dev/null @@ -1,19 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ { unchecked { x = 1; } } │ 0..24 - -Errors: # 1 total - - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteType or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. - ╭─[crates/solidity/testing/snapshots/cst_output/Block/unchecked/input.sol:1:2] - │ - 1 │ { unchecked { x = 1; } } - │ ───────────┬─────────── - │ ╰───────────── Error occurred here. - ───╯ - -Tree: - - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - - OpenBrace (Token): "{" # 0..1 - - SKIPPED (Token): " unchecked { x = 1; } }" # 1..24 diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.6.0.yml deleted file mode 100644 index 64af96833d..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.6.0.yml +++ /dev/null @@ -1,19 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ { unchecked { x = 1; } } │ 0..24 - -Errors: # 1 total - - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteType or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. - ╭─[crates/solidity/testing/snapshots/cst_output/Block/unchecked/input.sol:1:2] - │ - 1 │ { unchecked { x = 1; } } - │ ───────────┬─────────── - │ ╰───────────── Error occurred here. - ───╯ - -Tree: - - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - - OpenBrace (Token): "{" # 0..1 - - SKIPPED (Token): " unchecked { x = 1; } }" # 1..24 diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.7.0.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.7.0.yml deleted file mode 100644 index e69fd0ec59..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.7.0.yml +++ /dev/null @@ -1,19 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ { unchecked { x = 1; } } │ 0..24 - -Errors: # 1 total - - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteType or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. - ╭─[crates/solidity/testing/snapshots/cst_output/Block/unchecked/input.sol:1:2] - │ - 1 │ { unchecked { x = 1; } } - │ ───────────┬─────────── - │ ╰───────────── Error occurred here. - ───╯ - -Tree: - - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - - OpenBrace (Token): "{" # 0..1 - - SKIPPED (Token): " unchecked { x = 1; } }" # 1..24 diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.8.0.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.8.0.yml index 00829b7b66..4779b7c45a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.8.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.8.0.yml @@ -8,24 +8,23 @@ Errors: [] Tree: - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - OpenBrace (Token): "{" # 0..1 - - UncheckedBlock (Rule): # 1..22 " unchecked { x = 1; }" - - UncheckedKeyword (Token): "unchecked" # 2..11 - - Block (Rule): # 11..22 " { x = 1; }" - - OpenBrace (Token): "{" # 12..13 - - Statement (Rule): # 13..20 " x = 1;" - - SimpleStatement (Rule): # 13..20 " x = 1;" - - ExpressionStatement (Rule): # 13..20 " x = 1;" - - Expression (Rule): # 13..19 " x = 1" - - AssignmentExpression (Rule): # 13..19 " x = 1" - - Expression (Rule): # 13..15 " x" - - PrimaryExpression (Rule): # 13..15 " x" - - Identifier (Token): "x" # 14..15 - - AssignmentOperator (Rule): # 15..17 " =" - - Equal (Token): "=" # 16..17 - - Expression (Rule): # 17..19 " 1" - - PrimaryExpression (Rule): # 17..19 " 1" - - NumericExpression (Rule): # 17..19 " 1" - - DecimalLiteral (Token): "1" # 18..19 - - Semicolon (Token): ";" # 19..20 - - CloseBrace (Token): "}" # 21..22 + - StatementsList (Rule): # 1..22 " unchecked { x = 1; }" + - Statement (Rule): # 1..22 " unchecked { x = 1; }" + - UncheckedBlock (Rule): # 1..22 " unchecked { x = 1; }" + - UncheckedKeyword (Token): "unchecked" # 2..11 + - Block (Rule): # 11..22 " { x = 1; }" + - OpenBrace (Token): "{" # 12..13 + - StatementsList (Rule): # 13..20 " x = 1;" + - Statement (Rule): # 13..20 " x = 1;" + - ExpressionStatement (Rule): # 13..20 " x = 1;" + - Expression (Rule): # 13..19 " x = 1" + - BinaryExpression (Rule): # 13..19 " x = 1" + - Expression (Rule): # 13..15 " x" + - Identifier (Token): "x" # 14..15 + - Equal (Token): "=" # 16..17 + - Expression (Rule): # 17..19 " 1" + - NumericExpression (Rule): # 17..19 " 1" + - DecimalLiteral (Token): "1" # 18..19 + - Semicolon (Token): ";" # 19..20 + - CloseBrace (Token): "}" # 21..22 - CloseBrace (Token): "}" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.22.yml b/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.22.yml index 4f32043109..5bc3260939 100644 --- a/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.22.yml +++ b/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.22.yml @@ -8,7 +8,7 @@ Errors: [] Tree: - ConstructorDefinition (Rule): # 0..17 "constructor () {}" - ConstructorKeyword (Token): "constructor" # 0..11 - - ParameterList (Rule): # 11..14 " ()" + - ParametersDeclaration (Rule): # 11..14 " ()" - OpenParen (Token): "(" # 12..13 - CloseParen (Token): ")" # 13..14 - Block (Rule): # 14..17 " {}" diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/abstract_contract/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/abstract_contract/generated/0.6.0.yml index ccc29a5bdd..b888d1908c 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/abstract_contract/generated/0.6.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/abstract_contract/generated/0.6.0.yml @@ -11,5 +11,4 @@ Tree: - ContractKeyword (Token): "contract" # 9..17 - Identifier (Token): "Sample" # 18..24 - OpenBrace (Token): "{" # 25..26 - - ContractBodyElements (Rule): [] # 26..26 - CloseBrace (Token): "}" # 26..27 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/empty_contract/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/empty_contract/generated/0.4.11.yml index 4ffa84549f..ac41b0a014 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/empty_contract/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/empty_contract/generated/0.4.11.yml @@ -10,5 +10,4 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractBodyElements (Rule): [] # 17..17 - CloseBrace (Token): "}" # 17..18 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/generated/0.4.11.yml new file mode 100644 index 0000000000..c52bf5eaa5 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/generated/0.4.11.yml @@ -0,0 +1,38 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample is Foo, Bar(1, 2), Baz {} │ 0..41 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..41 "contract Sample is Foo, Bar(1, 2), Baz {}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - InheritanceSpecifier (Rule): # 15..38 " is Foo, Bar(1, 2), Baz" + - IsKeyword (Token): "is" # 16..18 + - InheritanceTypesList (Rule): # 18..38 " Foo, Bar(1, 2), Baz" + - InheritanceType (Rule): # 18..22 " Foo" + - IdentifierPath (Rule): # 18..22 " Foo" + - Identifier (Token): "Foo" # 19..22 + - Comma (Token): "," # 22..23 + - InheritanceType (Rule): # 23..33 " Bar(1, 2)" + - IdentifierPath (Rule): # 23..27 " Bar" + - Identifier (Token): "Bar" # 24..27 + - ArgumentsDeclaration (Rule): # 27..33 "(1, 2)" + - OpenParen (Token): "(" # 27..28 + - PositionalArgumentsList (Rule): # 28..32 "1, 2" + - Expression (Rule): # 28..29 "1" + - NumericExpression (Rule): # 28..29 "1" + - DecimalLiteral (Token): "1" # 28..29 + - Comma (Token): "," # 29..30 + - Expression (Rule): # 30..32 " 2" + - NumericExpression (Rule): # 30..32 " 2" + - DecimalLiteral (Token): "2" # 31..32 + - CloseParen (Token): ")" # 32..33 + - Comma (Token): "," # 33..34 + - InheritanceType (Rule): # 34..38 " Baz" + - IdentifierPath (Rule): # 34..38 " Baz" + - Identifier (Token): "Baz" # 35..38 + - OpenBrace (Token): "{" # 39..40 + - CloseBrace (Token): "}" # 40..41 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/input.sol new file mode 100644 index 0000000000..685b60596a --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/input.sol @@ -0,0 +1 @@ +contract Sample is Foo, Bar(1, 2), Baz {} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.11.yml new file mode 100644 index 0000000000..19b37910fe --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.11.yml @@ -0,0 +1,31 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ constructor() public { │ 18..42 + 3 │ } │ 43..46 + 4 │ } │ 47..48 + +Errors: # 1 total + - > + Error: Expected ConstantKeyword or Identifier or InternalKeyword or OverrideKeyword or Period or PrivateKeyword or PublicKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/input.sol:2:14] + │ + 2 │ ╭─▶ constructor() public { + ┆ ┆ + 4 │ ├─▶ } + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - ContractDefinition (Rule): # 0..48 "contract Sample {\n constructor() public {\n }\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..31 " constructor" + - StateVariableDefinition (Rule): # 18..31 " constructor" + - TypeName (Rule): # 18..31 " constructor" + - IdentifierPath (Rule): # 18..31 " constructor" + - Identifier (Token): "constructor" # 20..31 + - SKIPPED (Token): "() public {\n }\n}" # 31..48 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.22.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.22.yml new file mode 100644 index 0000000000..e4bfe43846 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.22.yml @@ -0,0 +1,27 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ constructor() public { │ 18..42 + 3 │ } │ 43..46 + 4 │ } │ 47..48 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..48 "contract Sample {\n constructor() public {\n }\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..47 " constructor() public {\n }\n" + - ConstructorDefinition (Rule): # 18..47 " constructor() public {\n }\n" + - ConstructorKeyword (Token): "constructor" # 20..31 + - ParametersDeclaration (Rule): # 31..33 "()" + - OpenParen (Token): "(" # 31..32 + - CloseParen (Token): ")" # 32..33 + - ConstructorAttributesList (Rule): # 33..40 " public" + - PublicKeyword (Token): "public" # 34..40 + - Block (Rule): # 40..47 " {\n }\n" + - OpenBrace (Token): "{" # 41..42 + - CloseBrace (Token): "}" # 45..46 + - CloseBrace (Token): "}" # 47..48 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/input.sol new file mode 100644 index 0000000000..004d0f1199 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/input.sol @@ -0,0 +1,4 @@ +contract Sample { + constructor() public { + } +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/generated/0.4.11.yml new file mode 100644 index 0000000000..5f7e784e79 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/generated/0.4.11.yml @@ -0,0 +1,31 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ enum State { │ 18..32 + 3 │ A, │ 33..39 + 4 │ B, │ 40..46 + 5 │ C │ 47..52 + 6 │ } │ 53..56 + 7 │ } │ 57..58 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..58 "contract Sample {\n enum State {\n A,\n B,\n ..." + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..57 " enum State {\n A,\n B,\n C\n }\n" + - EnumDefinition (Rule): # 18..57 " enum State {\n A,\n B,\n C\n }\n" + - EnumKeyword (Token): "enum" # 20..24 + - Identifier (Token): "State" # 25..30 + - OpenBrace (Token): "{" # 31..32 + - IdentifiersList (Rule): # 33..53 " A,\n B,\n C\n" + - Identifier (Token): "A" # 37..38 + - Comma (Token): "," # 38..39 + - Identifier (Token): "B" # 44..45 + - Comma (Token): "," # 45..46 + - Identifier (Token): "C" # 51..52 + - CloseBrace (Token): "}" # 55..56 + - CloseBrace (Token): "}" # 57..58 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/input.sol new file mode 100644 index 0000000000..1d4a9a9811 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/input.sol @@ -0,0 +1,7 @@ +contract Sample { + enum State { + A, + B, + C + } +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.4.11.yml new file mode 100644 index 0000000000..0f50c271da --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.4.11.yml @@ -0,0 +1,22 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ error Error1(); │ 18..35 + 3 │ } │ 36..37 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..37 "contract Sample {\n error Error1();\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..36 " error Error1();\n" + - ErrorDefinition (Rule): # 18..36 " error Error1();\n" + - ErrorKeyword (Token): "error" # 20..25 + - Identifier (Token): "Error1" # 26..32 + - OpenParen (Token): "(" # 32..33 + - CloseParen (Token): ")" # 33..34 + - Semicolon (Token): ";" # 34..35 + - CloseBrace (Token): "}" # 36..37 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/input.sol new file mode 100644 index 0000000000..6abcdbfd15 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/input.sol @@ -0,0 +1,3 @@ +contract Sample { + error Error1(); +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/generated/0.4.11.yml new file mode 100644 index 0000000000..7a880a0155 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/generated/0.4.11.yml @@ -0,0 +1,34 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ event Log(uint256 indexed a, uint256 indexed b); │ 18..68 + 3 │ } │ 69..70 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..70 "contract Sample {\n event Log(uint256 indexed a, u..." + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..69 " event Log(uint256 indexed a, uint256 indexed b);..." + - EventDefinition (Rule): # 18..69 " event Log(uint256 indexed a, uint256 indexed b);..." + - EventKeyword (Token): "event" # 20..25 + - Identifier (Token): "Log" # 26..29 + - OpenParen (Token): "(" # 29..30 + - EventParametersList (Rule): # 30..66 "uint256 indexed a, uint256 indexed b" + - EventParameter (Rule): # 30..47 "uint256 indexed a" + - TypeName (Rule): # 30..37 "uint256" + - UnsignedIntegerType (Token): "uint256" # 30..37 + - IndexedKeyword (Token): "indexed" # 38..45 + - Identifier (Token): "a" # 46..47 + - Comma (Token): "," # 47..48 + - EventParameter (Rule): # 48..66 " uint256 indexed b" + - TypeName (Rule): # 48..56 " uint256" + - UnsignedIntegerType (Token): "uint256" # 49..56 + - IndexedKeyword (Token): "indexed" # 57..64 + - Identifier (Token): "b" # 65..66 + - CloseParen (Token): ")" # 66..67 + - Semicolon (Token): ";" # 67..68 + - CloseBrace (Token): "}" # 69..70 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/input.sol new file mode 100644 index 0000000000..2faf09f3ed --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/input.sol @@ -0,0 +1,3 @@ +contract Sample { + event Log(uint256 indexed a, uint256 indexed b); +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.4.11.yml new file mode 100644 index 0000000000..b9c74c1fa7 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.4.11.yml @@ -0,0 +1,31 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ fallback() { │ 18..32 + 3 │ } │ 33..36 + 4 │ } │ 37..38 + +Errors: # 1 total + - > + Error: Expected ConstantKeyword or Identifier or InternalKeyword or OverrideKeyword or Period or PrivateKeyword or PublicKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/input.sol:2:11] + │ + 2 │ ╭─▶ fallback() { + ┆ ┆ + 4 │ ├─▶ } + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - ContractDefinition (Rule): # 0..38 "contract Sample {\n fallback() {\n }\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..28 " fallback" + - StateVariableDefinition (Rule): # 18..28 " fallback" + - TypeName (Rule): # 18..28 " fallback" + - IdentifierPath (Rule): # 18..28 " fallback" + - Identifier (Token): "fallback" # 20..28 + - SKIPPED (Token): "() {\n }\n}" # 28..38 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.6.0.yml new file mode 100644 index 0000000000..0dd32f0544 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.6.0.yml @@ -0,0 +1,25 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ fallback() { │ 18..32 + 3 │ } │ 33..36 + 4 │ } │ 37..38 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..38 "contract Sample {\n fallback() {\n }\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..37 " fallback() {\n }\n" + - FallbackFunctionDefinition (Rule): # 18..37 " fallback() {\n }\n" + - FallbackKeyword (Token): "fallback" # 20..28 + - ParametersDeclaration (Rule): # 28..30 "()" + - OpenParen (Token): "(" # 28..29 + - CloseParen (Token): ")" # 29..30 + - Block (Rule): # 30..37 " {\n }\n" + - OpenBrace (Token): "{" # 31..32 + - CloseBrace (Token): "}" # 35..36 + - CloseBrace (Token): "}" # 37..38 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/input.sol new file mode 100644 index 0000000000..1027530720 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/input.sol @@ -0,0 +1,4 @@ +contract Sample { + fallback() { + } +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/generated/0.4.11.yml new file mode 100644 index 0000000000..d74dd4d743 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/generated/0.4.11.yml @@ -0,0 +1,44 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ function foo() returns (uint) { │ 18..51 + 3 │ return 1; │ 52..65 + 4 │ } │ 66..69 + 5 │ } │ 70..71 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..71 "contract Sample {\n function foo() returns (uint) ..." + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..70 " function foo() returns (uint) {\n return 1;\n ..." + - FunctionDefinition (Rule): # 18..70 " function foo() returns (uint) {\n return 1;\n ..." + - FunctionKeyword (Token): "function" # 20..28 + - Identifier (Token): "foo" # 29..32 + - ParametersDeclaration (Rule): # 32..34 "()" + - OpenParen (Token): "(" # 32..33 + - CloseParen (Token): ")" # 33..34 + - ReturnsDeclaration (Rule): # 34..49 " returns (uint)" + - ReturnsKeyword (Token): "returns" # 35..42 + - ParametersDeclaration (Rule): # 42..49 " (uint)" + - OpenParen (Token): "(" # 43..44 + - ParametersList (Rule): # 44..48 "uint" + - Parameter (Rule): # 44..48 "uint" + - TypeName (Rule): # 44..48 "uint" + - UnsignedIntegerType (Token): "uint" # 44..48 + - CloseParen (Token): ")" # 48..49 + - Block (Rule): # 49..70 " {\n return 1;\n }\n" + - OpenBrace (Token): "{" # 50..51 + - StatementsList (Rule): # 52..66 " return 1;\n" + - Statement (Rule): # 52..66 " return 1;\n" + - ReturnStatement (Rule): # 52..66 " return 1;\n" + - ReturnKeyword (Token): "return" # 56..62 + - Expression (Rule): # 62..64 " 1" + - NumericExpression (Rule): # 62..64 " 1" + - DecimalLiteral (Token): "1" # 63..64 + - Semicolon (Token): ";" # 64..65 + - CloseBrace (Token): "}" # 68..69 + - CloseBrace (Token): "}" # 70..71 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/input.sol new file mode 100644 index 0000000000..d45857a937 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/input.sol @@ -0,0 +1,5 @@ +contract Sample { + function foo() returns (uint) { + return 1; + } +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/generated/0.4.11.yml new file mode 100644 index 0000000000..c7e3a26c76 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/generated/0.4.11.yml @@ -0,0 +1,33 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ modifier foo() { │ 18..36 + 3 │ _; │ 37..43 + 4 │ } │ 44..47 + 5 │ } │ 48..49 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..49 "contract Sample {\n modifier foo() {\n _;\n }\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..48 " modifier foo() {\n _;\n }\n" + - ModifierDefinition (Rule): # 18..48 " modifier foo() {\n _;\n }\n" + - ModifierKeyword (Token): "modifier" # 20..28 + - Identifier (Token): "foo" # 29..32 + - ParametersDeclaration (Rule): # 32..34 "()" + - OpenParen (Token): "(" # 32..33 + - CloseParen (Token): ")" # 33..34 + - Block (Rule): # 34..48 " {\n _;\n }\n" + - OpenBrace (Token): "{" # 35..36 + - StatementsList (Rule): # 37..44 " _;\n" + - Statement (Rule): # 37..44 " _;\n" + - ExpressionStatement (Rule): # 37..44 " _;\n" + - Expression (Rule): # 37..42 " _" + - Identifier (Token): "_" # 41..42 + - Semicolon (Token): ";" # 42..43 + - CloseBrace (Token): "}" # 46..47 + - CloseBrace (Token): "}" # 48..49 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/input.sol new file mode 100644 index 0000000000..24f9a71f5e --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/input.sol @@ -0,0 +1,5 @@ +contract Sample { + modifier foo() { + _; + } +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.4.11.yml new file mode 100644 index 0000000000..95b0fd3382 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.4.11.yml @@ -0,0 +1,31 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ receive() { │ 18..31 + 3 │ } │ 32..35 + 4 │ } │ 36..37 + +Errors: # 1 total + - > + Error: Expected ConstantKeyword or Identifier or InternalKeyword or OverrideKeyword or Period or PrivateKeyword or PublicKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/input.sol:2:10] + │ + 2 │ ╭─▶ receive() { + ┆ ┆ + 4 │ ├─▶ } + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - ContractDefinition (Rule): # 0..37 "contract Sample {\n receive() {\n }\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..27 " receive" + - StateVariableDefinition (Rule): # 18..27 " receive" + - TypeName (Rule): # 18..27 " receive" + - IdentifierPath (Rule): # 18..27 " receive" + - Identifier (Token): "receive" # 20..27 + - SKIPPED (Token): "() {\n }\n}" # 27..37 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.6.0.yml new file mode 100644 index 0000000000..a353388dd3 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.6.0.yml @@ -0,0 +1,25 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ receive() { │ 18..31 + 3 │ } │ 32..35 + 4 │ } │ 36..37 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..37 "contract Sample {\n receive() {\n }\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..36 " receive() {\n }\n" + - ReceiveFunctionDefinition (Rule): # 18..36 " receive() {\n }\n" + - ReceiveKeyword (Token): "receive" # 20..27 + - ParametersDeclaration (Rule): # 27..29 "()" + - OpenParen (Token): "(" # 27..28 + - CloseParen (Token): ")" # 28..29 + - Block (Rule): # 29..36 " {\n }\n" + - OpenBrace (Token): "{" # 30..31 + - CloseBrace (Token): "}" # 34..35 + - CloseBrace (Token): "}" # 36..37 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/input.sol new file mode 100644 index 0000000000..7fdec89faa --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/input.sol @@ -0,0 +1,4 @@ +contract Sample { + receive() { + } +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/generated/0.4.11.yml new file mode 100644 index 0000000000..2b3ed1b0f6 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/generated/0.4.11.yml @@ -0,0 +1,23 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ uint public a; │ 18..34 + 3 │ } │ 35..36 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..36 "contract Sample {\n uint public a;\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..35 " uint public a;\n" + - StateVariableDefinition (Rule): # 18..35 " uint public a;\n" + - TypeName (Rule): # 18..24 " uint" + - UnsignedIntegerType (Token): "uint" # 20..24 + - StateVariableAttributesList (Rule): # 24..31 " public" + - PublicKeyword (Token): "public" # 25..31 + - Identifier (Token): "a" # 32..33 + - Semicolon (Token): ";" # 33..34 + - CloseBrace (Token): "}" # 35..36 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/input.sol new file mode 100644 index 0000000000..b963ceb809 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/input.sol @@ -0,0 +1,3 @@ +contract Sample { + uint public a; +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/generated/0.4.11.yml new file mode 100644 index 0000000000..1b223516ae --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/generated/0.4.11.yml @@ -0,0 +1,35 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ struct S { │ 18..30 + 3 │ uint a; │ 31..42 + 4 │ uint b; │ 43..54 + 5 │ } │ 55..58 + 6 │ } │ 59..60 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..60 "contract Sample {\n struct S {\n uint a;\n uin..." + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..59 " struct S {\n uint a;\n uint b;\n }\n" + - StructDefinition (Rule): # 18..59 " struct S {\n uint a;\n uint b;\n }\n" + - StructKeyword (Token): "struct" # 20..26 + - Identifier (Token): "S" # 27..28 + - OpenBrace (Token): "{" # 29..30 + - StructMembersList (Rule): # 31..55 " uint a;\n uint b;\n" + - StructMember (Rule): # 31..43 " uint a;\n" + - TypeName (Rule): # 31..39 " uint" + - UnsignedIntegerType (Token): "uint" # 35..39 + - Identifier (Token): "a" # 40..41 + - Semicolon (Token): ";" # 41..42 + - StructMember (Rule): # 43..55 " uint b;\n" + - TypeName (Rule): # 43..51 " uint" + - UnsignedIntegerType (Token): "uint" # 47..51 + - Identifier (Token): "b" # 52..53 + - Semicolon (Token): ";" # 53..54 + - CloseBrace (Token): "}" # 57..58 + - CloseBrace (Token): "}" # 59..60 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/input.sol new file mode 100644 index 0000000000..f15bddde58 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/input.sol @@ -0,0 +1,6 @@ +contract Sample { + struct S { + uint a; + uint b; + } +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.4.11.yml new file mode 100644 index 0000000000..9cb8efa97c --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.4.11.yml @@ -0,0 +1,25 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ function () { │ 18..33 + 3 │ } │ 34..37 + 4 │ } │ 38..39 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..39 "contract Sample {\n function () {\n }\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..38 " function () {\n }\n" + - UnnamedFunctionDefinition (Rule): # 18..38 " function () {\n }\n" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..31 " ()" + - OpenParen (Token): "(" # 29..30 + - CloseParen (Token): ")" # 30..31 + - Block (Rule): # 31..38 " {\n }\n" + - OpenBrace (Token): "{" # 32..33 + - CloseBrace (Token): "}" # 36..37 + - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.0.yml new file mode 100644 index 0000000000..c34fc5d1ae --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.0.yml @@ -0,0 +1,29 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ function () { │ 18..33 + 3 │ } │ 34..37 + 4 │ } │ 38..39 + +Errors: # 1 total + - > + Error: Expected FallbackKeyword or Identifier or ReceiveKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/input.sol:2:14] + │ + 2 │ ╭─▶ function () { + ┆ ┆ + 4 │ ├─▶ } + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - ContractDefinition (Rule): # 0..36 "contract Sample {\n function () {\n " + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..28 " function" + - FunctionDefinition (Rule): # 18..28 " function" + - FunctionKeyword (Token): "function" # 20..28 + - SKIPPED (Token): " () {\n " # 28..36 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.8.8.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.8.8.yml new file mode 100644 index 0000000000..5b6f8e44aa --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.8.8.yml @@ -0,0 +1,29 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ function () { │ 18..33 + 3 │ } │ 34..37 + 4 │ } │ 38..39 + +Errors: # 1 total + - > + Error: Expected FallbackKeyword or Identifier or ReceiveKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/input.sol:2:1] + │ + 2 │ ╭─▶ function () { + ┆ ┆ + 4 │ ├─▶ } + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - ContractDefinition (Rule): # 0..49 "contract Sample {\n function () {\n }\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..28 " function" + - FunctionDefinition (Rule): # 18..28 " function" + - FunctionKeyword (Token): "function" # 20..28 + - SKIPPED (Token): " () {\n }\n}" # 28..49 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/input.sol new file mode 100644 index 0000000000..fd2256c72e --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/input.sol @@ -0,0 +1,4 @@ +contract Sample { + function () { + } +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.11.yml new file mode 100644 index 0000000000..150faa921b --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.11.yml @@ -0,0 +1,24 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ type Foo is bool; │ 18..37 + 3 │ } │ 38..39 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or CloseBrace or EnumKeyword or ErrorKeyword or EventKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/input.sol:2:1] + │ + 2 │ ╭─▶ type Foo is bool; + 3 │ ├─▶ } + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - ContractDefinition (Rule): # 0..39 "contract Sample {\n type Foo is bool;\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - SKIPPED (Token): " type Foo is bool;\n}" # 18..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.22.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.22.yml new file mode 100644 index 0000000000..e33830d2ca --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.22.yml @@ -0,0 +1,24 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ type Foo is bool; │ 18..37 + 3 │ } │ 38..39 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/input.sol:2:1] + │ + 2 │ ╭─▶ type Foo is bool; + 3 │ ├─▶ } + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - ContractDefinition (Rule): # 0..39 "contract Sample {\n type Foo is bool;\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - SKIPPED (Token): " type Foo is bool;\n}" # 18..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.6.0.yml new file mode 100644 index 0000000000..ce3d19be1b --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.6.0.yml @@ -0,0 +1,24 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ type Foo is bool; │ 18..37 + 3 │ } │ 38..39 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FallbackKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/input.sol:2:1] + │ + 2 │ ╭─▶ type Foo is bool; + 3 │ ├─▶ } + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - ContractDefinition (Rule): # 0..39 "contract Sample {\n type Foo is bool;\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - SKIPPED (Token): " type Foo is bool;\n}" # 18..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.0.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.0.yml new file mode 100644 index 0000000000..b70b2439d4 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.0.yml @@ -0,0 +1,24 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ type Foo is bool; │ 18..37 + 3 │ } │ 38..39 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FallbackKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/input.sol:2:1] + │ + 2 │ ╭─▶ type Foo is bool; + 3 │ ├─▶ } + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - ContractDefinition (Rule): # 0..39 "contract Sample {\n type Foo is bool;\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - SKIPPED (Token): " type Foo is bool;\n}" # 18..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.8.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.8.yml new file mode 100644 index 0000000000..8593cb29ea --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.8.yml @@ -0,0 +1,22 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ type Foo is bool; │ 18..37 + 3 │ } │ 38..39 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..39 "contract Sample {\n type Foo is bool;\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..38 " type Foo is bool;\n" + - UserDefinedValueTypeDefinition (Rule): # 18..38 " type Foo is bool;\n" + - TypeKeyword (Token): "type" # 20..24 + - Identifier (Token): "Foo" # 25..28 + - IsKeyword (Token): "is" # 29..31 + - BoolKeyword (Token): "bool" # 32..36 + - Semicolon (Token): ";" # 36..37 + - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/input.sol new file mode 100644 index 0000000000..5bc2083997 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/input.sol @@ -0,0 +1,3 @@ +contract Sample { + type Foo is bool; +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/generated/0.4.11.yml new file mode 100644 index 0000000000..157803ac80 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/generated/0.4.11.yml @@ -0,0 +1,24 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ using x for *; │ 18..34 + 3 │ } │ 35..36 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..36 "contract Sample {\n using x for *;\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembersList (Rule): # 18..35 " using x for *;\n" + - UsingDirective (Rule): # 18..35 " using x for *;\n" + - UsingKeyword (Token): "using" # 20..25 + - UsingDirectivePath (Rule): # 25..27 " x" + - IdentifierPath (Rule): # 25..27 " x" + - Identifier (Token): "x" # 26..27 + - ForKeyword (Token): "for" # 28..31 + - Asterisk (Token): "*" # 32..33 + - Semicolon (Token): ";" # 33..34 + - CloseBrace (Token): "}" # 35..36 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/input.sol b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/input.sol new file mode 100644 index 0000000000..e1cfd5e89a --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/input.sol @@ -0,0 +1,3 @@ +contract Sample { + using x for *; +} \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.4.11.yml index 615852b053..c7a11e2a47 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.4.11.yml @@ -21,8 +21,8 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Test" # 9..13 - OpenBrace (Token): "{" # 14..15 - - ContractBodyElements (Rule): # 16..23 " field" - - StateVariableDeclaration (Rule): # 16..23 " field" + - ContractMembersList (Rule): # 16..23 " field" + - StateVariableDefinition (Rule): # 16..23 " field" - TypeName (Rule): # 16..23 " field" - IdentifierPath (Rule): # 16..23 " field" - Identifier (Token): "field" # 18..23 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.5.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.5.yml index 36831be250..274f6ccb69 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.5.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.5.yml @@ -21,8 +21,8 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Test" # 9..13 - OpenBrace (Token): "{" # 14..15 - - ContractBodyElements (Rule): # 16..23 " field" - - StateVariableDeclaration (Rule): # 16..23 " field" + - ContractMembersList (Rule): # 16..23 " field" + - StateVariableDefinition (Rule): # 16..23 " field" - TypeName (Rule): # 16..23 " field" - IdentifierPath (Rule): # 16..23 " field" - Identifier (Token): "field" # 18..23 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.8.8.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.8.8.yml new file mode 100644 index 0000000000..26481b3418 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.8.8.yml @@ -0,0 +1,29 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Test { │ 0..15 + 2 │ field; │ 16..24 + 3 │ } │ 25..26 + +Errors: # 1 total + - > + Error: Expected ConstantKeyword or Identifier or ImmutableKeyword or InternalKeyword or OverrideKeyword or Period or PrivateKeyword or PublicKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/input.sol:2:1] + │ + 2 │ ╭─▶ field; + 3 │ ├─▶ } + │ │ + │ ╰─────── Error occurred here. + ───╯ + +Tree: + - ContractDefinition (Rule): # 0..34 "contract Test {\n field;\n}\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Test" # 9..13 + - OpenBrace (Token): "{" # 14..15 + - ContractMembersList (Rule): # 16..23 " field" + - StateVariableDefinition (Rule): # 16..23 " field" + - TypeName (Rule): # 16..23 " field" + - IdentifierPath (Rule): # 16..23 " field" + - Identifier (Token): "field" # 18..23 + - SKIPPED (Token): ";\n}\n" # 23..34 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.11.yml index 8379a8b506..5fc5968322 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.11.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or ByteType or CloseBrace or EnumKeyword or ErrorKeyword or EventKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or CloseBrace or EnumKeyword or ErrorKeyword or EventKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/input.sol:1:18] │ 1 │ contract Sample { @@ -18,5 +18,4 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractBodyElements (Rule): [] # 17..17 - - SKIPPED (Token): [] # 17..17 + - SKIPPED (Token): "" # 17..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.22.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.22.yml index 2bb56459ef..1b9a1cdcb4 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.22.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.22.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or ByteType or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/input.sol:1:18] │ 1 │ contract Sample { @@ -18,5 +18,4 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractBodyElements (Rule): [] # 17..17 - - SKIPPED (Token): [] # 17..17 + - SKIPPED (Token): "" # 17..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.6.0.yml index 286cada3a2..3be5cd018a 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.6.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.6.0.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or ByteType or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FallbackKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FallbackKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/input.sol:1:18] │ 1 │ contract Sample { @@ -18,5 +18,4 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractBodyElements (Rule): [] # 17..17 - - SKIPPED (Token): [] # 17..17 + - SKIPPED (Token): "" # 17..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.0.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.0.yml index 0a1b84f85f..a05a57a206 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.0.yml @@ -18,5 +18,4 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractBodyElements (Rule): [] # 17..17 - - SKIPPED (Token): [] # 17..17 + - SKIPPED (Token): "" # 17..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.8.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.8.yml index 0da2dd425b..c0b703bf2c 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.8.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.8.yml @@ -18,5 +18,4 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractBodyElements (Rule): [] # 17..17 - - SKIPPED (Token): [] # 17..17 + - SKIPPED (Token): "" # 17..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/zero_length_input/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/zero_length_input/generated/0.4.11.yml index 962adb2486..92a87215a3 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/zero_length_input/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/zero_length_input/generated/0.4.11.yml @@ -8,4 +8,4 @@ Errors: # 1 total ─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/zero_length_input/input.sol:0:0] Tree: - - SKIPPED (Token): [] # 0..0 + - SKIPPED (Token): "" # 0..0 diff --git a/crates/solidity/testing/snapshots/cst_output/DeleteStatement/delete_identifier/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/DeleteStatement/delete_identifier/generated/0.4.11.yml index 1fcdffb5c5..ffd421bcb3 100644 --- a/crates/solidity/testing/snapshots/cst_output/DeleteStatement/delete_identifier/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/DeleteStatement/delete_identifier/generated/0.4.11.yml @@ -9,6 +9,5 @@ Tree: - DeleteStatement (Rule): # 0..11 "delete foo;" - DeleteKeyword (Token): "delete" # 0..6 - Expression (Rule): # 6..10 " foo" - - PrimaryExpression (Rule): # 6..10 " foo" - - Identifier (Token): "foo" # 7..10 + - Identifier (Token): "foo" # 7..10 - Semicolon (Token): ";" # 10..11 diff --git a/crates/solidity/testing/snapshots/cst_output/DeleteStatement/delete_index/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/DeleteStatement/delete_index/generated/0.4.11.yml index bd1d10d5c4..09869ddc02 100644 --- a/crates/solidity/testing/snapshots/cst_output/DeleteStatement/delete_index/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/DeleteStatement/delete_index/generated/0.4.11.yml @@ -11,12 +11,9 @@ Tree: - Expression (Rule): # 6..15 " foo[bar]" - IndexAccessExpression (Rule): # 6..15 " foo[bar]" - Expression (Rule): # 6..10 " foo" - - PrimaryExpression (Rule): # 6..10 " foo" - - Identifier (Token): "foo" # 7..10 - - IndexAccessOperator (Rule): # 10..15 "[bar]" - - OpenBracket (Token): "[" # 10..11 - - Expression (Rule): # 11..14 "bar" - - PrimaryExpression (Rule): # 11..14 "bar" - - Identifier (Token): "bar" # 11..14 - - CloseBracket (Token): "]" # 14..15 + - Identifier (Token): "foo" # 7..10 + - OpenBracket (Token): "[" # 10..11 + - Expression (Rule): # 11..14 "bar" + - Identifier (Token): "bar" # 11..14 + - CloseBracket (Token): "]" # 14..15 - Semicolon (Token): ";" # 15..16 diff --git a/crates/solidity/testing/snapshots/cst_output/ElementaryType/byte/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ElementaryType/byte/generated/0.4.11.yml deleted file mode 100644 index 834edd1eb8..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/ElementaryType/byte/generated/0.4.11.yml +++ /dev/null @@ -1,10 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ byte │ 0..4 - -Errors: [] - -Tree: - - ElementaryType (Rule): # 0..4 "byte" - - ByteType (Token): "byte" # 0..4 diff --git a/crates/solidity/testing/snapshots/cst_output/ElementaryType/byte/input.sol b/crates/solidity/testing/snapshots/cst_output/ElementaryType/byte/input.sol deleted file mode 100644 index 2ead3b5fe2..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/ElementaryType/byte/input.sol +++ /dev/null @@ -1 +0,0 @@ -byte \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/EnumDefinition/multiple_members/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/EnumDefinition/multiple_members/generated/0.4.11.yml index c7a77151b7..e81624bc7d 100644 --- a/crates/solidity/testing/snapshots/cst_output/EnumDefinition/multiple_members/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/EnumDefinition/multiple_members/generated/0.4.11.yml @@ -14,9 +14,10 @@ Tree: - EnumKeyword (Token): "enum" # 0..4 - Identifier (Token): "Foo" # 5..8 - OpenBrace (Token): "{" # 9..10 - - Identifier (Token): "Bar1" # 15..19 - - Comma (Token): "," # 19..20 - - Identifier (Token): "Bar2" # 25..29 - - Comma (Token): "," # 29..30 - - Identifier (Token): "Bar3" # 35..39 + - IdentifiersList (Rule): # 11..40 " Bar1,\n Bar2,\n Bar3\n" + - Identifier (Token): "Bar1" # 15..19 + - Comma (Token): "," # 19..20 + - Identifier (Token): "Bar2" # 25..29 + - Comma (Token): "," # 29..30 + - Identifier (Token): "Bar3" # 35..39 - CloseBrace (Token): "}" # 40..41 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/add_mul/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/add_mul/generated/0.4.11.yml index 956c385c4d..aee0045a2f 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/add_mul/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/add_mul/generated/0.4.11.yml @@ -7,26 +7,19 @@ Errors: [] Tree: - Expression (Rule): # 0..13 "a * b + c * d" - - AddSubExpression (Rule): # 0..13 "a * b + c * d" + - BinaryExpression (Rule): # 0..13 "a * b + c * d" - Expression (Rule): # 0..5 "a * b" - - MulDivModExpression (Rule): # 0..5 "a * b" + - BinaryExpression (Rule): # 0..5 "a * b" - Expression (Rule): # 0..1 "a" - - PrimaryExpression (Rule): # 0..1 "a" - - Identifier (Token): "a" # 0..1 - - MulDivModOperator (Rule): # 1..3 " *" - - Asterisk (Token): "*" # 2..3 + - Identifier (Token): "a" # 0..1 + - Asterisk (Token): "*" # 2..3 - Expression (Rule): # 3..5 " b" - - PrimaryExpression (Rule): # 3..5 " b" - - Identifier (Token): "b" # 4..5 - - AddSubOperator (Rule): # 5..7 " +" - - Plus (Token): "+" # 6..7 + - Identifier (Token): "b" # 4..5 + - Plus (Token): "+" # 6..7 - Expression (Rule): # 7..13 " c * d" - - MulDivModExpression (Rule): # 7..13 " c * d" + - BinaryExpression (Rule): # 7..13 " c * d" - Expression (Rule): # 7..9 " c" - - PrimaryExpression (Rule): # 7..9 " c" - - Identifier (Token): "c" # 8..9 - - MulDivModOperator (Rule): # 9..11 " *" - - Asterisk (Token): "*" # 10..11 + - Identifier (Token): "c" # 8..9 + - Asterisk (Token): "*" # 10..11 - Expression (Rule): # 11..13 " d" - - PrimaryExpression (Rule): # 11..13 " d" - - Identifier (Token): "d" # 12..13 + - Identifier (Token): "d" # 12..13 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/address_call/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/address_call/generated/0.4.11.yml index 89729e6f8d..d1474ede65 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/address_call/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/address_call/generated/0.4.11.yml @@ -9,15 +9,11 @@ Tree: - Expression (Rule): # 0..14 "address(value)" - FunctionCallExpression (Rule): # 0..14 "address(value)" - Expression (Rule): # 0..7 "address" - - PrimaryExpression (Rule): # 0..7 "address" - - ElementaryType (Rule): # 0..7 "address" - - AddressType (Rule): # 0..7 "address" - - AddressKeyword (Token): "address" # 0..7 - - FunctionCallOperator (Rule): # 7..14 "(value)" - - ArgumentList (Rule): # 7..14 "(value)" - - OpenParen (Token): "(" # 7..8 - - PositionalArgumentList (Rule): # 8..13 "value" - - Expression (Rule): # 8..13 "value" - - PrimaryExpression (Rule): # 8..13 "value" - - Identifier (Token): "value" # 8..13 - - CloseParen (Token): ")" # 13..14 + - AddressType (Rule): # 0..7 "address" + - AddressKeyword (Token): "address" # 0..7 + - ArgumentsDeclaration (Rule): # 7..14 "(value)" + - OpenParen (Token): "(" # 7..8 + - PositionalArgumentsList (Rule): # 8..13 "value" + - Expression (Rule): # 8..13 "value" + - Identifier (Token): "value" # 8..13 + - CloseParen (Token): ")" # 13..14 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/address_payable_call/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/address_payable_call/generated/0.4.11.yml index 8c4e6a23b7..d49e154919 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/address_payable_call/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/address_payable_call/generated/0.4.11.yml @@ -9,16 +9,12 @@ Tree: - Expression (Rule): # 0..22 "address payable(value)" - FunctionCallExpression (Rule): # 0..22 "address payable(value)" - Expression (Rule): # 0..15 "address payable" - - PrimaryExpression (Rule): # 0..15 "address payable" - - ElementaryType (Rule): # 0..15 "address payable" - - AddressType (Rule): # 0..15 "address payable" - - AddressKeyword (Token): "address" # 0..7 - - PayableKeyword (Token): "payable" # 8..15 - - FunctionCallOperator (Rule): # 15..22 "(value)" - - ArgumentList (Rule): # 15..22 "(value)" - - OpenParen (Token): "(" # 15..16 - - PositionalArgumentList (Rule): # 16..21 "value" - - Expression (Rule): # 16..21 "value" - - PrimaryExpression (Rule): # 16..21 "value" - - Identifier (Token): "value" # 16..21 - - CloseParen (Token): ")" # 21..22 + - AddressType (Rule): # 0..15 "address payable" + - AddressKeyword (Token): "address" # 0..7 + - PayableKeyword (Token): "payable" # 8..15 + - ArgumentsDeclaration (Rule): # 15..22 "(value)" + - OpenParen (Token): "(" # 15..16 + - PositionalArgumentsList (Rule): # 16..21 "value" + - Expression (Rule): # 16..21 "value" + - Identifier (Token): "value" # 16..21 + - CloseParen (Token): ")" # 21..22 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_identifier_base/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_identifier_base/generated/0.4.11.yml index a862f92e3e..0c7a33c1d2 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_identifier_base/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_identifier_base/generated/0.4.11.yml @@ -9,16 +9,10 @@ Tree: - Expression (Rule): # 0..18 "foo ? true : false" - ConditionalExpression (Rule): # 0..18 "foo ? true : false" - Expression (Rule): # 0..3 "foo" - - PrimaryExpression (Rule): # 0..3 "foo" - - Identifier (Token): "foo" # 0..3 - - ConditionalOperator (Rule): # 3..18 " ? true : false" - - QuestionMark (Token): "?" # 4..5 - - Expression (Rule): # 5..10 " true" - - PrimaryExpression (Rule): # 5..10 " true" - - BooleanLiteral (Rule): # 5..10 " true" - - TrueKeyword (Token): "true" # 6..10 - - Colon (Token): ":" # 11..12 - - Expression (Rule): # 12..18 " false" - - PrimaryExpression (Rule): # 12..18 " false" - - BooleanLiteral (Rule): # 12..18 " false" - - FalseKeyword (Token): "false" # 13..18 + - Identifier (Token): "foo" # 0..3 + - QuestionMark (Token): "?" # 4..5 + - Expression (Rule): # 5..10 " true" + - TrueKeyword (Token): "true" # 6..10 + - Colon (Token): ":" # 11..12 + - Expression (Rule): # 12..18 " false" + - FalseKeyword (Token): "false" # 13..18 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_base/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_base/generated/0.4.11.yml index 5e92138f0a..2791370ebe 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_base/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_base/generated/0.4.11.yml @@ -9,28 +9,20 @@ Tree: - Expression (Rule): # 0..27 "(foo == bar) ? true : false" - ConditionalExpression (Rule): # 0..27 "(foo == bar) ? true : false" - Expression (Rule): # 0..12 "(foo == bar)" - - PrimaryExpression (Rule): # 0..12 "(foo == bar)" - - TupleExpression (Rule): # 0..12 "(foo == bar)" - - OpenParen (Token): "(" # 0..1 + - TupleExpression (Rule): # 0..12 "(foo == bar)" + - OpenParen (Token): "(" # 0..1 + - TupleValuesList (Rule): # 1..11 "foo == bar" - Expression (Rule): # 1..11 "foo == bar" - - EqualityComparisonExpression (Rule): # 1..11 "foo == bar" + - BinaryExpression (Rule): # 1..11 "foo == bar" - Expression (Rule): # 1..4 "foo" - - PrimaryExpression (Rule): # 1..4 "foo" - - Identifier (Token): "foo" # 1..4 - - EqualityComparisonOperator (Rule): # 4..7 " ==" - - EqualEqual (Token): "==" # 5..7 + - Identifier (Token): "foo" # 1..4 + - EqualEqual (Token): "==" # 5..7 - Expression (Rule): # 7..11 " bar" - - PrimaryExpression (Rule): # 7..11 " bar" - - Identifier (Token): "bar" # 8..11 - - CloseParen (Token): ")" # 11..12 - - ConditionalOperator (Rule): # 12..27 " ? true : false" - - QuestionMark (Token): "?" # 13..14 - - Expression (Rule): # 14..19 " true" - - PrimaryExpression (Rule): # 14..19 " true" - - BooleanLiteral (Rule): # 14..19 " true" - - TrueKeyword (Token): "true" # 15..19 - - Colon (Token): ":" # 20..21 - - Expression (Rule): # 21..27 " false" - - PrimaryExpression (Rule): # 21..27 " false" - - BooleanLiteral (Rule): # 21..27 " false" - - FalseKeyword (Token): "false" # 22..27 + - Identifier (Token): "bar" # 8..11 + - CloseParen (Token): ")" # 11..12 + - QuestionMark (Token): "?" # 13..14 + - Expression (Rule): # 14..19 " true" + - TrueKeyword (Token): "true" # 15..19 + - Colon (Token): ":" # 20..21 + - Expression (Rule): # 21..27 " false" + - FalseKeyword (Token): "false" # 22..27 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_conditions/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_conditions/generated/0.4.11.yml index 05a7e03d0f..88caf9a361 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_conditions/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_conditions/generated/0.4.11.yml @@ -9,38 +9,30 @@ Tree: - Expression (Rule): # 0..23 "foo ? (a + b) : (c + d)" - ConditionalExpression (Rule): # 0..23 "foo ? (a + b) : (c + d)" - Expression (Rule): # 0..3 "foo" - - PrimaryExpression (Rule): # 0..3 "foo" - - Identifier (Token): "foo" # 0..3 - - ConditionalOperator (Rule): # 3..23 " ? (a + b) : (c + d)" - - QuestionMark (Token): "?" # 4..5 - - Expression (Rule): # 5..13 " (a + b)" - - PrimaryExpression (Rule): # 5..13 " (a + b)" - - TupleExpression (Rule): # 5..13 " (a + b)" - - OpenParen (Token): "(" # 6..7 - - Expression (Rule): # 7..12 "a + b" - - AddSubExpression (Rule): # 7..12 "a + b" - - Expression (Rule): # 7..8 "a" - - PrimaryExpression (Rule): # 7..8 "a" - - Identifier (Token): "a" # 7..8 - - AddSubOperator (Rule): # 8..10 " +" - - Plus (Token): "+" # 9..10 - - Expression (Rule): # 10..12 " b" - - PrimaryExpression (Rule): # 10..12 " b" - - Identifier (Token): "b" # 11..12 - - CloseParen (Token): ")" # 12..13 - - Colon (Token): ":" # 14..15 - - Expression (Rule): # 15..23 " (c + d)" - - PrimaryExpression (Rule): # 15..23 " (c + d)" - - TupleExpression (Rule): # 15..23 " (c + d)" - - OpenParen (Token): "(" # 16..17 - - Expression (Rule): # 17..22 "c + d" - - AddSubExpression (Rule): # 17..22 "c + d" - - Expression (Rule): # 17..18 "c" - - PrimaryExpression (Rule): # 17..18 "c" - - Identifier (Token): "c" # 17..18 - - AddSubOperator (Rule): # 18..20 " +" - - Plus (Token): "+" # 19..20 - - Expression (Rule): # 20..22 " d" - - PrimaryExpression (Rule): # 20..22 " d" - - Identifier (Token): "d" # 21..22 - - CloseParen (Token): ")" # 22..23 + - Identifier (Token): "foo" # 0..3 + - QuestionMark (Token): "?" # 4..5 + - Expression (Rule): # 5..13 " (a + b)" + - TupleExpression (Rule): # 5..13 " (a + b)" + - OpenParen (Token): "(" # 6..7 + - TupleValuesList (Rule): # 7..12 "a + b" + - Expression (Rule): # 7..12 "a + b" + - BinaryExpression (Rule): # 7..12 "a + b" + - Expression (Rule): # 7..8 "a" + - Identifier (Token): "a" # 7..8 + - Plus (Token): "+" # 9..10 + - Expression (Rule): # 10..12 " b" + - Identifier (Token): "b" # 11..12 + - CloseParen (Token): ")" # 12..13 + - Colon (Token): ":" # 14..15 + - Expression (Rule): # 15..23 " (c + d)" + - TupleExpression (Rule): # 15..23 " (c + d)" + - OpenParen (Token): "(" # 16..17 + - TupleValuesList (Rule): # 17..22 "c + d" + - Expression (Rule): # 17..22 "c + d" + - BinaryExpression (Rule): # 17..22 "c + d" + - Expression (Rule): # 17..18 "c" + - Identifier (Token): "c" # 17..18 + - Plus (Token): "+" # 19..20 + - Expression (Rule): # 20..22 " d" + - Identifier (Token): "d" # 21..22 + - CloseParen (Token): ")" # 22..23 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_recursive/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_recursive/generated/0.4.11.yml index a1c468a4ad..aec8fe9d28 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_recursive/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_recursive/generated/0.4.11.yml @@ -9,96 +9,69 @@ Tree: - Expression (Rule): # 0..63 "foo ? a == b ? a + b * c : a + b * c + d : !bar ? ..." - ConditionalExpression (Rule): # 0..63 "foo ? a == b ? a + b * c : a + b * c + d : !bar ? ..." - Expression (Rule): # 0..3 "foo" - - PrimaryExpression (Rule): # 0..3 "foo" - - Identifier (Token): "foo" # 0..3 - - ConditionalOperator (Rule): # 3..63 " ? a == b ? a + b * c : a + b * c + d : !bar ? e +..." - - QuestionMark (Token): "?" # 4..5 - - Expression (Rule): # 5..40 " a == b ? a + b * c : a + b * c + d" - - ConditionalExpression (Rule): # 5..40 " a == b ? a + b * c : a + b * c + d" - - Expression (Rule): # 5..12 " a == b" - - EqualityComparisonExpression (Rule): # 5..12 " a == b" - - Expression (Rule): # 5..7 " a" - - PrimaryExpression (Rule): # 5..7 " a" - - Identifier (Token): "a" # 6..7 - - EqualityComparisonOperator (Rule): # 7..10 " ==" - - EqualEqual (Token): "==" # 8..10 - - Expression (Rule): # 10..12 " b" - - PrimaryExpression (Rule): # 10..12 " b" - - Identifier (Token): "b" # 11..12 - - ConditionalOperator (Rule): # 12..40 " ? a + b * c : a + b * c + d" - - QuestionMark (Token): "?" # 13..14 - - Expression (Rule): # 14..24 " a + b * c" - - AddSubExpression (Rule): # 14..24 " a + b * c" - - Expression (Rule): # 14..16 " a" - - PrimaryExpression (Rule): # 14..16 " a" - - Identifier (Token): "a" # 15..16 - - AddSubOperator (Rule): # 16..18 " +" - - Plus (Token): "+" # 17..18 - - Expression (Rule): # 18..24 " b * c" - - MulDivModExpression (Rule): # 18..24 " b * c" - - Expression (Rule): # 18..20 " b" - - PrimaryExpression (Rule): # 18..20 " b" - - Identifier (Token): "b" # 19..20 - - MulDivModOperator (Rule): # 20..22 " *" - - Asterisk (Token): "*" # 21..22 - - Expression (Rule): # 22..24 " c" - - PrimaryExpression (Rule): # 22..24 " c" - - Identifier (Token): "c" # 23..24 - - Colon (Token): ":" # 25..26 - - Expression (Rule): # 26..40 " a + b * c + d" - - AddSubExpression (Rule): # 26..40 " a + b * c + d" - - Expression (Rule): # 26..36 " a + b * c" - - AddSubExpression (Rule): # 26..36 " a + b * c" - - Expression (Rule): # 26..28 " a" - - PrimaryExpression (Rule): # 26..28 " a" - - Identifier (Token): "a" # 27..28 - - AddSubOperator (Rule): # 28..30 " +" - - Plus (Token): "+" # 29..30 - - Expression (Rule): # 30..36 " b * c" - - MulDivModExpression (Rule): # 30..36 " b * c" - - Expression (Rule): # 30..32 " b" - - PrimaryExpression (Rule): # 30..32 " b" - - Identifier (Token): "b" # 31..32 - - MulDivModOperator (Rule): # 32..34 " *" - - Asterisk (Token): "*" # 33..34 - - Expression (Rule): # 34..36 " c" - - PrimaryExpression (Rule): # 34..36 " c" - - Identifier (Token): "c" # 35..36 - - AddSubOperator (Rule): # 36..38 " +" - - Plus (Token): "+" # 37..38 - - Expression (Rule): # 38..40 " d" - - PrimaryExpression (Rule): # 38..40 " d" - - Identifier (Token): "d" # 39..40 - - Colon (Token): ":" # 41..42 - - Expression (Rule): # 42..63 " !bar ? e + f : g + h" - - ConditionalExpression (Rule): # 42..63 " !bar ? e + f : g + h" - - Expression (Rule): # 42..47 " !bar" - - UnaryPrefixExpression (Rule): # 42..47 " !bar" - - UnaryPrefixOperator (Rule): # 42..44 " !" - - Bang (Token): "!" # 43..44 - - Expression (Rule): # 44..47 "bar" - - PrimaryExpression (Rule): # 44..47 "bar" - - Identifier (Token): "bar" # 44..47 - - ConditionalOperator (Rule): # 47..63 " ? e + f : g + h" - - QuestionMark (Token): "?" # 48..49 - - Expression (Rule): # 49..55 " e + f" - - AddSubExpression (Rule): # 49..55 " e + f" - - Expression (Rule): # 49..51 " e" - - PrimaryExpression (Rule): # 49..51 " e" - - Identifier (Token): "e" # 50..51 - - AddSubOperator (Rule): # 51..53 " +" - - Plus (Token): "+" # 52..53 - - Expression (Rule): # 53..55 " f" - - PrimaryExpression (Rule): # 53..55 " f" - - Identifier (Token): "f" # 54..55 - - Colon (Token): ":" # 56..57 - - Expression (Rule): # 57..63 " g + h" - - AddSubExpression (Rule): # 57..63 " g + h" - - Expression (Rule): # 57..59 " g" - - PrimaryExpression (Rule): # 57..59 " g" - - Identifier (Token): "g" # 58..59 - - AddSubOperator (Rule): # 59..61 " +" - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " h" - - PrimaryExpression (Rule): # 61..63 " h" - - Identifier (Token): "h" # 62..63 + - Identifier (Token): "foo" # 0..3 + - QuestionMark (Token): "?" # 4..5 + - Expression (Rule): # 5..40 " a == b ? a + b * c : a + b * c + d" + - ConditionalExpression (Rule): # 5..40 " a == b ? a + b * c : a + b * c + d" + - Expression (Rule): # 5..12 " a == b" + - BinaryExpression (Rule): # 5..12 " a == b" + - Expression (Rule): # 5..7 " a" + - Identifier (Token): "a" # 6..7 + - EqualEqual (Token): "==" # 8..10 + - Expression (Rule): # 10..12 " b" + - Identifier (Token): "b" # 11..12 + - QuestionMark (Token): "?" # 13..14 + - Expression (Rule): # 14..24 " a + b * c" + - BinaryExpression (Rule): # 14..24 " a + b * c" + - Expression (Rule): # 14..16 " a" + - Identifier (Token): "a" # 15..16 + - Plus (Token): "+" # 17..18 + - Expression (Rule): # 18..24 " b * c" + - BinaryExpression (Rule): # 18..24 " b * c" + - Expression (Rule): # 18..20 " b" + - Identifier (Token): "b" # 19..20 + - Asterisk (Token): "*" # 21..22 + - Expression (Rule): # 22..24 " c" + - Identifier (Token): "c" # 23..24 + - Colon (Token): ":" # 25..26 + - Expression (Rule): # 26..40 " a + b * c + d" + - BinaryExpression (Rule): # 26..40 " a + b * c + d" + - Expression (Rule): # 26..36 " a + b * c" + - BinaryExpression (Rule): # 26..36 " a + b * c" + - Expression (Rule): # 26..28 " a" + - Identifier (Token): "a" # 27..28 + - Plus (Token): "+" # 29..30 + - Expression (Rule): # 30..36 " b * c" + - BinaryExpression (Rule): # 30..36 " b * c" + - Expression (Rule): # 30..32 " b" + - Identifier (Token): "b" # 31..32 + - Asterisk (Token): "*" # 33..34 + - Expression (Rule): # 34..36 " c" + - Identifier (Token): "c" # 35..36 + - Plus (Token): "+" # 37..38 + - Expression (Rule): # 38..40 " d" + - Identifier (Token): "d" # 39..40 + - Colon (Token): ":" # 41..42 + - Expression (Rule): # 42..63 " !bar ? e + f : g + h" + - ConditionalExpression (Rule): # 42..63 " !bar ? e + f : g + h" + - Expression (Rule): # 42..47 " !bar" + - UnaryPrefixExpression (Rule): # 42..47 " !bar" + - Bang (Token): "!" # 43..44 + - Expression (Rule): # 44..47 "bar" + - Identifier (Token): "bar" # 44..47 + - QuestionMark (Token): "?" # 48..49 + - Expression (Rule): # 49..55 " e + f" + - BinaryExpression (Rule): # 49..55 " e + f" + - Expression (Rule): # 49..51 " e" + - Identifier (Token): "e" # 50..51 + - Plus (Token): "+" # 52..53 + - Expression (Rule): # 53..55 " f" + - Identifier (Token): "f" # 54..55 + - Colon (Token): ":" # 56..57 + - Expression (Rule): # 57..63 " g + h" + - BinaryExpression (Rule): # 57..63 " g + h" + - Expression (Rule): # 57..59 " g" + - Identifier (Token): "g" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " h" + - Identifier (Token): "h" # 62..63 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/exponentiation_operator_associativity/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/exponentiation_operator_associativity/generated/0.4.11.yml index 5b4fe4fcb9..cbb412d261 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/exponentiation_operator_associativity/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/exponentiation_operator_associativity/generated/0.4.11.yml @@ -7,19 +7,14 @@ Errors: [] Tree: - Expression (Rule): # 0..12 "x ** y ** z\n" - - ExponentiationExpression (Rule): # 0..12 "x ** y ** z\n" + - BinaryExpression (Rule): # 0..12 "x ** y ** z\n" - Expression (Rule): # 0..6 "x ** y" - - ExponentiationExpression (Rule): # 0..6 "x ** y" + - BinaryExpression (Rule): # 0..6 "x ** y" - Expression (Rule): # 0..1 "x" - - PrimaryExpression (Rule): # 0..1 "x" - - Identifier (Token): "x" # 0..1 - - ExponentiationOperator (Rule): # 1..4 " **" - - AsteriskAsterisk (Token): "**" # 2..4 + - Identifier (Token): "x" # 0..1 + - AsteriskAsterisk (Token): "**" # 2..4 - Expression (Rule): # 4..6 " y" - - PrimaryExpression (Rule): # 4..6 " y" - - Identifier (Token): "y" # 5..6 - - ExponentiationOperator (Rule): # 6..9 " **" - - AsteriskAsterisk (Token): "**" # 7..9 + - Identifier (Token): "y" # 5..6 + - AsteriskAsterisk (Token): "**" # 7..9 - Expression (Rule): # 9..12 " z\n" - - PrimaryExpression (Rule): # 9..12 " z\n" - - Identifier (Token): "z" # 10..11 + - Identifier (Token): "z" # 10..11 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/exponentiation_operator_associativity/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/Expression/exponentiation_operator_associativity/generated/0.6.0.yml index 57d74961de..7013645345 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/exponentiation_operator_associativity/generated/0.6.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/exponentiation_operator_associativity/generated/0.6.0.yml @@ -7,19 +7,14 @@ Errors: [] Tree: - Expression (Rule): # 0..12 "x ** y ** z\n" - - ExponentiationExpression (Rule): # 0..12 "x ** y ** z\n" + - BinaryExpression (Rule): # 0..12 "x ** y ** z\n" - Expression (Rule): # 0..1 "x" - - PrimaryExpression (Rule): # 0..1 "x" - - Identifier (Token): "x" # 0..1 - - ExponentiationOperator (Rule): # 1..4 " **" - - AsteriskAsterisk (Token): "**" # 2..4 + - Identifier (Token): "x" # 0..1 + - AsteriskAsterisk (Token): "**" # 2..4 - Expression (Rule): # 4..12 " y ** z\n" - - ExponentiationExpression (Rule): # 4..12 " y ** z\n" + - BinaryExpression (Rule): # 4..12 " y ** z\n" - Expression (Rule): # 4..6 " y" - - PrimaryExpression (Rule): # 4..6 " y" - - Identifier (Token): "y" # 5..6 - - ExponentiationOperator (Rule): # 6..9 " **" - - AsteriskAsterisk (Token): "**" # 7..9 + - Identifier (Token): "y" # 5..6 + - AsteriskAsterisk (Token): "**" # 7..9 - Expression (Rule): # 9..12 " z\n" - - PrimaryExpression (Rule): # 9..12 " z\n" - - Identifier (Token): "z" # 10..11 + - Identifier (Token): "z" # 10..11 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call/generated/0.4.11.yml index 3037e390a7..162a2096ad 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call/generated/0.4.11.yml @@ -9,19 +9,15 @@ Tree: - Expression (Rule): # 0..7 "x(1, 2)" - FunctionCallExpression (Rule): # 0..7 "x(1, 2)" - Expression (Rule): # 0..1 "x" - - PrimaryExpression (Rule): # 0..1 "x" - - Identifier (Token): "x" # 0..1 - - FunctionCallOperator (Rule): # 1..7 "(1, 2)" - - ArgumentList (Rule): # 1..7 "(1, 2)" - - OpenParen (Token): "(" # 1..2 - - PositionalArgumentList (Rule): # 2..6 "1, 2" - - Expression (Rule): # 2..3 "1" - - PrimaryExpression (Rule): # 2..3 "1" - - NumericExpression (Rule): # 2..3 "1" - - DecimalLiteral (Token): "1" # 2..3 - - Comma (Token): "," # 3..4 - - Expression (Rule): # 4..6 " 2" - - PrimaryExpression (Rule): # 4..6 " 2" - - NumericExpression (Rule): # 4..6 " 2" - - DecimalLiteral (Token): "2" # 5..6 - - CloseParen (Token): ")" # 6..7 + - Identifier (Token): "x" # 0..1 + - ArgumentsDeclaration (Rule): # 1..7 "(1, 2)" + - OpenParen (Token): "(" # 1..2 + - PositionalArgumentsList (Rule): # 2..6 "1, 2" + - Expression (Rule): # 2..3 "1" + - NumericExpression (Rule): # 2..3 "1" + - DecimalLiteral (Token): "1" # 2..3 + - Comma (Token): "," # 3..4 + - Expression (Rule): # 4..6 " 2" + - NumericExpression (Rule): # 4..6 " 2" + - DecimalLiteral (Token): "2" # 5..6 + - CloseParen (Token): ")" # 6..7 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_argument_has_type_name_as_prefix/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_argument_has_type_name_as_prefix/generated/0.4.11.yml index db09c66f02..d1f85453f7 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_argument_has_type_name_as_prefix/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_argument_has_type_name_as_prefix/generated/0.4.11.yml @@ -9,13 +9,10 @@ Tree: - Expression (Rule): # 0..13 "x(interested)" - FunctionCallExpression (Rule): # 0..13 "x(interested)" - Expression (Rule): # 0..1 "x" - - PrimaryExpression (Rule): # 0..1 "x" - - Identifier (Token): "x" # 0..1 - - FunctionCallOperator (Rule): # 1..13 "(interested)" - - ArgumentList (Rule): # 1..13 "(interested)" - - OpenParen (Token): "(" # 1..2 - - PositionalArgumentList (Rule): # 2..12 "interested" - - Expression (Rule): # 2..12 "interested" - - PrimaryExpression (Rule): # 2..12 "interested" - - Identifier (Token): "interested" # 2..12 - - CloseParen (Token): ")" # 12..13 + - Identifier (Token): "x" # 0..1 + - ArgumentsDeclaration (Rule): # 1..13 "(interested)" + - OpenParen (Token): "(" # 1..2 + - PositionalArgumentsList (Rule): # 2..12 "interested" + - Expression (Rule): # 2..12 "interested" + - Identifier (Token): "interested" # 2..12 + - CloseParen (Token): ")" # 12..13 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_chain/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_chain/generated/0.4.11.yml index e80ae54dbd..2f2e3b2a80 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_chain/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_chain/generated/0.4.11.yml @@ -11,13 +11,10 @@ Tree: - Expression (Rule): # 0..3 "x()" - FunctionCallExpression (Rule): # 0..3 "x()" - Expression (Rule): # 0..1 "x" - - PrimaryExpression (Rule): # 0..1 "x" - - Identifier (Token): "x" # 0..1 - - FunctionCallOperator (Rule): # 1..3 "()" - - ArgumentList (Rule): # 1..3 "()" - - OpenParen (Token): "(" # 1..2 - - CloseParen (Token): ")" # 2..3 - - FunctionCallOperator (Rule): # 3..5 "()" - - ArgumentList (Rule): # 3..5 "()" - - OpenParen (Token): "(" # 3..4 - - CloseParen (Token): ")" # 4..5 + - Identifier (Token): "x" # 0..1 + - ArgumentsDeclaration (Rule): # 1..3 "()" + - OpenParen (Token): "(" # 1..2 + - CloseParen (Token): ")" # 2..3 + - ArgumentsDeclaration (Rule): # 3..5 "()" + - OpenParen (Token): "(" # 3..4 + - CloseParen (Token): ")" # 4..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_member_access/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_member_access/generated/0.4.11.yml index 140180ec20..6c8e6134fd 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_member_access/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_member_access/generated/0.4.11.yml @@ -11,12 +11,9 @@ Tree: - Expression (Rule): # 0..3 "x()" - FunctionCallExpression (Rule): # 0..3 "x()" - Expression (Rule): # 0..1 "x" - - PrimaryExpression (Rule): # 0..1 "x" - - Identifier (Token): "x" # 0..1 - - FunctionCallOperator (Rule): # 1..3 "()" - - ArgumentList (Rule): # 1..3 "()" - - OpenParen (Token): "(" # 1..2 - - CloseParen (Token): ")" # 2..3 - - MemberAccessOperator (Rule): # 3..5 ".y" - - Period (Token): "." # 3..4 - - Identifier (Token): "y" # 4..5 + - Identifier (Token): "x" # 0..1 + - ArgumentsDeclaration (Rule): # 1..3 "()" + - OpenParen (Token): "(" # 1..2 + - CloseParen (Token): ")" # 2..3 + - Period (Token): "." # 3..4 + - Identifier (Token): "y" # 4..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.4.11.yml index a6b2aed886..dc93cdb87c 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.4.11.yml @@ -17,9 +17,7 @@ Tree: - Expression (Rule): # 0..25 'a.b{value: 0, gas: 1}("")' - MemberAccessExpression (Rule): # 0..3 "a.b" - Expression (Rule): # 0..1 "a" - - PrimaryExpression (Rule): # 0..1 "a" - - Identifier (Token): "a" # 0..1 - - MemberAccessOperator (Rule): # 1..3 ".b" - - Period (Token): "." # 1..2 - - Identifier (Token): "b" # 2..3 + - Identifier (Token): "a" # 0..1 + - Period (Token): "." # 1..2 + - Identifier (Token): "b" # 2..3 - SKIPPED (Token): '{value: 0, gas: 1}("")' # 3..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.6.2.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.6.2.yml index bb0867df05..2cf894b710 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.6.2.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.6.2.yml @@ -11,35 +11,31 @@ Tree: - Expression (Rule): # 0..3 "a.b" - MemberAccessExpression (Rule): # 0..3 "a.b" - Expression (Rule): # 0..1 "a" - - PrimaryExpression (Rule): # 0..1 "a" - - Identifier (Token): "a" # 0..1 - - MemberAccessOperator (Rule): # 1..3 ".b" - - Period (Token): "." # 1..2 - - Identifier (Token): "b" # 2..3 - - FunctionCallOperator (Rule): # 3..25 '{value: 0, gas: 1}("")' - - FunctionCallOptions (Rule): # 3..21 "{value: 0, gas: 1}" + - Identifier (Token): "a" # 0..1 + - Period (Token): "." # 1..2 + - Identifier (Token): "b" # 2..3 + - FunctionCallOptions (Rule): # 3..21 "{value: 0, gas: 1}" + - NamedArgumentsDeclaration (Rule): # 3..21 "{value: 0, gas: 1}" - OpenBrace (Token): "{" # 3..4 - - NamedArgument (Rule): # 4..12 "value: 0" - - Identifier (Token): "value" # 4..9 - - Colon (Token): ":" # 9..10 - - Expression (Rule): # 10..12 " 0" - - PrimaryExpression (Rule): # 10..12 " 0" + - NamedArgumentsList (Rule): # 4..20 "value: 0, gas: 1" + - NamedArgument (Rule): # 4..12 "value: 0" + - Identifier (Token): "value" # 4..9 + - Colon (Token): ":" # 9..10 + - Expression (Rule): # 10..12 " 0" - NumericExpression (Rule): # 10..12 " 0" - DecimalLiteral (Token): "0" # 11..12 - - Comma (Token): "," # 12..13 - - NamedArgument (Rule): # 13..20 " gas: 1" - - Identifier (Token): "gas" # 14..17 - - Colon (Token): ":" # 17..18 - - Expression (Rule): # 18..20 " 1" - - PrimaryExpression (Rule): # 18..20 " 1" + - Comma (Token): "," # 12..13 + - NamedArgument (Rule): # 13..20 " gas: 1" + - Identifier (Token): "gas" # 14..17 + - Colon (Token): ":" # 17..18 + - Expression (Rule): # 18..20 " 1" - NumericExpression (Rule): # 18..20 " 1" - DecimalLiteral (Token): "1" # 19..20 - CloseBrace (Token): "}" # 20..21 - - ArgumentList (Rule): # 21..25 '("")' - - OpenParen (Token): "(" # 21..22 - - PositionalArgumentList (Rule): # 22..24 '""' - - Expression (Rule): # 22..24 '""' - - PrimaryExpression (Rule): # 22..24 '""' - - StringExpression (Rule): # 22..24 '""' - - AsciiStringLiteral (Token): '""' # 22..24 - - CloseParen (Token): ")" # 24..25 + - ArgumentsDeclaration (Rule): # 21..25 '("")' + - OpenParen (Token): "(" # 21..22 + - PositionalArgumentsList (Rule): # 22..24 '""' + - Expression (Rule): # 22..24 '""' + - AsciiStringLiteralsList (Rule): # 22..24 '""' + - AsciiStringLiteral (Token): '""' # 22..24 + - CloseParen (Token): ")" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.4.11.yml index 549be25e54..a2b88edcb6 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.4.11.yml @@ -17,9 +17,7 @@ Tree: - Expression (Rule): # 0..25 'a.b{value: 0}{gas: 1}("")' - MemberAccessExpression (Rule): # 0..3 "a.b" - Expression (Rule): # 0..1 "a" - - PrimaryExpression (Rule): # 0..1 "a" - - Identifier (Token): "a" # 0..1 - - MemberAccessOperator (Rule): # 1..3 ".b" - - Period (Token): "." # 1..2 - - Identifier (Token): "b" # 2..3 + - Identifier (Token): "a" # 0..1 + - Period (Token): "." # 1..2 + - Identifier (Token): "b" # 2..3 - SKIPPED (Token): '{value: 0}{gas: 1}("")' # 3..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.6.2.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.6.2.yml index 32a9870084..096d9aa6b8 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.6.2.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.6.2.yml @@ -11,37 +11,34 @@ Tree: - Expression (Rule): # 0..3 "a.b" - MemberAccessExpression (Rule): # 0..3 "a.b" - Expression (Rule): # 0..1 "a" - - PrimaryExpression (Rule): # 0..1 "a" - - Identifier (Token): "a" # 0..1 - - MemberAccessOperator (Rule): # 1..3 ".b" - - Period (Token): "." # 1..2 - - Identifier (Token): "b" # 2..3 - - FunctionCallOperator (Rule): # 3..25 '{value: 0}{gas: 1}("")' - - FunctionCallOptions (Rule): # 3..13 "{value: 0}" + - Identifier (Token): "a" # 0..1 + - Period (Token): "." # 1..2 + - Identifier (Token): "b" # 2..3 + - FunctionCallOptions (Rule): # 3..21 "{value: 0}{gas: 1}" + - NamedArgumentsDeclaration (Rule): # 3..13 "{value: 0}" - OpenBrace (Token): "{" # 3..4 - - NamedArgument (Rule): # 4..12 "value: 0" - - Identifier (Token): "value" # 4..9 - - Colon (Token): ":" # 9..10 - - Expression (Rule): # 10..12 " 0" - - PrimaryExpression (Rule): # 10..12 " 0" + - NamedArgumentsList (Rule): # 4..12 "value: 0" + - NamedArgument (Rule): # 4..12 "value: 0" + - Identifier (Token): "value" # 4..9 + - Colon (Token): ":" # 9..10 + - Expression (Rule): # 10..12 " 0" - NumericExpression (Rule): # 10..12 " 0" - DecimalLiteral (Token): "0" # 11..12 - CloseBrace (Token): "}" # 12..13 - - FunctionCallOptions (Rule): # 13..21 "{gas: 1}" + - NamedArgumentsDeclaration (Rule): # 13..21 "{gas: 1}" - OpenBrace (Token): "{" # 13..14 - - NamedArgument (Rule): # 14..20 "gas: 1" - - Identifier (Token): "gas" # 14..17 - - Colon (Token): ":" # 17..18 - - Expression (Rule): # 18..20 " 1" - - PrimaryExpression (Rule): # 18..20 " 1" + - NamedArgumentsList (Rule): # 14..20 "gas: 1" + - NamedArgument (Rule): # 14..20 "gas: 1" + - Identifier (Token): "gas" # 14..17 + - Colon (Token): ":" # 17..18 + - Expression (Rule): # 18..20 " 1" - NumericExpression (Rule): # 18..20 " 1" - DecimalLiteral (Token): "1" # 19..20 - CloseBrace (Token): "}" # 20..21 - - ArgumentList (Rule): # 21..25 '("")' - - OpenParen (Token): "(" # 21..22 - - PositionalArgumentList (Rule): # 22..24 '""' - - Expression (Rule): # 22..24 '""' - - PrimaryExpression (Rule): # 22..24 '""' - - StringExpression (Rule): # 22..24 '""' - - AsciiStringLiteral (Token): '""' # 22..24 - - CloseParen (Token): ")" # 24..25 + - ArgumentsDeclaration (Rule): # 21..25 '("")' + - OpenParen (Token): "(" # 21..22 + - PositionalArgumentsList (Rule): # 22..24 '""' + - Expression (Rule): # 22..24 '""' + - AsciiStringLiteralsList (Rule): # 22..24 '""' + - AsciiStringLiteral (Token): '""' # 22..24 + - CloseParen (Token): ")" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.8.0.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.8.0.yml index 549be25e54..a2b88edcb6 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.8.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.8.0.yml @@ -17,9 +17,7 @@ Tree: - Expression (Rule): # 0..25 'a.b{value: 0}{gas: 1}("")' - MemberAccessExpression (Rule): # 0..3 "a.b" - Expression (Rule): # 0..1 "a" - - PrimaryExpression (Rule): # 0..1 "a" - - Identifier (Token): "a" # 0..1 - - MemberAccessOperator (Rule): # 1..3 ".b" - - Period (Token): "." # 1..2 - - Identifier (Token): "b" # 2..3 + - Identifier (Token): "a" # 0..1 + - Period (Token): "." # 1..2 + - Identifier (Token): "b" # 2..3 - SKIPPED (Token): '{value: 0}{gas: 1}("")' # 3..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/identifier_call/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/identifier_call/generated/0.4.11.yml index d90fe6d11f..9f6c4ac337 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/identifier_call/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/identifier_call/generated/0.4.11.yml @@ -9,13 +9,10 @@ Tree: - Expression (Rule): # 0..20 "function_name(value)" - FunctionCallExpression (Rule): # 0..20 "function_name(value)" - Expression (Rule): # 0..13 "function_name" - - PrimaryExpression (Rule): # 0..13 "function_name" - - Identifier (Token): "function_name" # 0..13 - - FunctionCallOperator (Rule): # 13..20 "(value)" - - ArgumentList (Rule): # 13..20 "(value)" - - OpenParen (Token): "(" # 13..14 - - PositionalArgumentList (Rule): # 14..19 "value" - - Expression (Rule): # 14..19 "value" - - PrimaryExpression (Rule): # 14..19 "value" - - Identifier (Token): "value" # 14..19 - - CloseParen (Token): ")" # 19..20 + - Identifier (Token): "function_name" # 0..13 + - ArgumentsDeclaration (Rule): # 13..20 "(value)" + - OpenParen (Token): "(" # 13..14 + - PositionalArgumentsList (Rule): # 14..19 "value" + - Expression (Rule): # 14..19 "value" + - Identifier (Token): "value" # 14..19 + - CloseParen (Token): ")" # 19..20 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/index_access/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/index_access/generated/0.4.11.yml index 8d73c0b50a..be8ffdc841 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/index_access/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/index_access/generated/0.4.11.yml @@ -9,11 +9,8 @@ Tree: - Expression (Rule): # 0..10 "arr[index]" - IndexAccessExpression (Rule): # 0..10 "arr[index]" - Expression (Rule): # 0..3 "arr" - - PrimaryExpression (Rule): # 0..3 "arr" - - Identifier (Token): "arr" # 0..3 - - IndexAccessOperator (Rule): # 3..10 "[index]" - - OpenBracket (Token): "[" # 3..4 - - Expression (Rule): # 4..9 "index" - - PrimaryExpression (Rule): # 4..9 "index" - - Identifier (Token): "index" # 4..9 - - CloseBracket (Token): "]" # 9..10 + - Identifier (Token): "arr" # 0..3 + - OpenBracket (Token): "[" # 3..4 + - Expression (Rule): # 4..9 "index" + - Identifier (Token): "index" # 4..9 + - CloseBracket (Token): "]" # 9..10 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/index_access_chain/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/index_access_chain/generated/0.4.11.yml index b46c83d602..df5ff77e90 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/index_access_chain/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/index_access_chain/generated/0.4.11.yml @@ -11,17 +11,12 @@ Tree: - Expression (Rule): # 0..11 "arr[index1]" - IndexAccessExpression (Rule): # 0..11 "arr[index1]" - Expression (Rule): # 0..3 "arr" - - PrimaryExpression (Rule): # 0..3 "arr" - - Identifier (Token): "arr" # 0..3 - - IndexAccessOperator (Rule): # 3..11 "[index1]" - - OpenBracket (Token): "[" # 3..4 - - Expression (Rule): # 4..10 "index1" - - PrimaryExpression (Rule): # 4..10 "index1" - - Identifier (Token): "index1" # 4..10 - - CloseBracket (Token): "]" # 10..11 - - IndexAccessOperator (Rule): # 11..19 "[index2]" - - OpenBracket (Token): "[" # 11..12 - - Expression (Rule): # 12..18 "index2" - - PrimaryExpression (Rule): # 12..18 "index2" - - Identifier (Token): "index2" # 12..18 - - CloseBracket (Token): "]" # 18..19 + - Identifier (Token): "arr" # 0..3 + - OpenBracket (Token): "[" # 3..4 + - Expression (Rule): # 4..10 "index1" + - Identifier (Token): "index1" # 4..10 + - CloseBracket (Token): "]" # 10..11 + - OpenBracket (Token): "[" # 11..12 + - Expression (Rule): # 12..18 "index2" + - Identifier (Token): "index2" # 12..18 + - CloseBracket (Token): "]" # 18..19 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/index_missing/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/index_missing/generated/0.4.11.yml index f1641f1660..929d0fc3f0 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/index_missing/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/index_missing/generated/0.4.11.yml @@ -15,6 +15,5 @@ Errors: # 1 total Tree: - Expression (Rule): # 0..5 "arr[]" - - PrimaryExpression (Rule): # 0..3 "arr" - - Identifier (Token): "arr" # 0..3 + - Identifier (Token): "arr" # 0..3 - SKIPPED (Token): "[]" # 3..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_end/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_end/generated/0.4.11.yml index 1da544b08d..b83e96cd68 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_end/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_end/generated/0.4.11.yml @@ -9,12 +9,9 @@ Tree: - Expression (Rule): # 0..9 "arr[:end]" - IndexAccessExpression (Rule): # 0..9 "arr[:end]" - Expression (Rule): # 0..3 "arr" - - PrimaryExpression (Rule): # 0..3 "arr" - - Identifier (Token): "arr" # 0..3 - - IndexAccessOperator (Rule): # 3..9 "[:end]" - - OpenBracket (Token): "[" # 3..4 - - Colon (Token): ":" # 4..5 - - Expression (Rule): # 5..8 "end" - - PrimaryExpression (Rule): # 5..8 "end" - - Identifier (Token): "end" # 5..8 - - CloseBracket (Token): "]" # 8..9 + - Identifier (Token): "arr" # 0..3 + - OpenBracket (Token): "[" # 3..4 + - Colon (Token): ":" # 4..5 + - Expression (Rule): # 5..8 "end" + - Identifier (Token): "end" # 5..8 + - CloseBracket (Token): "]" # 8..9 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start/generated/0.4.11.yml index f291592b32..d8e8d07b1f 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start/generated/0.4.11.yml @@ -9,12 +9,9 @@ Tree: - Expression (Rule): # 0..11 "arr[start:]" - IndexAccessExpression (Rule): # 0..11 "arr[start:]" - Expression (Rule): # 0..3 "arr" - - PrimaryExpression (Rule): # 0..3 "arr" - - Identifier (Token): "arr" # 0..3 - - IndexAccessOperator (Rule): # 3..11 "[start:]" - - OpenBracket (Token): "[" # 3..4 - - Expression (Rule): # 4..9 "start" - - PrimaryExpression (Rule): # 4..9 "start" - - Identifier (Token): "start" # 4..9 - - Colon (Token): ":" # 9..10 - - CloseBracket (Token): "]" # 10..11 + - Identifier (Token): "arr" # 0..3 + - OpenBracket (Token): "[" # 3..4 + - Expression (Rule): # 4..9 "start" + - Identifier (Token): "start" # 4..9 + - Colon (Token): ":" # 9..10 + - CloseBracket (Token): "]" # 10..11 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start_end/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start_end/generated/0.4.11.yml index c011e5819f..9c394bfb08 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start_end/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start_end/generated/0.4.11.yml @@ -9,15 +9,11 @@ Tree: - Expression (Rule): # 0..14 "arr[start:end]" - IndexAccessExpression (Rule): # 0..14 "arr[start:end]" - Expression (Rule): # 0..3 "arr" - - PrimaryExpression (Rule): # 0..3 "arr" - - Identifier (Token): "arr" # 0..3 - - IndexAccessOperator (Rule): # 3..14 "[start:end]" - - OpenBracket (Token): "[" # 3..4 - - Expression (Rule): # 4..9 "start" - - PrimaryExpression (Rule): # 4..9 "start" - - Identifier (Token): "start" # 4..9 - - Colon (Token): ":" # 9..10 - - Expression (Rule): # 10..13 "end" - - PrimaryExpression (Rule): # 10..13 "end" - - Identifier (Token): "end" # 10..13 - - CloseBracket (Token): "]" # 13..14 + - Identifier (Token): "arr" # 0..3 + - OpenBracket (Token): "[" # 3..4 + - Expression (Rule): # 4..9 "start" + - Identifier (Token): "start" # 4..9 + - Colon (Token): ":" # 9..10 + - Expression (Rule): # 10..13 "end" + - Identifier (Token): "end" # 10..13 + - CloseBracket (Token): "]" # 13..14 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_unbounded/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_unbounded/generated/0.4.11.yml index f231659996..d4a159481d 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_unbounded/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_unbounded/generated/0.4.11.yml @@ -9,9 +9,7 @@ Tree: - Expression (Rule): # 0..6 "arr[:]" - IndexAccessExpression (Rule): # 0..6 "arr[:]" - Expression (Rule): # 0..3 "arr" - - PrimaryExpression (Rule): # 0..3 "arr" - - Identifier (Token): "arr" # 0..3 - - IndexAccessOperator (Rule): # 3..6 "[:]" - - OpenBracket (Token): "[" # 3..4 - - Colon (Token): ":" # 4..5 - - CloseBracket (Token): "]" # 5..6 + - Identifier (Token): "arr" # 0..3 + - OpenBracket (Token): "[" # 3..4 + - Colon (Token): ":" # 4..5 + - CloseBracket (Token): "]" # 5..6 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/member_access/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/member_access/generated/0.4.11.yml index 6c34a96ae6..287cf7e9be 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/member_access/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/member_access/generated/0.4.11.yml @@ -9,8 +9,6 @@ Tree: - Expression (Rule): # 0..3 "x.y" - MemberAccessExpression (Rule): # 0..3 "x.y" - Expression (Rule): # 0..1 "x" - - PrimaryExpression (Rule): # 0..1 "x" - - Identifier (Token): "x" # 0..1 - - MemberAccessOperator (Rule): # 1..3 ".y" - - Period (Token): "." # 1..2 - - Identifier (Token): "y" # 2..3 + - Identifier (Token): "x" # 0..1 + - Period (Token): "." # 1..2 + - Identifier (Token): "y" # 2..3 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_chain/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_chain/generated/0.4.11.yml index d3087adbe1..c94bd7e6d1 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_chain/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_chain/generated/0.4.11.yml @@ -11,11 +11,8 @@ Tree: - Expression (Rule): # 0..3 "x.y" - MemberAccessExpression (Rule): # 0..3 "x.y" - Expression (Rule): # 0..1 "x" - - PrimaryExpression (Rule): # 0..1 "x" - - Identifier (Token): "x" # 0..1 - - MemberAccessOperator (Rule): # 1..3 ".y" - - Period (Token): "." # 1..2 - - Identifier (Token): "y" # 2..3 - - MemberAccessOperator (Rule): # 3..5 ".z" - - Period (Token): "." # 3..4 - - Identifier (Token): "z" # 4..5 + - Identifier (Token): "x" # 0..1 + - Period (Token): "." # 1..2 + - Identifier (Token): "y" # 2..3 + - Period (Token): "." # 3..4 + - Identifier (Token): "z" # 4..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_function_call/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_function_call/generated/0.4.11.yml index c24dc217e3..2e2dfb8e53 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_function_call/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_function_call/generated/0.4.11.yml @@ -11,12 +11,9 @@ Tree: - Expression (Rule): # 0..3 "x.y" - MemberAccessExpression (Rule): # 0..3 "x.y" - Expression (Rule): # 0..1 "x" - - PrimaryExpression (Rule): # 0..1 "x" - - Identifier (Token): "x" # 0..1 - - MemberAccessOperator (Rule): # 1..3 ".y" - - Period (Token): "." # 1..2 - - Identifier (Token): "y" # 2..3 - - FunctionCallOperator (Rule): # 3..5 "()" - - ArgumentList (Rule): # 3..5 "()" - - OpenParen (Token): "(" # 3..4 - - CloseParen (Token): ")" # 4..5 + - Identifier (Token): "x" # 0..1 + - Period (Token): "." # 1..2 + - Identifier (Token): "y" # 2..3 + - ArgumentsDeclaration (Rule): # 3..5 "()" + - OpenParen (Token): "(" # 3..4 + - CloseParen (Token): ")" # 4..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_index_access/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_index_access/generated/0.4.11.yml index a89ed2fcc4..a97880c4cc 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_index_access/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_index_access/generated/0.4.11.yml @@ -11,14 +11,10 @@ Tree: - Expression (Rule): # 0..3 "x.y" - MemberAccessExpression (Rule): # 0..3 "x.y" - Expression (Rule): # 0..1 "x" - - PrimaryExpression (Rule): # 0..1 "x" - - Identifier (Token): "x" # 0..1 - - MemberAccessOperator (Rule): # 1..3 ".y" - - Period (Token): "." # 1..2 - - Identifier (Token): "y" # 2..3 - - IndexAccessOperator (Rule): # 3..10 "[index]" - - OpenBracket (Token): "[" # 3..4 - - Expression (Rule): # 4..9 "index" - - PrimaryExpression (Rule): # 4..9 "index" - - Identifier (Token): "index" # 4..9 - - CloseBracket (Token): "]" # 9..10 + - Identifier (Token): "x" # 0..1 + - Period (Token): "." # 1..2 + - Identifier (Token): "y" # 2..3 + - OpenBracket (Token): "[" # 3..4 + - Expression (Rule): # 4..9 "index" + - Identifier (Token): "index" # 4..9 + - CloseBracket (Token): "]" # 9..10 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/overlapping_operators/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/overlapping_operators/generated/0.4.11.yml index 52486b6a20..0c0a5b4824 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/overlapping_operators/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/overlapping_operators/generated/0.4.11.yml @@ -7,19 +7,14 @@ Errors: [] Tree: - Expression (Rule): # 0..10 "a & b && c" - - AndExpression (Rule): # 0..10 "a & b && c" + - BinaryExpression (Rule): # 0..10 "a & b && c" - Expression (Rule): # 0..5 "a & b" - - BitAndExpression (Rule): # 0..5 "a & b" + - BinaryExpression (Rule): # 0..5 "a & b" - Expression (Rule): # 0..1 "a" - - PrimaryExpression (Rule): # 0..1 "a" - - Identifier (Token): "a" # 0..1 - - BitAndOperator (Rule): # 1..3 " &" - - Ampersand (Token): "&" # 2..3 + - Identifier (Token): "a" # 0..1 + - Ampersand (Token): "&" # 2..3 - Expression (Rule): # 3..5 " b" - - PrimaryExpression (Rule): # 3..5 " b" - - Identifier (Token): "b" # 4..5 - - AndOperator (Rule): # 5..8 " &&" - - AmpersandAmpersand (Token): "&&" # 6..8 + - Identifier (Token): "b" # 4..5 + - AmpersandAmpersand (Token): "&&" # 6..8 - Expression (Rule): # 8..10 " c" - - PrimaryExpression (Rule): # 8..10 " c" - - Identifier (Token): "c" # 9..10 + - Identifier (Token): "c" # 9..10 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/payable_call/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/payable_call/generated/0.4.11.yml index c6fd964a6c..488cdd6cc9 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/payable_call/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/payable_call/generated/0.4.11.yml @@ -9,15 +9,11 @@ Tree: - Expression (Rule): # 0..14 "payable(value)" - FunctionCallExpression (Rule): # 0..14 "payable(value)" - Expression (Rule): # 0..7 "payable" - - PrimaryExpression (Rule): # 0..7 "payable" - - ElementaryType (Rule): # 0..7 "payable" - - PayableType (Rule): # 0..7 "payable" - - PayableKeyword (Token): "payable" # 0..7 - - FunctionCallOperator (Rule): # 7..14 "(value)" - - ArgumentList (Rule): # 7..14 "(value)" - - OpenParen (Token): "(" # 7..8 - - PositionalArgumentList (Rule): # 8..13 "value" - - Expression (Rule): # 8..13 "value" - - PrimaryExpression (Rule): # 8..13 "value" - - Identifier (Token): "value" # 8..13 - - CloseParen (Token): ")" # 13..14 + - AddressType (Rule): # 0..7 "payable" + - PayableKeyword (Token): "payable" # 0..7 + - ArgumentsDeclaration (Rule): # 7..14 "(value)" + - OpenParen (Token): "(" # 7..8 + - PositionalArgumentsList (Rule): # 8..13 "value" + - Expression (Rule): # 8..13 "value" + - Identifier (Token): "value" # 8..13 + - CloseParen (Token): ")" # 13..14 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/postfix_decrement/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/postfix_decrement/generated/0.4.11.yml index 2dc4b10930..f4b6083343 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/postfix_decrement/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/postfix_decrement/generated/0.4.11.yml @@ -9,7 +9,5 @@ Tree: - Expression (Rule): # 0..5 "foo--" - UnaryPostfixExpression (Rule): # 0..5 "foo--" - Expression (Rule): # 0..3 "foo" - - PrimaryExpression (Rule): # 0..3 "foo" - - Identifier (Token): "foo" # 0..3 - - UnaryPostfixOperator (Rule): # 3..5 "--" - - MinusMinus (Token): "--" # 3..5 + - Identifier (Token): "foo" # 0..3 + - MinusMinus (Token): "--" # 3..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_decrement/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_decrement/generated/0.4.11.yml index b1ccb79d86..d1f1d2e7c0 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_decrement/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_decrement/generated/0.4.11.yml @@ -8,8 +8,6 @@ Errors: [] Tree: - Expression (Rule): # 0..5 "--foo" - UnaryPrefixExpression (Rule): # 0..5 "--foo" - - UnaryPrefixOperator (Rule): # 0..2 "--" - - MinusMinus (Token): "--" # 0..2 + - MinusMinus (Token): "--" # 0..2 - Expression (Rule): # 2..5 "foo" - - PrimaryExpression (Rule): # 2..5 "foo" - - Identifier (Token): "foo" # 2..5 + - Identifier (Token): "foo" # 2..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_minus/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_minus/generated/0.4.11.yml index 005aaabf7f..37c36f3ce0 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_minus/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_minus/generated/0.4.11.yml @@ -8,8 +8,6 @@ Errors: [] Tree: - Expression (Rule): # 0..4 "-foo" - UnaryPrefixExpression (Rule): # 0..4 "-foo" - - UnaryPrefixOperator (Rule): # 0..1 "-" - - Minus (Token): "-" # 0..1 + - Minus (Token): "-" # 0..1 - Expression (Rule): # 1..4 "foo" - - PrimaryExpression (Rule): # 1..4 "foo" - - Identifier (Token): "foo" # 1..4 + - Identifier (Token): "foo" # 1..4 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.4.11.yml index 1d8249b476..1687596b40 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.4.11.yml @@ -8,8 +8,6 @@ Errors: [] Tree: - Expression (Rule): # 0..4 "+foo" - UnaryPrefixExpression (Rule): # 0..4 "+foo" - - UnaryPrefixOperator (Rule): # 0..1 "+" - - Plus (Token): "+" # 0..1 + - Plus (Token): "+" # 0..1 - Expression (Rule): # 1..4 "foo" - - PrimaryExpression (Rule): # 1..4 "foo" - - Identifier (Token): "foo" # 1..4 + - Identifier (Token): "foo" # 1..4 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.0.yml b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.0.yml index cd6bb4d26e..b6a43407c9 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.0.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteType or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/input.sol:1:1] │ 1 │ +foo diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.3.yml b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.3.yml index d6b47d76be..bb57b515d4 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.3.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.3.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteType or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/input.sol:1:1] │ 1 │ +foo diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.7.0.yml b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.7.0.yml index cf5a1bb622..f71234c88f 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.7.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.7.0.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteType or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/input.sol:1:1] │ 1 │ +foo diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.4.11.yml index 7fd409414e..ebbbad6a6f 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.4.11.yml @@ -13,6 +13,5 @@ Errors: # 1 total Tree: - Expression (Rule): # 0..25 'unicode"This Emoji: 😃"' - - PrimaryExpression (Rule): # 0..7 "unicode" - - Identifier (Token): "unicode" # 0..7 + - Identifier (Token): "unicode" # 0..7 - SKIPPED (Token): '"This Emoji: 😃"' # 7..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.7.0.yml b/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.7.0.yml index b799bf5bd1..67cb94bfb3 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.7.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.7.0.yml @@ -7,6 +7,5 @@ Errors: [] Tree: - Expression (Rule): # 0..25 'unicode"This Emoji: 😃"' - - PrimaryExpression (Rule): # 0..25 'unicode"This Emoji: 😃"' - - StringExpression (Rule): # 0..25 'unicode"This Emoji: 😃"' - - UnicodeStringLiteral (Token): 'unicode"This Emoji: 😃"' # 0..25 + - UnicodeStringLiteralsList (Rule): # 0..25 'unicode"This Emoji: 😃"' + - UnicodeStringLiteral (Token): 'unicode"This Emoji: 😃"' # 0..25 diff --git a/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.6.0.yml index 654b5a9456..29c55ce289 100644 --- a/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.6.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.6.0.yml @@ -8,7 +8,7 @@ Errors: [] Tree: - FallbackFunctionDefinition (Rule): # 0..14 "fallback () {}" - FallbackKeyword (Token): "fallback" # 0..8 - - ParameterList (Rule): # 8..11 " ()" + - ParametersDeclaration (Rule): # 8..11 " ()" - OpenParen (Token): "(" # 9..10 - CloseParen (Token): ")" # 10..11 - Block (Rule): # 11..14 " {}" diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.4.11.yml index febecdd962..87bc523ab2 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.4.11.yml @@ -9,10 +9,10 @@ Tree: - FunctionDefinition (Rule): # 0..24 "function a() constant {}" - FunctionKeyword (Token): "function" # 0..8 - Identifier (Token): "a" # 9..10 - - ParameterList (Rule): # 10..12 "()" + - ParametersDeclaration (Rule): # 10..12 "()" - OpenParen (Token): "(" # 10..11 - CloseParen (Token): ")" # 11..12 - - FunctionAttribute (Rule): # 12..21 " constant" + - FunctionAttributesList (Rule): # 12..21 " constant" - ConstantKeyword (Token): "constant" # 13..21 - Block (Rule): # 21..24 " {}" - OpenBrace (Token): "{" # 22..23 diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.5.0.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.5.0.yml index a40cdfe811..0392fdbc4e 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.5.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.5.0.yml @@ -17,7 +17,7 @@ Tree: - FunctionDefinition (Rule): # 0..24 "function a() constant {}" - FunctionKeyword (Token): "function" # 0..8 - Identifier (Token): "a" # 9..10 - - ParameterList (Rule): # 10..12 "()" + - ParametersDeclaration (Rule): # 10..12 "()" - OpenParen (Token): "(" # 10..11 - CloseParen (Token): ")" # 11..12 - SKIPPED (Token): " constant {}" # 12..24 diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.6.0.yml index fd7de8d850..7584460757 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.6.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.6.0.yml @@ -17,7 +17,7 @@ Tree: - FunctionDefinition (Rule): # 0..24 "function a() constant {}" - FunctionKeyword (Token): "function" # 0..8 - Identifier (Token): "a" # 9..10 - - ParameterList (Rule): # 10..12 "()" + - ParametersDeclaration (Rule): # 10..12 "()" - OpenParen (Token): "(" # 10..11 - CloseParen (Token): ")" # 11..12 - SKIPPED (Token): " constant {}" # 12..24 diff --git a/crates/solidity/testing/snapshots/cst_output/StringExpression/hex_multiple/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiteralsList/multiple/generated/0.4.11.yml similarity index 84% rename from crates/solidity/testing/snapshots/cst_output/StringExpression/hex_multiple/generated/0.4.11.yml rename to crates/solidity/testing/snapshots/cst_output/HexStringLiteralsList/multiple/generated/0.4.11.yml index 39058483e8..b6d578daf4 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringExpression/hex_multiple/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiteralsList/multiple/generated/0.4.11.yml @@ -6,6 +6,6 @@ Source: > Errors: [] Tree: - - StringExpression (Rule): # 0..15 'hex"ab" hex''cd''' + - HexStringLiteralsList (Rule): # 0..15 'hex"ab" hex''cd''' - HexStringLiteral (Token): 'hex"ab"' # 0..7 - HexStringLiteral (Token): "hex'cd'" # 8..15 diff --git a/crates/solidity/testing/snapshots/cst_output/StringExpression/hex_multiple/input.sol b/crates/solidity/testing/snapshots/cst_output/HexStringLiteralsList/multiple/input.sol similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/StringExpression/hex_multiple/input.sol rename to crates/solidity/testing/snapshots/cst_output/HexStringLiteralsList/multiple/input.sol diff --git a/crates/solidity/testing/snapshots/cst_output/StringExpression/hex_single/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiteralsList/single/generated/0.4.11.yml similarity index 83% rename from crates/solidity/testing/snapshots/cst_output/StringExpression/hex_single/generated/0.4.11.yml rename to crates/solidity/testing/snapshots/cst_output/HexStringLiteralsList/single/generated/0.4.11.yml index 5272e58ecb..285eadc4f7 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringExpression/hex_single/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiteralsList/single/generated/0.4.11.yml @@ -6,5 +6,5 @@ Source: > Errors: [] Tree: - - StringExpression (Rule): # 0..11 'hex"abcdef"' + - HexStringLiteralsList (Rule): # 0..11 'hex"abcdef"' - HexStringLiteral (Token): 'hex"abcdef"' # 0..11 diff --git a/crates/solidity/testing/snapshots/cst_output/StringExpression/hex_single/input.sol b/crates/solidity/testing/snapshots/cst_output/HexStringLiteralsList/single/input.sol similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/StringExpression/hex_single/input.sol rename to crates/solidity/testing/snapshots/cst_output/HexStringLiteralsList/single/input.sol diff --git a/crates/solidity/testing/snapshots/cst_output/Identifier/keyword_finney/generated/0.7.0.yml b/crates/solidity/testing/snapshots/cst_output/Identifier/keyword_finney/generated/0.7.0.yml deleted file mode 100644 index 8f9d9457ff..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/Identifier/keyword_finney/generated/0.7.0.yml +++ /dev/null @@ -1,9 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ finney │ 0..6 - -Errors: [] - -Tree: - - Identifier (Token): "finney" # 0..6 diff --git a/crates/solidity/testing/snapshots/cst_output/Identifier/keyword_immutable/generated/0.5.0.yml b/crates/solidity/testing/snapshots/cst_output/Identifier/keyword_immutable/generated/0.6.5.yml similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/Identifier/keyword_immutable/generated/0.5.0.yml rename to crates/solidity/testing/snapshots/cst_output/Identifier/keyword_immutable/generated/0.6.5.yml diff --git a/crates/solidity/testing/snapshots/cst_output/Identifier/keyword_szabo/generated/0.7.0.yml b/crates/solidity/testing/snapshots/cst_output/Identifier/keyword_szabo/generated/0.7.0.yml deleted file mode 100644 index 47b940afe6..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/Identifier/keyword_szabo/generated/0.7.0.yml +++ /dev/null @@ -1,9 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ szabo │ 0..5 - -Errors: [] - -Tree: - - Identifier (Token): "szabo" # 0..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Identifier/keyword_unchecked/generated/0.5.0.yml b/crates/solidity/testing/snapshots/cst_output/Identifier/keyword_unchecked/generated/0.8.0.yml similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/Identifier/keyword_unchecked/generated/0.5.0.yml rename to crates/solidity/testing/snapshots/cst_output/Identifier/keyword_unchecked/generated/0.8.0.yml diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/generated/0.4.11.yml new file mode 100644 index 0000000000..f954111db8 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/generated/0.4.11.yml @@ -0,0 +1,29 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ import { A1 as A2, B1, C1 as C2 } from "foo"; │ 0..45 + +Errors: [] + +Tree: + - ImportDirective (Rule): # 0..45 'import { A1 as A2, B1, C1 as C2 } from "foo";' + - ImportKeyword (Token): "import" # 0..6 + - DeconstructionImport (Rule): # 6..44 ' { A1 as A2, B1, C1 as C2 } from "foo"' + - OpenBrace (Token): "{" # 7..8 + - DeconstructionImportSymbolsList (Rule): # 8..31 " A1 as A2, B1, C1 as C2" + - DeconstructionImportSymbol (Rule): # 8..17 " A1 as A2" + - Identifier (Token): "A1" # 9..11 + - AsKeyword (Token): "as" # 12..14 + - Identifier (Token): "A2" # 15..17 + - Comma (Token): "," # 17..18 + - DeconstructionImportSymbol (Rule): # 18..21 " B1" + - Identifier (Token): "B1" # 19..21 + - Comma (Token): "," # 21..22 + - DeconstructionImportSymbol (Rule): # 22..31 " C1 as C2" + - Identifier (Token): "C1" # 23..25 + - AsKeyword (Token): "as" # 26..28 + - Identifier (Token): "C2" # 29..31 + - CloseBrace (Token): "}" # 32..33 + - FromKeyword (Token): "from" # 34..38 + - AsciiStringLiteral (Token): '"foo"' # 39..44 + - Semicolon (Token): ";" # 44..45 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/input.sol b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/input.sol new file mode 100644 index 0000000000..d1d6cb6df2 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/input.sol @@ -0,0 +1 @@ +import { A1 as A2, B1, C1 as C2 } from "foo"; \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/selective_import_single/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/generated/0.4.11.yml similarity index 54% rename from crates/solidity/testing/snapshots/cst_output/ImportDirective/selective_import_single/generated/0.4.11.yml rename to crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/generated/0.4.11.yml index 2f699d276a..d62862b618 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/selective_import_single/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/generated/0.4.11.yml @@ -8,14 +8,14 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..29 'import { x as y } from "foo";' - ImportKeyword (Token): "import" # 0..6 - - SelectiveImport (Rule): # 6..28 ' { x as y } from "foo"' + - DeconstructionImport (Rule): # 6..28 ' { x as y } from "foo"' - OpenBrace (Token): "{" # 7..8 - - Identifier (Token): "x" # 9..10 - - ImportAlias (Rule): # 10..15 " as y" - - AsKeyword (Token): "as" # 11..13 - - Identifier (Token): "y" # 14..15 + - DeconstructionImportSymbolsList (Rule): # 8..15 " x as y" + - DeconstructionImportSymbol (Rule): # 8..15 " x as y" + - Identifier (Token): "x" # 9..10 + - AsKeyword (Token): "as" # 11..13 + - Identifier (Token): "y" # 14..15 - CloseBrace (Token): "}" # 16..17 - FromKeyword (Token): "from" # 18..22 - - ImportPath (Rule): # 22..28 ' "foo"' - - AsciiStringLiteral (Token): '"foo"' # 23..28 + - AsciiStringLiteral (Token): '"foo"' # 23..28 - Semicolon (Token): ";" # 28..29 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/selective_import_single/input.sol b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/input.sol similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/ImportDirective/selective_import_single/input.sol rename to crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/input.sol diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/asterisk_import/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/generated/0.4.11.yml similarity index 59% rename from crates/solidity/testing/snapshots/cst_output/ImportDirective/asterisk_import/generated/0.4.11.yml rename to crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/generated/0.4.11.yml index 61ea4dda32..03a76fb81c 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/asterisk_import/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/generated/0.4.11.yml @@ -8,12 +8,10 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..27 'import * as foo from "bar";' - ImportKeyword (Token): "import" # 0..6 - - AsteriskImport (Rule): # 6..26 ' * as foo from "bar"' + - NamedImport (Rule): # 6..26 ' * as foo from "bar"' - Asterisk (Token): "*" # 7..8 - - ImportAlias (Rule): # 8..15 " as foo" - - AsKeyword (Token): "as" # 9..11 - - Identifier (Token): "foo" # 12..15 + - AsKeyword (Token): "as" # 9..11 + - Identifier (Token): "foo" # 12..15 - FromKeyword (Token): "from" # 16..20 - - ImportPath (Rule): # 20..26 ' "bar"' - - AsciiStringLiteral (Token): '"bar"' # 21..26 + - AsciiStringLiteral (Token): '"bar"' # 21..26 - Semicolon (Token): ";" # 26..27 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/asterisk_import/input.sol b/crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/input.sol similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/ImportDirective/asterisk_import/input.sol rename to crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/input.sol diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/simple_import/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/generated/0.4.11.yml similarity index 70% rename from crates/solidity/testing/snapshots/cst_output/ImportDirective/simple_import/generated/0.4.11.yml rename to crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/generated/0.4.11.yml index 82d4a5c684..9052382ab0 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/simple_import/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/generated/0.4.11.yml @@ -8,7 +8,6 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..13 'import "foo";' - ImportKeyword (Token): "import" # 0..6 - - SimpleImport (Rule): # 6..12 ' "foo"' - - ImportPath (Rule): # 6..12 ' "foo"' - - AsciiStringLiteral (Token): '"foo"' # 7..12 + - PathImport (Rule): # 6..12 ' "foo"' + - AsciiStringLiteral (Token): '"foo"' # 7..12 - Semicolon (Token): ";" # 12..13 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/simple_import/input.sol b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/input.sol similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/ImportDirective/simple_import/input.sol rename to crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/input.sol diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/simple_import_with_alias/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/generated/0.4.11.yml similarity index 54% rename from crates/solidity/testing/snapshots/cst_output/ImportDirective/simple_import_with_alias/generated/0.4.11.yml rename to crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/generated/0.4.11.yml index b3d2706189..a8a320ec38 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/simple_import_with_alias/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/generated/0.4.11.yml @@ -8,10 +8,8 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..20 'import "foo" as bar;' - ImportKeyword (Token): "import" # 0..6 - - SimpleImport (Rule): # 6..19 ' "foo" as bar' - - ImportPath (Rule): # 6..12 ' "foo"' - - AsciiStringLiteral (Token): '"foo"' # 7..12 - - ImportAlias (Rule): # 12..19 " as bar" - - AsKeyword (Token): "as" # 13..15 - - Identifier (Token): "bar" # 16..19 + - PathImport (Rule): # 6..19 ' "foo" as bar' + - AsciiStringLiteral (Token): '"foo"' # 7..12 + - AsKeyword (Token): "as" # 13..15 + - Identifier (Token): "bar" # 16..19 - Semicolon (Token): ";" # 19..20 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/simple_import_with_alias/input.sol b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/input.sol similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/ImportDirective/simple_import_with_alias/input.sol rename to crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/input.sol diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/selective_import_multiple/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/selective_import_multiple/generated/0.4.11.yml deleted file mode 100644 index cc94fea695..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/selective_import_multiple/generated/0.4.11.yml +++ /dev/null @@ -1,28 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ import { A1 as A2, B, C1 as C3 } from "foo"; │ 0..44 - -Errors: [] - -Tree: - - ImportDirective (Rule): # 0..44 'import { A1 as A2, B, C1 as C3 } from "foo";' - - ImportKeyword (Token): "import" # 0..6 - - SelectiveImport (Rule): # 6..43 ' { A1 as A2, B, C1 as C3 } from "foo"' - - OpenBrace (Token): "{" # 7..8 - - Identifier (Token): "A1" # 9..11 - - ImportAlias (Rule): # 11..17 " as A2" - - AsKeyword (Token): "as" # 12..14 - - Identifier (Token): "A2" # 15..17 - - Comma (Token): "," # 17..18 - - Identifier (Token): "B" # 19..20 - - Comma (Token): "," # 20..21 - - Identifier (Token): "C1" # 22..24 - - ImportAlias (Rule): # 24..30 " as C3" - - AsKeyword (Token): "as" # 25..27 - - Identifier (Token): "C3" # 28..30 - - CloseBrace (Token): "}" # 31..32 - - FromKeyword (Token): "from" # 33..37 - - ImportPath (Rule): # 37..43 ' "foo"' - - AsciiStringLiteral (Token): '"foo"' # 38..43 - - Semicolon (Token): ";" # 43..44 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/selective_import_multiple/input.sol b/crates/solidity/testing/snapshots/cst_output/ImportDirective/selective_import_multiple/input.sol deleted file mode 100644 index ece7bfd985..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/selective_import_multiple/input.sol +++ /dev/null @@ -1 +0,0 @@ -import { A1 as A2, B, C1 as C3 } from "foo"; \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/InterfaceDefinition/sample_counter/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/InterfaceDefinition/sample_counter/generated/0.4.11.yml index a7c6437564..e96fd9328b 100644 --- a/crates/solidity/testing/snapshots/cst_output/InterfaceDefinition/sample_counter/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/InterfaceDefinition/sample_counter/generated/0.4.11.yml @@ -16,36 +16,37 @@ Tree: - InterfaceKeyword (Token): "interface" # 0..9 - Identifier (Token): "ICounter" # 10..18 - OpenBrace (Token): "{" # 19..20 - - FunctionDefinition (Rule): # 21..105 " // returns the current count\n function coun..." - - LeadingTrivia (Rule): # 21..58 " // returns the current count\n " - - SingleLineComment (Trivia): "// returns the current count" # 25..53 - - FunctionKeyword (Token): "function" # 58..66 - - Identifier (Token): "count" # 67..72 - - ParameterList (Rule): # 72..74 "()" - - OpenParen (Token): "(" # 72..73 - - CloseParen (Token): ")" # 73..74 - - FunctionAttribute (Rule): # 74..83 " external" - - ExternalKeyword (Token): "external" # 75..83 - - FunctionAttribute (Rule): # 83..88 " view" - - ViewKeyword (Token): "view" # 84..88 - - ReturnsKeyword (Token): "returns" # 89..96 - - ParameterList (Rule): # 96..103 " (uint)" - - OpenParen (Token): "(" # 97..98 - - ParameterDeclaration (Rule): # 98..102 "uint" - - TypeName (Rule): # 98..102 "uint" - - ElementaryType (Rule): # 98..102 "uint" - - UnsignedIntegerType (Token): "uint" # 98..102 - - CloseParen (Token): ")" # 102..103 - - Semicolon (Token): ";" # 103..104 - - FunctionDefinition (Rule): # 105..171 "\n // increments the counter\n function increm..." - - LeadingTrivia (Rule): # 105..140 "\n // increments the counter\n " - - SingleLineComment (Trivia): "// increments the counter" # 110..135 - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "increment" # 149..158 - - ParameterList (Rule): # 158..160 "()" - - OpenParen (Token): "(" # 158..159 - - CloseParen (Token): ")" # 159..160 - - FunctionAttribute (Rule): # 160..169 " external" - - ExternalKeyword (Token): "external" # 161..169 - - Semicolon (Token): ";" # 169..170 + - InterfaceMembersList (Rule): # 21..171 " // returns the current count\n function coun..." + - FunctionDefinition (Rule): # 21..105 " // returns the current count\n function coun..." + - LeadingTrivia (Rule): # 21..58 " // returns the current count\n " + - SingleLineComment (Trivia): "// returns the current count" # 25..53 + - FunctionKeyword (Token): "function" # 58..66 + - Identifier (Token): "count" # 67..72 + - ParametersDeclaration (Rule): # 72..74 "()" + - OpenParen (Token): "(" # 72..73 + - CloseParen (Token): ")" # 73..74 + - FunctionAttributesList (Rule): # 74..88 " external view" + - ExternalKeyword (Token): "external" # 75..83 + - ViewKeyword (Token): "view" # 84..88 + - ReturnsDeclaration (Rule): # 88..103 " returns (uint)" + - ReturnsKeyword (Token): "returns" # 89..96 + - ParametersDeclaration (Rule): # 96..103 " (uint)" + - OpenParen (Token): "(" # 97..98 + - ParametersList (Rule): # 98..102 "uint" + - Parameter (Rule): # 98..102 "uint" + - TypeName (Rule): # 98..102 "uint" + - UnsignedIntegerType (Token): "uint" # 98..102 + - CloseParen (Token): ")" # 102..103 + - Semicolon (Token): ";" # 103..104 + - FunctionDefinition (Rule): # 105..171 "\n // increments the counter\n function increm..." + - LeadingTrivia (Rule): # 105..140 "\n // increments the counter\n " + - SingleLineComment (Trivia): "// increments the counter" # 110..135 + - FunctionKeyword (Token): "function" # 140..148 + - Identifier (Token): "increment" # 149..158 + - ParametersDeclaration (Rule): # 158..160 "()" + - OpenParen (Token): "(" # 158..159 + - CloseParen (Token): ")" # 159..160 + - FunctionAttributesList (Rule): # 160..169 " external" + - ExternalKeyword (Token): "external" # 161..169 + - Semicolon (Token): ";" # 169..170 - CloseBrace (Token): "}" # 171..172 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.4.11.yml index 1325b49a81..7c9fb78013 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.4.11.yml @@ -18,6 +18,5 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKeyType (Rule): # 8..14 "string" - - ElementaryType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - StringKeyword (Token): "string" # 8..14 - SKIPPED (Token): " Foo => bytes32 Bar)" # 14..34 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.8.18.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.8.18.yml index b8de6a7907..47946947fa 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.8.18.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.8.18.yml @@ -10,13 +10,11 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKeyType (Rule): # 8..18 "string Foo" - - ElementaryType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - StringKeyword (Token): "string" # 8..14 - Identifier (Token): "Foo" # 15..18 - EqualGreaterThan (Token): "=>" # 19..21 - MappingValueType (Rule): # 21..33 " bytes32 Bar" - TypeName (Rule): # 21..29 " bytes32" - - ElementaryType (Rule): # 21..29 " bytes32" - - FixedBytesType (Token): "bytes32" # 22..29 + - FixedBytesType (Token): "bytes32" # 22..29 - Identifier (Token): "Bar" # 30..33 - CloseParen (Token): ")" # 33..34 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.4.11.yml index 4b93609a75..2cac9185bc 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.4.11.yml @@ -18,6 +18,5 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKeyType (Rule): # 8..14 "string" - - ElementaryType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - StringKeyword (Token): "string" # 8..14 - SKIPPED (Token): " Foo => bytes32)" # 14..30 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.8.18.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.8.18.yml index be19ab7bfc..a95005a73d 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.8.18.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.8.18.yml @@ -10,12 +10,10 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKeyType (Rule): # 8..18 "string Foo" - - ElementaryType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - StringKeyword (Token): "string" # 8..14 - Identifier (Token): "Foo" # 15..18 - EqualGreaterThan (Token): "=>" # 19..21 - MappingValueType (Rule): # 21..29 " bytes32" - TypeName (Rule): # 21..29 " bytes32" - - ElementaryType (Rule): # 21..29 " bytes32" - - FixedBytesType (Token): "bytes32" # 22..29 + - FixedBytesType (Token): "bytes32" # 22..29 - CloseParen (Token): ")" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.4.11.yml index e325f59332..0d3eb09cd8 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.4.11.yml @@ -18,11 +18,9 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKeyType (Rule): # 8..14 "string" - - ElementaryType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - MappingValueType (Rule): # 17..25 " bytes32" - TypeName (Rule): # 17..25 " bytes32" - - ElementaryType (Rule): # 17..25 " bytes32" - - FixedBytesType (Token): "bytes32" # 18..25 + - FixedBytesType (Token): "bytes32" # 18..25 - SKIPPED (Token): " Bar)" # 25..30 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.8.18.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.8.18.yml index 406c034f35..f340a0f3ab 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.8.18.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.8.18.yml @@ -10,12 +10,10 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKeyType (Rule): # 8..14 "string" - - ElementaryType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - MappingValueType (Rule): # 17..29 " bytes32 Bar" - TypeName (Rule): # 17..25 " bytes32" - - ElementaryType (Rule): # 17..25 " bytes32" - - FixedBytesType (Token): "bytes32" # 18..25 + - FixedBytesType (Token): "bytes32" # 18..25 - Identifier (Token): "Bar" # 26..29 - CloseParen (Token): ")" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/unnamed/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/unnamed/generated/0.4.11.yml index b7e8bf581b..03ee0e26bc 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/unnamed/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/unnamed/generated/0.4.11.yml @@ -10,11 +10,9 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKeyType (Rule): # 8..14 "string" - - ElementaryType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - MappingValueType (Rule): # 17..25 " bytes32" - TypeName (Rule): # 17..25 " bytes32" - - ElementaryType (Rule): # 17..25 " bytes32" - - FixedBytesType (Token): "bytes32" # 18..25 + - FixedBytesType (Token): "bytes32" # 18..25 - CloseParen (Token): ")" # 25..26 diff --git a/crates/solidity/testing/snapshots/cst_output/NewExpression/array_1d_expression/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/NewExpression/array_1d_expression/generated/0.4.11.yml index c18cdac50b..1720fd73a5 100644 --- a/crates/solidity/testing/snapshots/cst_output/NewExpression/array_1d_expression/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/NewExpression/array_1d_expression/generated/0.4.11.yml @@ -15,7 +15,6 @@ Tree: - Identifier (Token): "Foo" # 4..7 - OpenBracket (Token): "[" # 7..8 - Expression (Rule): # 8..10 "10" - - PrimaryExpression (Rule): # 8..10 "10" - - NumericExpression (Rule): # 8..10 "10" - - DecimalLiteral (Token): "10" # 8..10 + - NumericExpression (Rule): # 8..10 "10" + - DecimalLiteral (Token): "10" # 8..10 - CloseBracket (Token): "]" # 10..11 diff --git a/crates/solidity/testing/snapshots/cst_output/NumericExpression/days_unit/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/NumericExpression/days_unit/generated/0.4.11.yml index aacd585e15..795f0429ab 100644 --- a/crates/solidity/testing/snapshots/cst_output/NumericExpression/days_unit/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/NumericExpression/days_unit/generated/0.4.11.yml @@ -8,5 +8,4 @@ Errors: [] Tree: - NumericExpression (Rule): # 0..7 "10 days" - DecimalLiteral (Token): "10" # 0..2 - - NumberUnit (Rule): # 2..7 " days" - - DaysKeyword (Token): "days" # 3..7 + - DaysKeyword (Token): "days" # 3..7 diff --git a/crates/solidity/testing/snapshots/cst_output/NumericExpression/ether_unit/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/NumericExpression/ether_unit/generated/0.4.11.yml index 9b4ddb31ac..af9795b507 100644 --- a/crates/solidity/testing/snapshots/cst_output/NumericExpression/ether_unit/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/NumericExpression/ether_unit/generated/0.4.11.yml @@ -8,5 +8,4 @@ Errors: [] Tree: - NumericExpression (Rule): # 0..8 "10 ether" - DecimalLiteral (Token): "10" # 0..2 - - NumberUnit (Rule): # 2..8 " ether" - - EtherKeyword (Token): "ether" # 3..8 + - EtherKeyword (Token): "ether" # 3..8 diff --git a/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_unit/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_unit/generated/0.4.11.yml index e7d2b0b315..d5e74df06d 100644 --- a/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_unit/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_unit/generated/0.4.11.yml @@ -8,5 +8,4 @@ Errors: [] Tree: - NumericExpression (Rule): # 0..7 "0x1 wei" - HexLiteral (Token): "0x1" # 0..3 - - NumberUnit (Rule): # 3..7 " wei" - - WeiKeyword (Token): "wei" # 4..7 + - WeiKeyword (Token): "wei" # 4..7 diff --git a/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/generated/0.5.0.yml b/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/generated/0.5.0.yml index 32433466a9..07b2352cfa 100644 --- a/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/generated/0.5.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/generated/0.5.0.yml @@ -5,15 +5,13 @@ Source: > Errors: # 1 total - > - Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword. - ╭─[crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/input.sol:1:2] + Error: Expected DecimalLiteral or HexLiteral. + ╭─[crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/input.sol:1:1] │ 1 │ 0X123456789 - │ ─────┬──── - │ ╰────── Error occurred here. + │ ─────┬───── + │ ╰─────── Error occurred here. ───╯ Tree: - - NumericExpression (Rule): # 0..11 "0X123456789" - - DecimalLiteral (Token): "0" # 0..1 - - SKIPPED (Token): "X123456789" # 1..11 + - SKIPPED (Token): "0X123456789" # 0..11 diff --git a/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/generated/0.6.11.yml b/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/generated/0.6.11.yml deleted file mode 100644 index f6b6de3212..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/generated/0.6.11.yml +++ /dev/null @@ -1,19 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ 0X123456789 │ 0..11 - -Errors: # 1 total - - > - Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or GweiKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword. - ╭─[crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/input.sol:1:2] - │ - 1 │ 0X123456789 - │ ─────┬──── - │ ╰────── Error occurred here. - ───╯ - -Tree: - - NumericExpression (Rule): # 0..11 "0X123456789" - - DecimalLiteral (Token): "0" # 0..1 - - SKIPPED (Token): "X123456789" # 1..11 diff --git a/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/generated/0.7.0.yml b/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/generated/0.7.0.yml deleted file mode 100644 index c0ef77b9da..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/generated/0.7.0.yml +++ /dev/null @@ -1,19 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ 0X123456789 │ 0..11 - -Errors: # 1 total - - > - Error: Expected DaysKeyword or EtherKeyword or GweiKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or WeeksKeyword or WeiKeyword. - ╭─[crates/solidity/testing/snapshots/cst_output/NumericExpression/hex_uppercase_prefix/input.sol:1:2] - │ - 1 │ 0X123456789 - │ ─────┬──── - │ ╰────── Error occurred here. - ───╯ - -Tree: - - NumericExpression (Rule): # 0..11 "0X123456789" - - DecimalLiteral (Token): "0" # 0..1 - - SKIPPED (Token): "X123456789" # 1..11 diff --git a/crates/solidity/testing/snapshots/cst_output/NumericExpression/years_unit/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/NumericExpression/years_unit/generated/0.4.11.yml index 346b9a99ff..c342754daf 100644 --- a/crates/solidity/testing/snapshots/cst_output/NumericExpression/years_unit/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/NumericExpression/years_unit/generated/0.4.11.yml @@ -8,5 +8,4 @@ Errors: [] Tree: - NumericExpression (Rule): # 0..9 "10 years\n" - DecimalLiteral (Token): "10" # 0..2 - - NumberUnit (Rule): # 2..9 " years\n" - - YearsKeyword (Token): "years" # 3..8 + - YearsKeyword (Token): "years" # 3..8 diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/generated/0.4.11.yml new file mode 100644 index 0000000000..a962905b2b --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/generated/0.4.11.yml @@ -0,0 +1,14 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ pragma abicoder foo; │ 0..20 + +Errors: [] + +Tree: + - PragmaDirective (Rule): # 0..20 "pragma abicoder foo;" + - PragmaKeyword (Token): "pragma" # 0..6 + - ABICoderPragma (Rule): # 6..19 " abicoder foo" + - AbicoderKeyword (Token): "abicoder" # 7..15 + - Identifier (Token): "foo" # 16..19 + - Semicolon (Token): ";" # 19..20 diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/input.sol b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/input.sol new file mode 100644 index 0000000000..945135d40c --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/input.sol @@ -0,0 +1 @@ +pragma abicoder foo; \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/generated/0.4.11.yml new file mode 100644 index 0000000000..cdb0e5ce6f --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/generated/0.4.11.yml @@ -0,0 +1,14 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ pragma experimental foo; │ 0..24 + +Errors: [] + +Tree: + - PragmaDirective (Rule): # 0..24 "pragma experimental foo;" + - PragmaKeyword (Token): "pragma" # 0..6 + - ExperimentalPragma (Rule): # 6..23 " experimental foo" + - ExperimentalKeyword (Token): "experimental" # 7..19 + - Identifier (Token): "foo" # 20..23 + - Semicolon (Token): ";" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/input.sol b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/input.sol new file mode 100644 index 0000000000..8dd0a079a9 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/input.sol @@ -0,0 +1 @@ +pragma experimental foo; \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/generated/0.4.11.yml new file mode 100644 index 0000000000..b5742cfc7a --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/generated/0.4.11.yml @@ -0,0 +1,21 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ pragma solidity 1.0.0; │ 0..22 + +Errors: [] + +Tree: + - PragmaDirective (Rule): # 0..22 "pragma solidity 1.0.0;" + - PragmaKeyword (Token): "pragma" # 0..6 + - VersionPragma (Rule): # 6..21 " solidity 1.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressionsList (Rule): # 15..21 " 1.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 1.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 1.0.0" + - VersionPragmaValue (Token): "1" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/input.sol b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/input.sol new file mode 100644 index 0000000000..61776e3c3e --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/input.sol @@ -0,0 +1 @@ +pragma solidity 1.0.0; \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.6.0.yml index 7c3b9ae6e9..2431c16c35 100644 --- a/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.6.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.6.0.yml @@ -8,7 +8,7 @@ Errors: [] Tree: - ReceiveFunctionDefinition (Rule): # 0..13 "receive () {}" - ReceiveKeyword (Token): "receive" # 0..7 - - ParameterList (Rule): # 7..10 " ()" + - ParametersDeclaration (Rule): # 7..10 " ()" - OpenParen (Token): "(" # 8..9 - CloseParen (Token): ")" # 9..10 - Block (Rule): # 10..13 " {}" diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11.yml index 34f05b5795..20f76a55e1 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11.yml @@ -12,12 +12,11 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..71 "contract X { }\n \n// spaces before this\n\n/* new ..." - - Definition (Rule): # 0..15 "contract X { }\n" + - SourceUnitMembersList (Rule): # 0..15 "contract X { }\n" - ContractDefinition (Rule): # 0..15 "contract X { }\n" - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "X" # 9..10 - OpenBrace (Token): "{" # 11..12 - - ContractBodyElements (Rule): [] # 12..12 - CloseBrace (Token): "}" # 13..14 - EndOfFileTrivia (Rule): # 15..71 " \n// spaces before this\n\n/* new lines after thi..." - SingleLineComment (Trivia): "// spaces before this" # 20..41 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.4.11.yml new file mode 100644 index 0000000000..0a5832b5ea --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.4.11.yml @@ -0,0 +1,126 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ pragma solidity 0.0.0; │ 0..22 + 2 │ │ 23..23 + 3 │ import "foo.sol"; │ 24..41 + 4 │ │ 42..42 + 5 │ using A for B; │ 43..57 + 6 │ │ 58..58 + 7 │ contract C { } │ 59..73 + 8 │ │ 74..74 + 9 │ interface I { } │ 75..90 + 10 │ │ 91..91 + 11 │ library L { } │ 92..105 + 12 │ │ 106..106 + 13 │ struct S { } │ 107..119 + 14 │ │ 120..120 + 15 │ enum E { } │ 121..131 + 16 │ │ 132..132 + 17 │ uint32 constant x = 0; │ 133..155 + 18 │ │ 156..156 + 19 │ function f() public { } │ 157..180 + 20 │ │ 181..181 + 21 │ error E1(string); │ 182..199 + 22 │ │ 200..200 + 23 │ type T is bool; │ 201..216 + +Errors: # 1 total + - > + Error: Expected EndOfLine or MultilineComment or SingleLineComment or Whitespace. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol:23:1] + │ + 23 │ type T is bool; + │ ────────┬─────── + │ ╰───────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..217 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' + - SourceUnitMembersList (Rule): # 0..200 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressionsList (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - PathImport (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - UsingDirective (Rule): # 42..58 "\nusing A for B;\n" + - UsingKeyword (Token): "using" # 43..48 + - UsingDirectivePath (Rule): # 48..50 " A" + - IdentifierPath (Rule): # 48..50 " A" + - Identifier (Token): "A" # 49..50 + - ForKeyword (Token): "for" # 51..54 + - TypeName (Rule): # 54..56 " B" + - IdentifierPath (Rule): # 54..56 " B" + - Identifier (Token): "B" # 55..56 + - Semicolon (Token): ";" # 56..57 + - ContractDefinition (Rule): # 58..74 "\ncontract C { }\n" + - ContractKeyword (Token): "contract" # 59..67 + - Identifier (Token): "C" # 68..69 + - OpenBrace (Token): "{" # 70..71 + - CloseBrace (Token): "}" # 72..73 + - InterfaceDefinition (Rule): # 74..91 "\ninterface I { }\n" + - InterfaceKeyword (Token): "interface" # 75..84 + - Identifier (Token): "I" # 85..86 + - OpenBrace (Token): "{" # 87..88 + - CloseBrace (Token): "}" # 89..90 + - LibraryDefinition (Rule): # 91..106 "\nlibrary L { }\n" + - LibraryKeyword (Token): "library" # 92..99 + - Identifier (Token): "L" # 100..101 + - OpenBrace (Token): "{" # 102..103 + - CloseBrace (Token): "}" # 104..105 + - StructDefinition (Rule): # 106..120 "\nstruct S { }\n" + - StructKeyword (Token): "struct" # 107..113 + - Identifier (Token): "S" # 114..115 + - OpenBrace (Token): "{" # 116..117 + - CloseBrace (Token): "}" # 118..119 + - EnumDefinition (Rule): # 120..132 "\nenum E { }\n" + - EnumKeyword (Token): "enum" # 121..125 + - Identifier (Token): "E" # 126..127 + - OpenBrace (Token): "{" # 128..129 + - CloseBrace (Token): "}" # 130..131 + - ConstantDefinition (Rule): # 132..156 "\nuint32 constant x = 0;\n" + - TypeName (Rule): # 132..139 "\nuint32" + - UnsignedIntegerType (Token): "uint32" # 133..139 + - ConstantKeyword (Token): "constant" # 140..148 + - Identifier (Token): "x" # 149..150 + - Equal (Token): "=" # 151..152 + - Expression (Rule): # 152..154 " 0" + - NumericExpression (Rule): # 152..154 " 0" + - DecimalLiteral (Token): "0" # 153..154 + - Semicolon (Token): ";" # 154..155 + - FunctionDefinition (Rule): # 156..181 "\nfunction f() public { }\n" + - FunctionKeyword (Token): "function" # 157..165 + - Identifier (Token): "f" # 166..167 + - ParametersDeclaration (Rule): # 167..169 "()" + - OpenParen (Token): "(" # 167..168 + - CloseParen (Token): ")" # 168..169 + - FunctionAttributesList (Rule): # 169..176 " public" + - PublicKeyword (Token): "public" # 170..176 + - Block (Rule): # 176..181 " { }\n" + - OpenBrace (Token): "{" # 177..178 + - CloseBrace (Token): "}" # 179..180 + - ErrorDefinition (Rule): # 181..200 "\nerror E1(string);\n" + - ErrorKeyword (Token): "error" # 182..187 + - Identifier (Token): "E1" # 188..190 + - OpenParen (Token): "(" # 190..191 + - ErrorParametersList (Rule): # 191..197 "string" + - ErrorParameter (Rule): # 191..197 "string" + - TypeName (Rule): # 191..197 "string" + - StringKeyword (Token): "string" # 191..197 + - CloseParen (Token): ")" # 197..198 + - Semicolon (Token): ";" # 198..199 + - EndOfFileTrivia (Rule): "\n" # 200..201 + - SKIPPED (Token): "type T is bool;\n" # 201..217 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.8.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.8.yml new file mode 100644 index 0000000000..c73ee5b8fd --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.8.yml @@ -0,0 +1,122 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ pragma solidity 0.0.0; │ 0..22 + 2 │ │ 23..23 + 3 │ import "foo.sol"; │ 24..41 + 4 │ │ 42..42 + 5 │ using A for B; │ 43..57 + 6 │ │ 58..58 + 7 │ contract C { } │ 59..73 + 8 │ │ 74..74 + 9 │ interface I { } │ 75..90 + 10 │ │ 91..91 + 11 │ library L { } │ 92..105 + 12 │ │ 106..106 + 13 │ struct S { } │ 107..119 + 14 │ │ 120..120 + 15 │ enum E { } │ 121..131 + 16 │ │ 132..132 + 17 │ uint32 constant x = 0; │ 133..155 + 18 │ │ 156..156 + 19 │ function f() public { } │ 157..180 + 20 │ │ 181..181 + 21 │ error E1(string); │ 182..199 + 22 │ │ 200..200 + 23 │ type T is bool; │ 201..216 + +Errors: [] + +Tree: + - SourceUnit (Rule): # 0..217 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' + - SourceUnitMembersList (Rule): # 0..217 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressionsList (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - PathImport (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - UsingDirective (Rule): # 42..58 "\nusing A for B;\n" + - UsingKeyword (Token): "using" # 43..48 + - UsingDirectivePath (Rule): # 48..50 " A" + - IdentifierPath (Rule): # 48..50 " A" + - Identifier (Token): "A" # 49..50 + - ForKeyword (Token): "for" # 51..54 + - TypeName (Rule): # 54..56 " B" + - IdentifierPath (Rule): # 54..56 " B" + - Identifier (Token): "B" # 55..56 + - Semicolon (Token): ";" # 56..57 + - ContractDefinition (Rule): # 58..74 "\ncontract C { }\n" + - ContractKeyword (Token): "contract" # 59..67 + - Identifier (Token): "C" # 68..69 + - OpenBrace (Token): "{" # 70..71 + - CloseBrace (Token): "}" # 72..73 + - InterfaceDefinition (Rule): # 74..91 "\ninterface I { }\n" + - InterfaceKeyword (Token): "interface" # 75..84 + - Identifier (Token): "I" # 85..86 + - OpenBrace (Token): "{" # 87..88 + - CloseBrace (Token): "}" # 89..90 + - LibraryDefinition (Rule): # 91..106 "\nlibrary L { }\n" + - LibraryKeyword (Token): "library" # 92..99 + - Identifier (Token): "L" # 100..101 + - OpenBrace (Token): "{" # 102..103 + - CloseBrace (Token): "}" # 104..105 + - StructDefinition (Rule): # 106..120 "\nstruct S { }\n" + - StructKeyword (Token): "struct" # 107..113 + - Identifier (Token): "S" # 114..115 + - OpenBrace (Token): "{" # 116..117 + - CloseBrace (Token): "}" # 118..119 + - EnumDefinition (Rule): # 120..132 "\nenum E { }\n" + - EnumKeyword (Token): "enum" # 121..125 + - Identifier (Token): "E" # 126..127 + - OpenBrace (Token): "{" # 128..129 + - CloseBrace (Token): "}" # 130..131 + - ConstantDefinition (Rule): # 132..156 "\nuint32 constant x = 0;\n" + - TypeName (Rule): # 132..139 "\nuint32" + - UnsignedIntegerType (Token): "uint32" # 133..139 + - ConstantKeyword (Token): "constant" # 140..148 + - Identifier (Token): "x" # 149..150 + - Equal (Token): "=" # 151..152 + - Expression (Rule): # 152..154 " 0" + - NumericExpression (Rule): # 152..154 " 0" + - DecimalLiteral (Token): "0" # 153..154 + - Semicolon (Token): ";" # 154..155 + - FunctionDefinition (Rule): # 156..181 "\nfunction f() public { }\n" + - FunctionKeyword (Token): "function" # 157..165 + - Identifier (Token): "f" # 166..167 + - ParametersDeclaration (Rule): # 167..169 "()" + - OpenParen (Token): "(" # 167..168 + - CloseParen (Token): ")" # 168..169 + - FunctionAttributesList (Rule): # 169..176 " public" + - PublicKeyword (Token): "public" # 170..176 + - Block (Rule): # 176..181 " { }\n" + - OpenBrace (Token): "{" # 177..178 + - CloseBrace (Token): "}" # 179..180 + - ErrorDefinition (Rule): # 181..200 "\nerror E1(string);\n" + - ErrorKeyword (Token): "error" # 182..187 + - Identifier (Token): "E1" # 188..190 + - OpenParen (Token): "(" # 190..191 + - ErrorParametersList (Rule): # 191..197 "string" + - ErrorParameter (Rule): # 191..197 "string" + - TypeName (Rule): # 191..197 "string" + - StringKeyword (Token): "string" # 191..197 + - CloseParen (Token): ")" # 197..198 + - Semicolon (Token): ";" # 198..199 + - UserDefinedValueTypeDefinition (Rule): # 200..217 "\ntype T is bool;\n" + - TypeKeyword (Token): "type" # 201..205 + - Identifier (Token): "T" # 206..207 + - IsKeyword (Token): "is" # 208..210 + - BoolKeyword (Token): "bool" # 211..215 + - Semicolon (Token): ";" # 215..216 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol new file mode 100644 index 0000000000..8dc36675b4 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol @@ -0,0 +1,23 @@ +pragma solidity 0.0.0; + +import "foo.sol"; + +using A for B; + +contract C { } + +interface I { } + +library L { } + +struct S { } + +enum E { } + +uint32 constant x = 0; + +function f() public { } + +error E1(string); + +type T is bool; diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/partial_definition/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/partial_definition/generated/0.4.11.yml index 92c0f205a5..f9d6aa0544 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/partial_definition/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/partial_definition/generated/0.4.11.yml @@ -17,12 +17,12 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..56 "contract Sample {\n function..." - - Definition (Rule): # 0..28 "contract Sample {\n function" + - SourceUnitMembersList (Rule): # 0..28 "contract Sample {\n function" - ContractDefinition (Rule): # 0..28 "contract Sample {\n function" - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractBodyElements (Rule): # 18..28 " function" + - ContractMembersList (Rule): # 18..28 " function" - FunctionDefinition (Rule): # 18..28 " function" - FunctionKeyword (Token): "function" # 20..28 - SKIPPED (Token): "" # 28..56 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/trailing_trivia/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/trailing_trivia/generated/0.4.11.yml index 919f369209..48415b2c88 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/trailing_trivia/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/trailing_trivia/generated/0.4.11.yml @@ -14,14 +14,12 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..148 "contract First {}\n\n\n// Newlines both before and af..." - - Definition (Rule): # 0..18 "contract First {}\n" + - SourceUnitMembersList (Rule): # 0..148 "contract First {}\n\n\n// Newlines both before and af..." - ContractDefinition (Rule): # 0..18 "contract First {}\n" - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "First" # 9..14 - OpenBrace (Token): "{" # 15..16 - - ContractBodyElements (Rule): [] # 16..16 - CloseBrace (Token): "}" # 16..17 - - Definition (Rule): # 18..148 "\n\n// Newlines both before and after this comment s..." - ContractDefinition (Rule): # 18..148 "\n\n// Newlines both before and after this comment s..." - LeadingTrivia (Rule): # 18..129 "\n\n// Newlines both before and after this comment s..." - SingleLineComment (Trivia): "// Newlines both before and after this comment sho..." # 20..73 @@ -29,5 +27,4 @@ Tree: - ContractKeyword (Token): "contract" # 129..137 - Identifier (Token): "Second" # 138..144 - OpenBrace (Token): "{" # 145..146 - - ContractBodyElements (Rule): [] # 146..146 - CloseBrace (Token): "}" # 146..147 diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.0.yml b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.0.yml index f9a7a3e1a3..792741d506 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.0.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteType or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1] │ 1 │ throw; diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.3.yml b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.3.yml index 4dfa3d3919..08a3c6493f 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.3.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.3.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteType or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1] │ 1 │ throw; diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.6.0.yml index a77a229a27..9709cb9d10 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.6.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.6.0.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteType or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1] │ 1 │ throw; diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.7.0.yml b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.7.0.yml index e9a89f989d..348a357708 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.7.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.7.0.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteType or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1] │ 1 │ throw; diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.8.0.yml b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.8.0.yml index 970b9b80a2..29a0d7262f 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.8.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.8.0.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UncheckedKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1] │ 1 │ throw; diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.11.yml index bfd19f54aa..ffaa52b49a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.11.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteType or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or ThrowKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or VarKeyword or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or ThrowKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or VarKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/try_catch/input.sol:1:1] │ 1 │ try a.b() {} catch {} diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.21.yml b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.21.yml index d6d45e1496..e862c5c6f1 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.21.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.21.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteType or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or ThrowKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or VarKeyword or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or ThrowKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or VarKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/try_catch/input.sol:1:1] │ 1 │ try a.b() {} catch {} diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.0.yml b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.0.yml index e50189b444..dda3c3f351 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.0.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteType or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/try_catch/input.sol:1:1] │ 1 │ try a.b() {} catch {} diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.3.yml b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.3.yml index 74b687906b..94b8b00d6e 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.3.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.3.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteType or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/try_catch/input.sol:1:1] │ 1 │ try a.b() {} catch {} diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.6.0.yml b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.6.0.yml index db2896809b..6f71905779 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.6.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.6.0.yml @@ -14,20 +14,18 @@ Tree: - Expression (Rule): # 3..7 " a.b" - MemberAccessExpression (Rule): # 3..7 " a.b" - Expression (Rule): # 3..5 " a" - - PrimaryExpression (Rule): # 3..5 " a" - - Identifier (Token): "a" # 4..5 - - MemberAccessOperator (Rule): # 5..7 ".b" - - Period (Token): "." # 5..6 - - Identifier (Token): "b" # 6..7 - - FunctionCallOperator (Rule): # 7..9 "()" - - ArgumentList (Rule): # 7..9 "()" - - OpenParen (Token): "(" # 7..8 - - CloseParen (Token): ")" # 8..9 + - Identifier (Token): "a" # 4..5 + - Period (Token): "." # 5..6 + - Identifier (Token): "b" # 6..7 + - ArgumentsDeclaration (Rule): # 7..9 "()" + - OpenParen (Token): "(" # 7..8 + - CloseParen (Token): ")" # 8..9 - Block (Rule): # 9..12 " {}" - OpenBrace (Token): "{" # 10..11 - CloseBrace (Token): "}" # 11..12 - - CatchClause (Rule): # 12..21 " catch {}" - - CatchKeyword (Token): "catch" # 13..18 - - Block (Rule): # 18..21 " {}" - - OpenBrace (Token): "{" # 19..20 - - CloseBrace (Token): "}" # 20..21 + - CatchClausesList (Rule): # 12..21 " catch {}" + - CatchClause (Rule): # 12..21 " catch {}" + - CatchKeyword (Token): "catch" # 13..18 + - Block (Rule): # 18..21 " {}" + - OpenBrace (Token): "{" # 19..20 + - CloseBrace (Token): "}" # 20..21 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/ignored_members/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/ignored_members/generated/0.4.11.yml index 998c7c80b7..0ff86ba9a6 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/ignored_members/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/ignored_members/generated/0.4.11.yml @@ -8,14 +8,18 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..27 "(, second, , fourth) = rhs;" - OpenParen (Token): "(" # 0..1 - - Comma (Token): "," # 1..2 - - Identifier (Token): "second" # 3..9 - - Comma (Token): "," # 9..10 - - Comma (Token): "," # 11..12 - - Identifier (Token): "fourth" # 13..19 + - TupleMembersList (Rule): # 1..19 ", second, , fourth" + - TupleMember (Rule): [] # 1..1 + - Comma (Token): "," # 1..2 + - TupleMember (Rule): # 2..9 " second" + - Identifier (Token): "second" # 3..9 + - Comma (Token): "," # 9..10 + - TupleMember (Rule): [] # 10..10 + - Comma (Token): "," # 11..12 + - TupleMember (Rule): # 12..19 " fourth" + - Identifier (Token): "fourth" # 13..19 - CloseParen (Token): ")" # 19..20 - Equal (Token): "=" # 21..22 - Expression (Rule): # 22..26 " rhs" - - PrimaryExpression (Rule): # 22..26 " rhs" - - Identifier (Token): "rhs" # 23..26 + - Identifier (Token): "rhs" # 23..26 - Semicolon (Token): ";" # 26..27 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_location/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_location/generated/0.4.11.yml index 423b0d2b64..710b79fc6d 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_location/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_location/generated/0.4.11.yml @@ -8,14 +8,15 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..47 "(memory with_location, without_location) = rhs;" - OpenParen (Token): "(" # 0..1 - - DataLocation (Rule): # 1..7 "memory" - - MemoryKeyword (Token): "memory" # 1..7 - - Identifier (Token): "with_location" # 8..21 - - Comma (Token): "," # 21..22 - - Identifier (Token): "without_location" # 23..39 + - TupleMembersList (Rule): # 1..39 "memory with_location, without_location" + - TupleMember (Rule): # 1..21 "memory with_location" + - MemoryKeyword (Token): "memory" # 1..7 + - Identifier (Token): "with_location" # 8..21 + - Comma (Token): "," # 21..22 + - TupleMember (Rule): # 22..39 " without_location" + - Identifier (Token): "without_location" # 23..39 - CloseParen (Token): ")" # 39..40 - Equal (Token): "=" # 41..42 - Expression (Rule): # 42..46 " rhs" - - PrimaryExpression (Rule): # 42..46 " rhs" - - Identifier (Token): "rhs" # 43..46 + - Identifier (Token): "rhs" # 43..46 - Semicolon (Token): ";" # 46..47 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type/generated/0.4.11.yml index ce689ac39a..1d0e120d45 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type/generated/0.4.11.yml @@ -8,15 +8,16 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..37 "(bool with_type, without_type) = rhs;" - OpenParen (Token): "(" # 0..1 - - TypeName (Rule): # 1..5 "bool" - - ElementaryType (Rule): # 1..5 "bool" - - BoolKeyword (Token): "bool" # 1..5 - - Identifier (Token): "with_type" # 6..15 - - Comma (Token): "," # 15..16 - - Identifier (Token): "without_type" # 17..29 + - TupleMembersList (Rule): # 1..29 "bool with_type, without_type" + - TupleMember (Rule): # 1..15 "bool with_type" + - TypeName (Rule): # 1..5 "bool" + - BoolKeyword (Token): "bool" # 1..5 + - Identifier (Token): "with_type" # 6..15 + - Comma (Token): "," # 15..16 + - TupleMember (Rule): # 16..29 " without_type" + - Identifier (Token): "without_type" # 17..29 - CloseParen (Token): ")" # 29..30 - Equal (Token): "=" # 31..32 - Expression (Rule): # 32..36 " rhs" - - PrimaryExpression (Rule): # 32..36 " rhs" - - Identifier (Token): "rhs" # 33..36 + - Identifier (Token): "rhs" # 33..36 - Semicolon (Token): ";" # 36..37 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type_and_location/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type_and_location/generated/0.4.11.yml index c414539a4d..475926b369 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type_and_location/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type_and_location/generated/0.4.11.yml @@ -8,22 +8,20 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..38 "(bool memory x, bool storage y) = rhs;" - OpenParen (Token): "(" # 0..1 - - TypeName (Rule): # 1..5 "bool" - - ElementaryType (Rule): # 1..5 "bool" - - BoolKeyword (Token): "bool" # 1..5 - - DataLocation (Rule): # 5..12 " memory" - - MemoryKeyword (Token): "memory" # 6..12 - - Identifier (Token): "x" # 13..14 - - Comma (Token): "," # 14..15 - - TypeName (Rule): # 15..20 " bool" - - ElementaryType (Rule): # 15..20 " bool" - - BoolKeyword (Token): "bool" # 16..20 - - DataLocation (Rule): # 20..28 " storage" - - StorageKeyword (Token): "storage" # 21..28 - - Identifier (Token): "y" # 29..30 + - TupleMembersList (Rule): # 1..30 "bool memory x, bool storage y" + - TupleMember (Rule): # 1..14 "bool memory x" + - TypeName (Rule): # 1..5 "bool" + - BoolKeyword (Token): "bool" # 1..5 + - MemoryKeyword (Token): "memory" # 6..12 + - Identifier (Token): "x" # 13..14 + - Comma (Token): "," # 14..15 + - TupleMember (Rule): # 15..30 " bool storage y" + - TypeName (Rule): # 15..20 " bool" + - BoolKeyword (Token): "bool" # 16..20 + - StorageKeyword (Token): "storage" # 21..28 + - Identifier (Token): "y" # 29..30 - CloseParen (Token): ")" # 30..31 - Equal (Token): "=" # 32..33 - Expression (Rule): # 33..37 " rhs" - - PrimaryExpression (Rule): # 33..37 " rhs" - - Identifier (Token): "rhs" # 34..37 + - Identifier (Token): "rhs" # 34..37 - Semicolon (Token): ";" # 37..38 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleExpression/empty/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/TupleExpression/empty/generated/0.4.11.yml index 573e1f70c4..a03a765449 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleExpression/empty/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleExpression/empty/generated/0.4.11.yml @@ -8,4 +8,5 @@ Errors: [] Tree: - TupleExpression (Rule): # 0..3 "( )" - OpenParen (Token): "(" # 0..1 + - TupleValuesList (Rule): [] # 1..1 - CloseParen (Token): ")" # 2..3 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleExpression/full/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/TupleExpression/full/generated/0.4.11.yml index 6c2e46445a..98b6f7f194 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleExpression/full/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleExpression/full/generated/0.4.11.yml @@ -8,19 +8,16 @@ Errors: [] Tree: - TupleExpression (Rule): # 0..30 "(first, second, third, fourth)" - OpenParen (Token): "(" # 0..1 - - Expression (Rule): # 1..6 "first" - - PrimaryExpression (Rule): # 1..6 "first" + - TupleValuesList (Rule): # 1..29 "first, second, third, fourth" + - Expression (Rule): # 1..6 "first" - Identifier (Token): "first" # 1..6 - - Comma (Token): "," # 6..7 - - Expression (Rule): # 7..14 " second" - - PrimaryExpression (Rule): # 7..14 " second" + - Comma (Token): "," # 6..7 + - Expression (Rule): # 7..14 " second" - Identifier (Token): "second" # 8..14 - - Comma (Token): "," # 14..15 - - Expression (Rule): # 15..21 " third" - - PrimaryExpression (Rule): # 15..21 " third" + - Comma (Token): "," # 14..15 + - Expression (Rule): # 15..21 " third" - Identifier (Token): "third" # 16..21 - - Comma (Token): "," # 21..22 - - Expression (Rule): # 22..29 " fourth" - - PrimaryExpression (Rule): # 22..29 " fourth" + - Comma (Token): "," # 21..22 + - Expression (Rule): # 22..29 " fourth" - Identifier (Token): "fourth" # 23..29 - CloseParen (Token): ")" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleExpression/missing_elements/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/TupleExpression/missing_elements/generated/0.4.11.yml index 8a29379ce1..dc78569463 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleExpression/missing_elements/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleExpression/missing_elements/generated/0.4.11.yml @@ -8,13 +8,12 @@ Errors: [] Tree: - TupleExpression (Rule): # 0..20 "(, second, , fourth)" - OpenParen (Token): "(" # 0..1 - - Comma (Token): "," # 1..2 - - Expression (Rule): # 2..9 " second" - - PrimaryExpression (Rule): # 2..9 " second" + - TupleValuesList (Rule): # 1..19 ", second, , fourth" + - Comma (Token): "," # 1..2 + - Expression (Rule): # 2..9 " second" - Identifier (Token): "second" # 3..9 - - Comma (Token): "," # 9..10 - - Comma (Token): "," # 11..12 - - Expression (Rule): # 12..19 " fourth" - - PrimaryExpression (Rule): # 12..19 " fourth" + - Comma (Token): "," # 9..10 + - Comma (Token): "," # 11..12 + - Expression (Rule): # 12..19 " fourth" - Identifier (Token): "fourth" # 13..19 - CloseParen (Token): ")" # 19..20 diff --git a/crates/solidity/testing/snapshots/cst_output/StringExpression/unicode_multiple/generated/0.7.0.yml b/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiteralsList/multiple/generated/0.7.0.yml similarity index 80% rename from crates/solidity/testing/snapshots/cst_output/StringExpression/unicode_multiple/generated/0.7.0.yml rename to crates/solidity/testing/snapshots/cst_output/UnicodeStringLiteralsList/multiple/generated/0.7.0.yml index 693a94b734..45e1271367 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringExpression/unicode_multiple/generated/0.7.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiteralsList/multiple/generated/0.7.0.yml @@ -6,6 +6,6 @@ Source: > Errors: [] Tree: - - StringExpression (Rule): # 0..37 'unicode"happy 😃" unicode''sad 😔''' + - UnicodeStringLiteralsList (Rule): # 0..37 'unicode"happy 😃" unicode''sad 😔''' - UnicodeStringLiteral (Token): 'unicode"happy 😃"' # 0..19 - UnicodeStringLiteral (Token): "unicode'sad 😔'" # 20..37 diff --git a/crates/solidity/testing/snapshots/cst_output/StringExpression/unicode_multiple/input.sol b/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiteralsList/multiple/input.sol similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/StringExpression/unicode_multiple/input.sol rename to crates/solidity/testing/snapshots/cst_output/UnicodeStringLiteralsList/multiple/input.sol diff --git a/crates/solidity/testing/snapshots/cst_output/StringExpression/unicode_single/generated/0.7.0.yml b/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiteralsList/single/generated/0.7.0.yml similarity index 81% rename from crates/solidity/testing/snapshots/cst_output/StringExpression/unicode_single/generated/0.7.0.yml rename to crates/solidity/testing/snapshots/cst_output/UnicodeStringLiteralsList/single/generated/0.7.0.yml index 1ac5c6551a..ae2c40bf3c 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringExpression/unicode_single/generated/0.7.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiteralsList/single/generated/0.7.0.yml @@ -6,5 +6,5 @@ Source: > Errors: [] Tree: - - StringExpression (Rule): # 0..19 'unicode"emoji 😃"' + - UnicodeStringLiteralsList (Rule): # 0..19 'unicode"emoji 😃"' - UnicodeStringLiteral (Token): 'unicode"emoji 😃"' # 0..19 diff --git a/crates/solidity/testing/snapshots/cst_output/StringExpression/unicode_single/input.sol b/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiteralsList/single/input.sol similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/StringExpression/unicode_single/input.sol rename to crates/solidity/testing/snapshots/cst_output/UnicodeStringLiteralsList/single/input.sol diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.4.11.yml new file mode 100644 index 0000000000..043df9dd7c --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.4.11.yml @@ -0,0 +1,25 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ using {add as +, sub, mul, div as /} for Int global; │ 0..52 + +Errors: # 1 total + - > + Error: Expected CloseBrace or Comma or Period. + ╭─[crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/input.sol:1:11] + │ + 1 │ using {add as +, sub, mul, div as /} for Int global; + │ ─────────────────────┬──────────────────── + │ ╰────────────────────── Error occurred here. + ───╯ + +Tree: + - UsingDirective (Rule): # 0..52 "using {add as +, sub, mul, div as /} for Int globa..." + - UsingKeyword (Token): "using" # 0..5 + - UsingDirectiveDeconstruction (Rule): # 5..10 " {add" + - OpenBrace (Token): "{" # 6..7 + - UsingDirectiveSymbolsList (Rule): # 7..10 "add" + - UsingDirectiveSymbol (Rule): # 7..10 "add" + - IdentifierPath (Rule): # 7..10 "add" + - Identifier (Token): "add" # 7..10 + - SKIPPED (Token): " as +, sub, mul, div as /} for Int global;" # 10..52 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.19.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.19.yml new file mode 100644 index 0000000000..a6848a9387 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.19.yml @@ -0,0 +1,40 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ using {add as +, sub, mul, div as /} for Int global; │ 0..52 + +Errors: # 1 total + - > + Error: Expected Ampersand or Asterisk or BangEqual or Bar or Caret or EqualEqual or GreaterThan or GreaterThanEqual or LessThan or LessThanEqual or Minus or Percent or Plus or Slash or Tilde. + ╭─[crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/input.sol:1:34] + │ + 1 │ using {add as +, sub, mul, div as /} for Int global; + │ ─────────┬───────── + │ ╰─────────── Error occurred here. + ───╯ + +Tree: + - UsingDirective (Rule): # 0..52 "using {add as +, sub, mul, div as /} for Int globa..." + - UsingKeyword (Token): "using" # 0..5 + - UsingDirectiveDeconstruction (Rule): # 5..33 " {add as +, sub, mul, div as" + - OpenBrace (Token): "{" # 6..7 + - UsingDirectiveSymbolsList (Rule): # 7..33 "add as +, sub, mul, div as" + - UsingDirectiveSymbol (Rule): # 7..15 "add as +" + - IdentifierPath (Rule): # 7..10 "add" + - Identifier (Token): "add" # 7..10 + - AsKeyword (Token): "as" # 11..13 + - Plus (Token): "+" # 14..15 + - Comma (Token): "," # 15..16 + - UsingDirectiveSymbol (Rule): # 16..20 " sub" + - IdentifierPath (Rule): # 16..20 " sub" + - Identifier (Token): "sub" # 17..20 + - Comma (Token): "," # 20..21 + - UsingDirectiveSymbol (Rule): # 21..25 " mul" + - IdentifierPath (Rule): # 21..25 " mul" + - Identifier (Token): "mul" # 22..25 + - Comma (Token): "," # 25..26 + - UsingDirectiveSymbol (Rule): # 26..33 " div as" + - IdentifierPath (Rule): # 26..30 " div" + - Identifier (Token): "div" # 27..30 + - AsKeyword (Token): "as" # 31..33 + - SKIPPED (Token): " /} for Int global;" # 33..52 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/input.sol b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/input.sol new file mode 100644 index 0000000000..1034116a8b --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/input.sol @@ -0,0 +1 @@ +using {add as +, sub, mul, div as /} for Int global; \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.4.11.yml new file mode 100644 index 0000000000..c56e4f7774 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.4.11.yml @@ -0,0 +1,23 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ using {add} for Int global; │ 0..27 + +Errors: [] + +Tree: + - UsingDirective (Rule): # 0..27 "using {add} for Int global;" + - UsingKeyword (Token): "using" # 0..5 + - UsingDirectiveDeconstruction (Rule): # 5..11 " {add}" + - OpenBrace (Token): "{" # 6..7 + - UsingDirectiveSymbolsList (Rule): # 7..10 "add" + - UsingDirectiveSymbol (Rule): # 7..10 "add" + - IdentifierPath (Rule): # 7..10 "add" + - Identifier (Token): "add" # 7..10 + - CloseBrace (Token): "}" # 10..11 + - ForKeyword (Token): "for" # 12..15 + - TypeName (Rule): # 15..19 " Int" + - IdentifierPath (Rule): # 15..19 " Int" + - Identifier (Token): "Int" # 16..19 + - GlobalKeyword (Token): "global" # 20..26 + - Semicolon (Token): ";" # 26..27 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/input.sol b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/input.sol new file mode 100644 index 0000000000..9e8b2b3a36 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/input.sol @@ -0,0 +1 @@ +using {add} for Int global; \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.4.11.yml new file mode 100644 index 0000000000..2bfac291a4 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.4.11.yml @@ -0,0 +1,19 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ using foo for bar global; │ 0..25 + +Errors: [] + +Tree: + - UsingDirective (Rule): # 0..25 "using foo for bar global;" + - UsingKeyword (Token): "using" # 0..5 + - UsingDirectivePath (Rule): # 5..9 " foo" + - IdentifierPath (Rule): # 5..9 " foo" + - Identifier (Token): "foo" # 6..9 + - ForKeyword (Token): "for" # 10..13 + - TypeName (Rule): # 13..17 " bar" + - IdentifierPath (Rule): # 13..17 " bar" + - Identifier (Token): "bar" # 14..17 + - GlobalKeyword (Token): "global" # 18..24 + - Semicolon (Token): ";" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/input.sol b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/input.sol new file mode 100644 index 0000000000..7123fd9d2a --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/input.sol @@ -0,0 +1 @@ +using foo for bar global; \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/generated/0.4.11.yml new file mode 100644 index 0000000000..c94ba36a51 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/generated/0.4.11.yml @@ -0,0 +1,16 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ using foo for *; │ 0..16 + +Errors: [] + +Tree: + - UsingDirective (Rule): # 0..16 "using foo for *;" + - UsingKeyword (Token): "using" # 0..5 + - UsingDirectivePath (Rule): # 5..9 " foo" + - IdentifierPath (Rule): # 5..9 " foo" + - Identifier (Token): "foo" # 6..9 + - ForKeyword (Token): "for" # 10..13 + - Asterisk (Token): "*" # 14..15 + - Semicolon (Token): ";" # 15..16 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/input.sol b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/input.sol new file mode 100644 index 0000000000..54896e70f7 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/input.sol @@ -0,0 +1 @@ +using foo for *; \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.4.11.yml deleted file mode 100644 index 11ee60ee24..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.4.11.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ using {add as +} for Int global; │ 0..32 - -Errors: # 1 total - - > - Error: Expected CloseBrace or Comma or Period. - ╭─[crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/input.sol:1:11] - │ - 1 │ using {add as +} for Int global; - │ ───────────┬────────── - │ ╰──────────── Error occurred here. - ───╯ - -Tree: - - UsingDirective (Rule): # 0..32 "using {add as +} for Int global;" - - UsingKeyword (Token): "using" # 0..5 - - OpenBrace (Token): "{" # 6..7 - - IdentifierPath (Rule): # 7..10 "add" - - Identifier (Token): "add" # 7..10 - - SKIPPED (Token): " as +} for Int global;" # 10..32 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.19.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.19.yml deleted file mode 100644 index cd6c293f5f..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.19.yml +++ /dev/null @@ -1,23 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ using {add as +} for Int global; │ 0..32 - -Errors: [] - -Tree: - - UsingDirective (Rule): # 0..32 "using {add as +} for Int global;" - - UsingKeyword (Token): "using" # 0..5 - - OpenBrace (Token): "{" # 6..7 - - IdentifierPath (Rule): # 7..10 "add" - - Identifier (Token): "add" # 7..10 - - AsKeyword (Token): "as" # 11..13 - - UserDefinedOperator (Rule): # 13..15 " +" - - Plus (Token): "+" # 14..15 - - CloseBrace (Token): "}" # 15..16 - - ForKeyword (Token): "for" # 17..20 - - TypeName (Rule): # 20..24 " Int" - - IdentifierPath (Rule): # 20..24 " Int" - - Identifier (Token): "Int" # 21..24 - - GlobalKeyword (Token): "global" # 25..31 - - Semicolon (Token): ";" # 31..32 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/input.sol b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/input.sol deleted file mode 100644 index 3844bd4a32..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/input.sol +++ /dev/null @@ -1 +0,0 @@ -using {add as +} for Int global; \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path/generated/0.4.11.yml new file mode 100644 index 0000000000..745640ecda --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path/generated/0.4.11.yml @@ -0,0 +1,13 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ foo.bar │ 0..7 + +Errors: [] + +Tree: + - UsingDirectiveSymbol (Rule): # 0..7 "foo.bar" + - IdentifierPath (Rule): # 0..7 "foo.bar" + - Identifier (Token): "foo" # 0..3 + - Period (Token): "." # 3..4 + - Identifier (Token): "bar" # 4..7 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path/input.sol b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path/input.sol new file mode 100644 index 0000000000..4d5f9756e5 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path/input.sol @@ -0,0 +1 @@ +foo.bar \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.4.11.yml new file mode 100644 index 0000000000..acafdfb3ec --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.4.11.yml @@ -0,0 +1,22 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ foo.bar as / │ 0..12 + +Errors: # 1 total + - > + Error: Expected Period. + ╭─[crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/input.sol:1:8] + │ + 1 │ foo.bar as / + │ ──┬── + │ ╰──── Error occurred here. + ───╯ + +Tree: + - UsingDirectiveSymbol (Rule): # 0..12 "foo.bar as /" + - IdentifierPath (Rule): # 0..7 "foo.bar" + - Identifier (Token): "foo" # 0..3 + - Period (Token): "." # 3..4 + - Identifier (Token): "bar" # 4..7 + - SKIPPED (Token): " as /" # 7..12 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.8.19.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.8.19.yml new file mode 100644 index 0000000000..1f0b765d51 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.8.19.yml @@ -0,0 +1,23 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ foo.bar as / │ 0..12 + +Errors: # 1 total + - > + Error: Expected Ampersand or Asterisk or BangEqual or Bar or Caret or EqualEqual or GreaterThan or GreaterThanEqual or LessThan or LessThanEqual or Minus or Percent or Plus or Slash or Tilde. + ╭─[crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/input.sol:1:11] + │ + 1 │ foo.bar as / + │ ─┬ + │ ╰── Error occurred here. + ───╯ + +Tree: + - UsingDirectiveSymbol (Rule): # 0..12 "foo.bar as /" + - IdentifierPath (Rule): # 0..7 "foo.bar" + - Identifier (Token): "foo" # 0..3 + - Period (Token): "." # 3..4 + - Identifier (Token): "bar" # 4..7 + - AsKeyword (Token): "as" # 8..10 + - SKIPPED (Token): " /" # 10..12 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/input.sol b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/input.sol new file mode 100644 index 0000000000..e09121b626 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/input.sol @@ -0,0 +1 @@ +foo.bar as / \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id/generated/0.4.11.yml new file mode 100644 index 0000000000..d24406c40d --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id/generated/0.4.11.yml @@ -0,0 +1,11 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ foo │ 0..3 + +Errors: [] + +Tree: + - UsingDirectiveSymbol (Rule): # 0..3 "foo" + - IdentifierPath (Rule): # 0..3 "foo" + - Identifier (Token): "foo" # 0..3 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id/input.sol b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id/input.sol new file mode 100644 index 0000000000..1910281566 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id/input.sol @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.4.11.yml new file mode 100644 index 0000000000..8e056c58c5 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.4.11.yml @@ -0,0 +1,20 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ foo as / │ 0..8 + +Errors: # 1 total + - > + Error: Expected Period. + ╭─[crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/input.sol:1:4] + │ + 1 │ foo as / + │ ──┬── + │ ╰──── Error occurred here. + ───╯ + +Tree: + - UsingDirectiveSymbol (Rule): # 0..8 "foo as /" + - IdentifierPath (Rule): # 0..3 "foo" + - Identifier (Token): "foo" # 0..3 + - SKIPPED (Token): " as /" # 3..8 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.8.19.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.8.19.yml new file mode 100644 index 0000000000..96518f4f2e --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.8.19.yml @@ -0,0 +1,21 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ foo as / │ 0..8 + +Errors: # 1 total + - > + Error: Expected Ampersand or Asterisk or BangEqual or Bar or Caret or EqualEqual or GreaterThan or GreaterThanEqual or LessThan or LessThanEqual or Minus or Percent or Plus or Slash or Tilde. + ╭─[crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/input.sol:1:7] + │ + 1 │ foo as / + │ ─┬ + │ ╰── Error occurred here. + ───╯ + +Tree: + - UsingDirectiveSymbol (Rule): # 0..8 "foo as /" + - IdentifierPath (Rule): # 0..3 "foo" + - Identifier (Token): "foo" # 0..3 + - AsKeyword (Token): "as" # 4..6 + - SKIPPED (Token): " /" # 6..8 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/input.sol b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/input.sol new file mode 100644 index 0000000000..d702feb464 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/input.sol @@ -0,0 +1 @@ +foo as / \ No newline at end of file diff --git a/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.4.11.yml index 7566a1c9b7..8df297a50b 100644 --- a/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.4.11.yml @@ -7,11 +7,11 @@ Errors: [] Tree: - VariableDeclarationStatement (Rule): # 0..10 "var z = 0;" - - VarKeyword (Token): "var" # 0..3 - - Identifier (Token): "z" # 4..5 + - VariableDeclaration (Rule): # 0..5 "var z" + - VarKeyword (Token): "var" # 0..3 + - Identifier (Token): "z" # 4..5 - Equal (Token): "=" # 6..7 - Expression (Rule): # 7..9 " 0" - - PrimaryExpression (Rule): # 7..9 " 0" - - NumericExpression (Rule): # 7..9 " 0" - - DecimalLiteral (Token): "0" # 8..9 + - NumericExpression (Rule): # 7..9 " 0" + - DecimalLiteral (Token): "0" # 8..9 - Semicolon (Token): ";" # 9..10 diff --git a/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.5.0.yml b/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.5.0.yml index 3cbca28f84..35871716b9 100644 --- a/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.5.0.yml +++ b/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.5.0.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or ByteType or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or UnsignedFixedType or UnsignedIntegerType. ╭─[crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/input.sol:1:1] │ 1 │ var z = 0; diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/alternatives/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/alternatives/generated/0.4.11.yml index a756be6f38..df9669607c 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/alternatives/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/alternatives/generated/0.4.11.yml @@ -8,28 +8,34 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..33 "solidity 0.5.0 || 0.6.0 || ^0.7.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionList (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" - - VersionPragmaAlternatives (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" - - VersionPragmaAlternatives (Rule): # 8..23 " 0.5.0 || 0.6.0" - - VersionPragmaSpecifier (Rule): # 8..14 " 0.5.0" - - VersionPragmaValue (Token): "0" # 9..10 - - Period (Token): "." # 10..11 - - VersionPragmaValue (Token): "5" # 11..12 - - Period (Token): "." # 12..13 - - VersionPragmaValue (Token): "0" # 13..14 - - BarBar (Token): "||" # 15..17 - - VersionPragmaSpecifier (Rule): # 17..23 " 0.6.0" - - VersionPragmaValue (Token): "0" # 18..19 - - Period (Token): "." # 19..20 - - VersionPragmaValue (Token): "6" # 20..21 - - Period (Token): "." # 21..22 - - VersionPragmaValue (Token): "0" # 22..23 - - BarBar (Token): "||" # 24..26 - - VersionPragmaComparator (Rule): # 26..33 " ^0.7.0" - - Caret (Token): "^" # 27..28 - - VersionPragmaSpecifier (Rule): # 28..33 "0.7.0" - - VersionPragmaValue (Token): "0" # 28..29 - - Period (Token): "." # 29..30 - - VersionPragmaValue (Token): "7" # 30..31 - - Period (Token): "." # 31..32 - - VersionPragmaValue (Token): "0" # 32..33 + - VersionPragmaExpressionsList (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" + - VersionPragmaExpression (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" + - VersionPragmaBinaryExpression (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" + - VersionPragmaExpression (Rule): # 8..23 " 0.5.0 || 0.6.0" + - VersionPragmaBinaryExpression (Rule): # 8..23 " 0.5.0 || 0.6.0" + - VersionPragmaExpression (Rule): # 8..14 " 0.5.0" + - VersionPragmaSpecifier (Rule): # 8..14 " 0.5.0" + - VersionPragmaValue (Token): "0" # 9..10 + - Period (Token): "." # 10..11 + - VersionPragmaValue (Token): "5" # 11..12 + - Period (Token): "." # 12..13 + - VersionPragmaValue (Token): "0" # 13..14 + - BarBar (Token): "||" # 15..17 + - VersionPragmaExpression (Rule): # 17..23 " 0.6.0" + - VersionPragmaSpecifier (Rule): # 17..23 " 0.6.0" + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "6" # 20..21 + - Period (Token): "." # 21..22 + - VersionPragmaValue (Token): "0" # 22..23 + - BarBar (Token): "||" # 24..26 + - VersionPragmaExpression (Rule): # 26..33 " ^0.7.0" + - VersionPragmaUnaryExpression (Rule): # 26..33 " ^0.7.0" + - Caret (Token): "^" # 27..28 + - VersionPragmaExpression (Rule): # 28..33 "0.7.0" + - VersionPragmaSpecifier (Rule): # 28..33 "0.7.0" + - VersionPragmaValue (Token): "0" # 28..29 + - Period (Token): "." # 29..30 + - VersionPragmaValue (Token): "7" # 30..31 + - Period (Token): "." # 31..32 + - VersionPragmaValue (Token): "0" # 32..33 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/equal_operator/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/equal_operator/generated/0.4.11.yml index 1d0e7690c9..7ea4b46a33 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/equal_operator/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/equal_operator/generated/0.4.11.yml @@ -8,12 +8,14 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..15 "solidity =0.8.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionList (Rule): # 8..15 " =0.8.0" - - VersionPragmaComparator (Rule): # 8..15 " =0.8.0" - - Equal (Token): "=" # 9..10 - - VersionPragmaSpecifier (Rule): # 10..15 "0.8.0" - - VersionPragmaValue (Token): "0" # 10..11 - - Period (Token): "." # 11..12 - - VersionPragmaValue (Token): "8" # 12..13 - - Period (Token): "." # 13..14 - - VersionPragmaValue (Token): "0" # 14..15 + - VersionPragmaExpressionsList (Rule): # 8..15 " =0.8.0" + - VersionPragmaExpression (Rule): # 8..15 " =0.8.0" + - VersionPragmaUnaryExpression (Rule): # 8..15 " =0.8.0" + - Equal (Token): "=" # 9..10 + - VersionPragmaExpression (Rule): # 10..15 "0.8.0" + - VersionPragmaSpecifier (Rule): # 10..15 "0.8.0" + - VersionPragmaValue (Token): "0" # 10..11 + - Period (Token): "." # 11..12 + - VersionPragmaValue (Token): "8" # 12..13 + - Period (Token): "." # 13..14 + - VersionPragmaValue (Token): "0" # 14..15 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/exact_version/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/exact_version/generated/0.4.11.yml index e6925af5dc..3c3c7a0984 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/exact_version/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/exact_version/generated/0.4.11.yml @@ -8,10 +8,11 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..14 "solidity 0.8.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionList (Rule): # 8..14 " 0.8.0" - - VersionPragmaSpecifier (Rule): # 8..14 " 0.8.0" - - VersionPragmaValue (Token): "0" # 9..10 - - Period (Token): "." # 10..11 - - VersionPragmaValue (Token): "8" # 11..12 - - Period (Token): "." # 12..13 - - VersionPragmaValue (Token): "0" # 13..14 + - VersionPragmaExpressionsList (Rule): # 8..14 " 0.8.0" + - VersionPragmaExpression (Rule): # 8..14 " 0.8.0" + - VersionPragmaSpecifier (Rule): # 8..14 " 0.8.0" + - VersionPragmaValue (Token): "0" # 9..10 + - Period (Token): "." # 10..11 + - VersionPragmaValue (Token): "8" # 11..12 + - Period (Token): "." # 12..13 + - VersionPragmaValue (Token): "0" # 13..14 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/less_than_operator/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/less_than_operator/generated/0.4.11.yml index 5ffb04dfed..ddc5c10fac 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/less_than_operator/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/less_than_operator/generated/0.4.11.yml @@ -8,12 +8,14 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..15 "solidity <1.0.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionList (Rule): # 8..15 " <1.0.0" - - VersionPragmaComparator (Rule): # 8..15 " <1.0.0" - - LessThan (Token): "<" # 9..10 - - VersionPragmaSpecifier (Rule): # 10..15 "1.0.0" - - VersionPragmaValue (Token): "1" # 10..11 - - Period (Token): "." # 11..12 - - VersionPragmaValue (Token): "0" # 12..13 - - Period (Token): "." # 13..14 - - VersionPragmaValue (Token): "0" # 14..15 + - VersionPragmaExpressionsList (Rule): # 8..15 " <1.0.0" + - VersionPragmaExpression (Rule): # 8..15 " <1.0.0" + - VersionPragmaUnaryExpression (Rule): # 8..15 " <1.0.0" + - LessThan (Token): "<" # 9..10 + - VersionPragmaExpression (Rule): # 10..15 "1.0.0" + - VersionPragmaSpecifier (Rule): # 10..15 "1.0.0" + - VersionPragmaValue (Token): "1" # 10..11 + - Period (Token): "." # 11..12 + - VersionPragmaValue (Token): "0" # 12..13 + - Period (Token): "." # 13..14 + - VersionPragmaValue (Token): "0" # 14..15 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/multiple_exact_versions/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/multiple_exact_versions/generated/0.4.11.yml index 4e144da5fa..942d923267 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/multiple_exact_versions/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/multiple_exact_versions/generated/0.4.11.yml @@ -8,16 +8,18 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..20 "solidity 0.7.0 0.8.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionList (Rule): # 8..20 " 0.7.0 0.8.0" - - VersionPragmaSpecifier (Rule): # 8..14 " 0.7.0" - - VersionPragmaValue (Token): "0" # 9..10 - - Period (Token): "." # 10..11 - - VersionPragmaValue (Token): "7" # 11..12 - - Period (Token): "." # 12..13 - - VersionPragmaValue (Token): "0" # 13..14 - - VersionPragmaSpecifier (Rule): # 14..20 " 0.8.0" - - VersionPragmaValue (Token): "0" # 15..16 - - Period (Token): "." # 16..17 - - VersionPragmaValue (Token): "8" # 17..18 - - Period (Token): "." # 18..19 - - VersionPragmaValue (Token): "0" # 19..20 + - VersionPragmaExpressionsList (Rule): # 8..20 " 0.7.0 0.8.0" + - VersionPragmaExpression (Rule): # 8..14 " 0.7.0" + - VersionPragmaSpecifier (Rule): # 8..14 " 0.7.0" + - VersionPragmaValue (Token): "0" # 9..10 + - Period (Token): "." # 10..11 + - VersionPragmaValue (Token): "7" # 11..12 + - Period (Token): "." # 12..13 + - VersionPragmaValue (Token): "0" # 13..14 + - VersionPragmaExpression (Rule): # 14..20 " 0.8.0" + - VersionPragmaSpecifier (Rule): # 14..20 " 0.8.0" + - VersionPragmaValue (Token): "0" # 15..16 + - Period (Token): "." # 16..17 + - VersionPragmaValue (Token): "8" # 17..18 + - Period (Token): "." # 18..19 + - VersionPragmaValue (Token): "0" # 19..20 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/nested_expressions/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/nested_expressions/generated/0.4.11.yml index f95cf58578..22340701ee 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/nested_expressions/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/nested_expressions/generated/0.4.11.yml @@ -8,28 +8,34 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..30 "solidity ^1.0.0 || 2.0.0-3.0.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionList (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" - - VersionPragmaAlternatives (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" - - VersionPragmaComparator (Rule): # 8..15 " ^1.0.0" - - Caret (Token): "^" # 9..10 - - VersionPragmaSpecifier (Rule): # 10..15 "1.0.0" - - VersionPragmaValue (Token): "1" # 10..11 - - Period (Token): "." # 11..12 - - VersionPragmaValue (Token): "0" # 12..13 - - Period (Token): "." # 13..14 - - VersionPragmaValue (Token): "0" # 14..15 - - BarBar (Token): "||" # 16..18 - - VersionPragmaRange (Rule): # 18..30 " 2.0.0-3.0.0" - - VersionPragmaSpecifier (Rule): # 18..24 " 2.0.0" - - VersionPragmaValue (Token): "2" # 19..20 - - Period (Token): "." # 20..21 - - VersionPragmaValue (Token): "0" # 21..22 - - Period (Token): "." # 22..23 - - VersionPragmaValue (Token): "0" # 23..24 - - Minus (Token): "-" # 24..25 - - VersionPragmaSpecifier (Rule): # 25..30 "3.0.0" - - VersionPragmaValue (Token): "3" # 25..26 - - Period (Token): "." # 26..27 - - VersionPragmaValue (Token): "0" # 27..28 - - Period (Token): "." # 28..29 - - VersionPragmaValue (Token): "0" # 29..30 + - VersionPragmaExpressionsList (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" + - VersionPragmaExpression (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" + - VersionPragmaBinaryExpression (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" + - VersionPragmaExpression (Rule): # 8..15 " ^1.0.0" + - VersionPragmaUnaryExpression (Rule): # 8..15 " ^1.0.0" + - Caret (Token): "^" # 9..10 + - VersionPragmaExpression (Rule): # 10..15 "1.0.0" + - VersionPragmaSpecifier (Rule): # 10..15 "1.0.0" + - VersionPragmaValue (Token): "1" # 10..11 + - Period (Token): "." # 11..12 + - VersionPragmaValue (Token): "0" # 12..13 + - Period (Token): "." # 13..14 + - VersionPragmaValue (Token): "0" # 14..15 + - BarBar (Token): "||" # 16..18 + - VersionPragmaExpression (Rule): # 18..30 " 2.0.0-3.0.0" + - VersionPragmaBinaryExpression (Rule): # 18..30 " 2.0.0-3.0.0" + - VersionPragmaExpression (Rule): # 18..24 " 2.0.0" + - VersionPragmaSpecifier (Rule): # 18..24 " 2.0.0" + - VersionPragmaValue (Token): "2" # 19..20 + - Period (Token): "." # 20..21 + - VersionPragmaValue (Token): "0" # 21..22 + - Period (Token): "." # 22..23 + - VersionPragmaValue (Token): "0" # 23..24 + - Minus (Token): "-" # 24..25 + - VersionPragmaExpression (Rule): # 25..30 "3.0.0" + - VersionPragmaSpecifier (Rule): # 25..30 "3.0.0" + - VersionPragmaValue (Token): "3" # 25..26 + - Period (Token): "." # 26..27 + - VersionPragmaValue (Token): "0" # 27..28 + - Period (Token): "." # 28..29 + - VersionPragmaValue (Token): "0" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/ranges/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/ranges/generated/0.4.11.yml index 920f0eb7e7..41f1d30a10 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/ranges/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/ranges/generated/0.4.11.yml @@ -8,18 +8,21 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..22 "solidity 0.6.0 - 0.7.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionList (Rule): # 8..22 " 0.6.0 - 0.7.0" - - VersionPragmaRange (Rule): # 8..22 " 0.6.0 - 0.7.0" - - VersionPragmaSpecifier (Rule): # 8..14 " 0.6.0" - - VersionPragmaValue (Token): "0" # 9..10 - - Period (Token): "." # 10..11 - - VersionPragmaValue (Token): "6" # 11..12 - - Period (Token): "." # 12..13 - - VersionPragmaValue (Token): "0" # 13..14 - - Minus (Token): "-" # 15..16 - - VersionPragmaSpecifier (Rule): # 16..22 " 0.7.0" - - VersionPragmaValue (Token): "0" # 17..18 - - Period (Token): "." # 18..19 - - VersionPragmaValue (Token): "7" # 19..20 - - Period (Token): "." # 20..21 - - VersionPragmaValue (Token): "0" # 21..22 + - VersionPragmaExpressionsList (Rule): # 8..22 " 0.6.0 - 0.7.0" + - VersionPragmaExpression (Rule): # 8..22 " 0.6.0 - 0.7.0" + - VersionPragmaBinaryExpression (Rule): # 8..22 " 0.6.0 - 0.7.0" + - VersionPragmaExpression (Rule): # 8..14 " 0.6.0" + - VersionPragmaSpecifier (Rule): # 8..14 " 0.6.0" + - VersionPragmaValue (Token): "0" # 9..10 + - Period (Token): "." # 10..11 + - VersionPragmaValue (Token): "6" # 11..12 + - Period (Token): "." # 12..13 + - VersionPragmaValue (Token): "0" # 13..14 + - Minus (Token): "-" # 15..16 + - VersionPragmaExpression (Rule): # 16..22 " 0.7.0" + - VersionPragmaSpecifier (Rule): # 16..22 " 0.7.0" + - VersionPragmaValue (Token): "0" # 17..18 + - Period (Token): "." # 18..19 + - VersionPragmaValue (Token): "7" # 19..20 + - Period (Token): "." # 20..21 + - VersionPragmaValue (Token): "0" # 21..22 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/with_trivia/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/with_trivia/generated/0.4.11.yml index f0e7f04feb..7abf2182b5 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/with_trivia/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/with_trivia/generated/0.4.11.yml @@ -8,18 +8,19 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..68 "solidity /* comments */ 0 /* are */ . /* allowed *..." - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionList (Rule): # 8..68 " /* comments */ 0 /* are */ . /* allowed */ 0 . /*..." - - VersionPragmaSpecifier (Rule): # 8..68 " /* comments */ 0 /* are */ . /* allowed */ 0 . /*..." - - LeadingTrivia (Rule): # 8..24 " /* comments */ " - - MultilineComment (Trivia): "/* comments */" # 9..23 - - VersionPragmaValue (Token): "0" # 24..25 - - LeadingTrivia (Rule): # 25..36 " /* are */ " - - MultilineComment (Trivia): "/* are */" # 26..35 - - Period (Token): "." # 36..37 - - LeadingTrivia (Rule): # 37..52 " /* allowed */ " - - MultilineComment (Trivia): "/* allowed */" # 38..51 - - VersionPragmaValue (Token): "0" # 52..53 - - Period (Token): "." # 54..55 - - LeadingTrivia (Rule): # 55..67 " /* here */ " - - MultilineComment (Trivia): "/* here */" # 56..66 - - VersionPragmaValue (Token): "0" # 67..68 + - VersionPragmaExpressionsList (Rule): # 8..68 " /* comments */ 0 /* are */ . /* allowed */ 0 . /*..." + - VersionPragmaExpression (Rule): # 8..68 " /* comments */ 0 /* are */ . /* allowed */ 0 . /*..." + - VersionPragmaSpecifier (Rule): # 8..68 " /* comments */ 0 /* are */ . /* allowed */ 0 . /*..." + - LeadingTrivia (Rule): # 8..24 " /* comments */ " + - MultilineComment (Trivia): "/* comments */" # 9..23 + - VersionPragmaValue (Token): "0" # 24..25 + - LeadingTrivia (Rule): # 25..36 " /* are */ " + - MultilineComment (Trivia): "/* are */" # 26..35 + - Period (Token): "." # 36..37 + - LeadingTrivia (Rule): # 37..52 " /* allowed */ " + - MultilineComment (Trivia): "/* allowed */" # 38..51 + - VersionPragmaValue (Token): "0" # 52..53 + - Period (Token): "." # 54..55 + - LeadingTrivia (Rule): # 55..67 " /* here */ " + - MultilineComment (Trivia): "/* here */" # 56..66 + - VersionPragmaValue (Token): "0" # 67..68 diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_literal/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_literal/generated/0.4.11.yml index c4f3af5ae1..8ee9e709b6 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_literal/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_literal/generated/0.4.11.yml @@ -7,5 +7,4 @@ Errors: [] Tree: - YulExpression (Rule): # 0..3 "123" - - YulLiteral (Rule): # 0..3 "123" - - YulDecimalLiteral (Token): "123" # 0..3 + - YulDecimalLiteral (Token): "123" # 0..3 diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/function_call/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/function_call/generated/0.4.11.yml index c34cf74bb5..ee557c1d15 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/function_call/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/function_call/generated/0.4.11.yml @@ -12,7 +12,7 @@ Tree: - YulIdentifierPath (Rule): # 0..3 "foo" - YulIdentifier (Token): "foo" # 0..3 - OpenParen (Token): "(" # 3..4 - - YulExpression (Rule): # 4..5 "1" - - YulLiteral (Rule): # 4..5 "1" + - YulExpressionsList (Rule): # 4..5 "1" + - YulExpression (Rule): # 4..5 "1" - YulDecimalLiteral (Token): "1" # 4..5 - CloseParen (Token): ")" # 5..6 diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_literal/generated/0.4.11.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_literal/generated/0.4.11.yml index ed01ee87f1..83d6f442e8 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_literal/generated/0.4.11.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_literal/generated/0.4.11.yml @@ -7,5 +7,4 @@ Errors: [] Tree: - YulExpression (Rule): # 0..5 "0x123" - - YulLiteral (Rule): # 0..5 "0x123" - - YulHexLiteral (Token): "0x123" # 0..5 + - YulHexLiteral (Token): "0x123" # 0..5 diff --git a/crates/solidity/testing/utils/src/cst_snapshots/mod.rs b/crates/solidity/testing/utils/src/cst_snapshots/mod.rs index f7f07622eb..a413d0ab69 100644 --- a/crates/solidity/testing/utils/src/cst_snapshots/mod.rs +++ b/crates/solidity/testing/utils/src/cst_snapshots/mod.rs @@ -5,7 +5,7 @@ use std::{self, cmp::max, fmt::Write}; use anyhow::Result; use slang_solidity::syntax::{nodes::TextRangeExtensions, parser::ParseOutput}; -use crate::cst_snapshots::test_nodes::TestNode; +use crate::cst_snapshots::test_nodes::{TestNode, TestNodeKind}; pub trait ParseOutputTestSnapshotExtensions { fn to_test_snapshot(&self, source_id: &str, source: &str) -> Result; @@ -111,7 +111,11 @@ fn write_node( let range_string = format!("{range:?}", range = node.range.utf8()); let (node_value, node_comment) = if node.range.is_empty() { - (" []".to_owned(), range_string) + let preview = match node.kind { + TestNodeKind::Rule(_) => " []", + TestNodeKind::Token(_) | TestNodeKind::Trivia(_) => " \"\"", + }; + (preview.to_owned(), range_string) } else { let preview = node.render_preview(source, &node.range)?; if node.children.is_empty() { diff --git a/crates/solidity/testing/utils/src/node_extensions/mod.rs b/crates/solidity/testing/utils/src/node_extensions/mod.rs index 6be9319e9e..7fe12cd420 100644 --- a/crates/solidity/testing/utils/src/node_extensions/mod.rs +++ b/crates/solidity/testing/utils/src/node_extensions/mod.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod tests; -use slang_solidity::syntax::nodes::{Node, RuleKind}; +use slang_solidity::syntax::nodes::{Node, RuleKind, RuleNode, TokenNode}; pub trait NodeExtensions { fn is_trivia(&self) -> bool; @@ -10,24 +10,41 @@ pub trait NodeExtensions { impl NodeExtensions for Node { fn is_trivia(&self) -> bool { - match self { - Node::Token(_) => false, - Node::Rule(rule_node) => { - rule_node.kind == RuleKind::LeadingTrivia - || rule_node.kind == RuleKind::TrailingTrivia - } - } + return match self { + Node::Token(token) => token.is_trivia(), + Node::Rule(rule) => rule.is_trivia(), + }; } fn extract_non_trivia(&self) -> String { - match self { - Node::Token(token_node) => token_node.text.clone(), - Node::Rule(rule_node) => rule_node - .children - .iter() - .filter(|child| !child.is_trivia()) - .map(|child| child.extract_non_trivia()) - .collect(), - } + return match self { + Node::Token(token) => token.extract_non_trivia(), + Node::Rule(rule) => rule.extract_non_trivia(), + }; + } +} + +impl NodeExtensions for RuleNode { + fn is_trivia(&self) -> bool { + return self.kind == RuleKind::LeadingTrivia || self.kind == RuleKind::TrailingTrivia; + } + + fn extract_non_trivia(&self) -> String { + return self + .children + .iter() + .filter(|child| !child.is_trivia()) + .map(|child| child.extract_non_trivia()) + .collect(); + } +} + +impl NodeExtensions for TokenNode { + fn is_trivia(&self) -> bool { + return false; + } + + fn extract_non_trivia(&self) -> String { + return self.text.clone(); } } diff --git a/crates/solidity/testing/utils/src/version_pragmas/mod.rs b/crates/solidity/testing/utils/src/version_pragmas/mod.rs index a3985236fc..9c8d255bee 100644 --- a/crates/solidity/testing/utils/src/version_pragmas/mod.rs +++ b/crates/solidity/testing/utils/src/version_pragmas/mod.rs @@ -8,7 +8,7 @@ use semver::{Comparator, Op, Version}; use slang_solidity::{ language::Language, syntax::{ - nodes::{Node, RuleKind, RuleNode, TextRange}, + nodes::{Node, RuleKind, RuleNode, TextRange, TokenKind}, parser::ProductionKind, visitors::{Visitable, Visitor, VisitorEntryResponse}, }, @@ -20,9 +20,10 @@ pub fn extract_version_pragmas( source: &str, latest_version: &Version, ) -> Result> { - let output = - Language::new(latest_version.to_owned())?.parse(ProductionKind::SourceUnit, source)?; + let language = &Language::new(latest_version.to_owned())?; + let output = language.parse(ProductionKind::SourceUnit, source)?; let parse_tree = output.parse_tree(); + let mut collector = PragmaCollector { pragmas: vec![] }; parse_tree.accept_visitor(&mut collector)?; return Ok(collector.pragmas); @@ -39,81 +40,100 @@ impl Visitor for PragmaCollector { _path: &Vec>, range: &TextRange, ) -> Result { - if node.kind != RuleKind::VersionPragmaExpressionList { + if node.kind != RuleKind::VersionPragmaExpression { return Ok(VisitorEntryResponse::StepIn); } - for child in &node.children { - let pragma = self.extract_pragma(child).with_context(|| { + let pragma = self + .extract_pragma(&Node::Rule(node.to_owned())) + .with_context(|| { format!( "Failed to extract pragma at {range:?}: '{value}'", - value = child.extract_non_trivia() + value = node.extract_non_trivia() ) - }); + })?; - self.pragmas.push(pragma?); - } + self.pragmas.push(pragma); return Ok(VisitorEntryResponse::StepOver); } } impl PragmaCollector { - fn extract_pragma(&self, node: &Node) -> Result { - let (kind, children) = match node { - Node::Rule(rule_node) => (rule_node.kind, rule_node.children.clone()), - _ => bail!("Expected rule: {node:?}"), + fn extract_pragma(&self, expression_node: &Node) -> Result { + let expression_rule = match expression_node { + Node::Rule(rule) => rule, + _ => bail!("Expected rule: {expression_node:?}"), + }; + + ensure!( + expression_rule.kind == RuleKind::VersionPragmaExpression, + "Expected VersionPragmaExpression: {expression_rule:?}", + ); + + let inner_expression = match &expression_rule.children[..] { + [child] => match child { + Node::Rule(rule) => rule, + _ => bail!("Expected rule: {child:?}"), + }, + _ => unreachable!("Expected single child: {expression_rule:?}"), }; - let children: Vec<_> = children - .into_iter() + let inner_children: Vec<_> = inner_expression + .children + .iter() .filter(|child| !child.is_trivia()) .collect(); - match kind { - RuleKind::VersionPragmaAlternatives => match &children[..] { + match inner_expression.kind { + RuleKind::VersionPragmaBinaryExpression => match &inner_children[..] { [left, operator, right] => { - ensure!(operator.extract_non_trivia() == "||"); - - let left = self.extract_pragma(left)?; - let right = self.extract_pragma(right)?; - - return Ok(VersionPragma::or(left, right)); + let operator_kind = match operator { + Node::Token(token) => token.kind, + _ => bail!("Expected rule: {operator:?}"), + }; + + match operator_kind { + TokenKind::BarBar => { + let left = self.extract_pragma(left)?; + let right = self.extract_pragma(right)?; + + return Ok(VersionPragma::or(left, right)); + } + TokenKind::Minus => { + let mut left = self.extract_pragma(left)?.comparator()?; + let mut right = self.extract_pragma(right)?.comparator()?; + + // Simulate solc bug: + // https://github.com/ethereum/solidity/issues/13920 + left.op = Op::GreaterEq; + right.op = Op::LessEq; + + return Ok(VersionPragma::and( + VersionPragma::single(left), + VersionPragma::single(right), + )); + } + + _ => bail!("Unexpected operator: {operator:?}"), + }; } - _ => bail!("Expected 3 children: {node:?}"), - }, - RuleKind::VersionPragmaRange => match &children[..] { - [start, operator, end] => { - ensure!(operator.extract_non_trivia() == "-"); - - let mut start = self.extract_pragma(start)?.comparator()?; - let mut end = self.extract_pragma(end)?.comparator()?; - - // Simulate solc bug: - // https://github.com/ethereum/solidity/issues/13920 - start.op = Op::GreaterEq; - end.op = Op::LessEq; - - return Ok(VersionPragma::and( - VersionPragma::single(start), - VersionPragma::single(end), - )); - } - _ => bail!("Expected 3 children: {node:?}"), + + _ => bail!("Expected 3 children: {inner_expression:?}"), }, - RuleKind::VersionPragmaComparator => { - let value = node.extract_non_trivia(); + RuleKind::VersionPragmaUnaryExpression => { + let value = inner_expression.extract_non_trivia(); let comparator = Comparator::from_str(&value)?; return Ok(VersionPragma::single(comparator)); } RuleKind::VersionPragmaSpecifier => { - let specifier = node.extract_non_trivia(); + let specifier = inner_expression.extract_non_trivia(); let comparator = Comparator::from_str(&format!("={specifier}"))?; return Ok(VersionPragma::single(comparator)); } - _ => bail!("Unexpected {kind:?}: {children:?}"), + _ => bail!("Unexpected inner expression: {inner_expression:?}"), }; } }