From b79f40cdd9252ad32398951c6e09a99a502151b7 Mon Sep 17 00:00:00 2001 From: OmarTawfik <15987992+OmarTawfik@users.noreply.github.com> Date: Mon, 12 Jun 2023 04:57:04 -0700 Subject: [PATCH] support inlined nodes in grammar - Created `ProductionDefinition` enum to let parent `Production` hold common properties, similar to how `ParserDefinition`, `ScannerDefinition`, etc... work today. - Added `Production::inlined` boolean property, which defaults to `false` - Inlined productions no longer produce `ProductionKind`, `TokenKind`, or `RuleKind`. To test this end-to-end, I inlined a `Scanner`, a `Parser`, and a `PrecedenceParser` in the current grammar. Will follow up in the next few PRs with: - inlining additional nodes. - adding validation to make sure references between inlined nodes are valid, and that they are not leaked to public APIs. --- .changeset/strange-frogs-camp.md | 5 + crates/codegen/ebnf/src/serialization.rs | 16 +- crates/codegen/schema/src/compiler.rs | 2 +- crates/codegen/schema/src/types/production.rs | 72 +- .../src/validation/rules/definitions/mod.rs | 2 +- .../src/validation/rules/empty_roots/mod.rs | 2 +- .../validation/rules/references/collector.rs | 6 +- .../validation/rules/references/validator.rs | 10 +- .../src/validation/visitors/receivers.rs | 27 +- crates/codegen/spec/src/snippets.rs | 22 +- crates/codegen/syntax/src/char_set.rs | 12 +- crates/codegen/syntax/src/code_generator.rs | 60 +- crates/codegen/syntax/src/combinator_tree.rs | 38 +- crates/codegen/syntax/src/language.rs | 8 +- crates/codegen/syntax/src/to_parser_code.rs | 56 +- crates/codegen/syntax/src/to_scanner_code.rs | 18 +- crates/codegen/syntax/src/trie.rs | 14 +- .../03-pragmas/productions.yml | 4 +- .../01-contracts/productions.yml | 1 + .../05-expressions/04-strings/productions.yml | 1 + .../generated/productions.schema.json | 33 +- .../cargo/crate/src/generated/kinds.rs | 7 +- .../cargo/crate/src/generated/language.rs | 12 - .../cargo/crate/src/generated/parsers.rs | 330 +++---- .../cargo/crate/src/generated/scanners.rs | 546 ++++++---- .../outputs/npm/crate/src/generated/kinds.rs | 7 +- .../npm/crate/src/generated/language.rs | 12 - .../npm/crate/src/generated/parsers.rs | 330 +++---- .../npm/crate/src/generated/scanners.rs | 546 ++++++---- .../npm/package/src/generated/index.d.ts | 929 +++++++++--------- .../sample_counter/generated/0.4.11.yml | 66 +- .../alternatives/generated/0.4.11.yml | 2 +- .../equal_operator/generated/0.4.11.yml | 2 +- .../exact_version/generated/0.4.11.yml | 2 +- .../less_than_operator/generated/0.4.11.yml | 2 +- .../generated/0.4.11.yml | 3 +- .../nested_expressions/generated/0.4.11.yml | 2 +- .../VersionPragma/ranges/generated/0.4.11.yml | 2 +- .../with_trivia/generated/0.4.11.yml | 2 +- .../testing/utils/src/version_pragmas/mod.rs | 68 +- 40 files changed, 1857 insertions(+), 1422 deletions(-) create mode 100644 .changeset/strange-frogs-camp.md diff --git a/.changeset/strange-frogs-camp.md b/.changeset/strange-frogs-camp.md new file mode 100644 index 0000000000..dbf7c5a336 --- /dev/null +++ b/.changeset/strange-frogs-camp.md @@ -0,0 +1,5 @@ +--- +"changelog": minor +--- + +inlining CST nodes that offer no additional syntactic information diff --git a/crates/codegen/ebnf/src/serialization.rs b/crates/codegen/ebnf/src/serialization.rs index 8c26f44efa..41259befd6 100644 --- a/crates/codegen/ebnf/src/serialization.rs +++ b/crates/codegen/ebnf/src/serialization.rs @@ -1,6 +1,6 @@ use std::{collections::VecDeque, mem::discriminant}; -use codegen_schema::types::{LanguageDefinition, Production, ProductionRef}; +use codegen_schema::types::{LanguageDefinition, ProductionDefinition, ProductionRef}; use semver::Version; use crate::nodes::EbnfNode; @@ -23,17 +23,17 @@ impl<'language> EbnfSerializer<'language> { production: &'language ProductionRef, version: &Version, ) -> Option { - let body = match production.as_ref() { - Production::Scanner { version_map, .. } => { + let body = match &production.definition { + ProductionDefinition::Scanner { version_map, .. } => { version_map.get_for_version(version)?.generate_ebnf() } - Production::TriviaParser { version_map, .. } => { + ProductionDefinition::TriviaParser { version_map, .. } => { version_map.get_for_version(version)?.generate_ebnf() } - Production::Parser { version_map, .. } => { + ProductionDefinition::Parser { version_map, .. } => { version_map.get_for_version(version)?.generate_ebnf() } - Production::PrecedenceParser { version_map, .. } => { + ProductionDefinition::PrecedenceParser { version_map, .. } => { version_map.get_for_version(version)?.generate_ebnf() } }; @@ -41,7 +41,7 @@ impl<'language> EbnfSerializer<'language> { let mut instance = Self { language, buffer: String::new(), - base_production: production.name(), + base_production: &production.name, queue: VecDeque::new(), }; @@ -184,7 +184,7 @@ impl<'language> EbnfSerializer<'language> { fn display_name(&self, name: &String) -> String { if let Some(production) = self.language.productions.get(name) { - if matches!(production.as_ref(), Production::Scanner { .. }) { + if matches!(production.definition, ProductionDefinition::Scanner { .. }) { return format!("«{name}»"); } } diff --git a/crates/codegen/schema/src/compiler.rs b/crates/codegen/schema/src/compiler.rs index 7d609aaf03..6579fe4dbc 100644 --- a/crates/codegen/schema/src/compiler.rs +++ b/crates/codegen/schema/src/compiler.rs @@ -28,7 +28,7 @@ impl LanguageDefinition { .iter() .flat_map(|section| §ion.topics) .flat_map(|topic| &topic.productions) - .map(|production| (production.name().to_owned(), production.clone())) + .map(|production| (production.name.to_owned(), production.clone())) .collect(); let language = LanguageDefinitionRef::new(LanguageDefinition { diff --git a/crates/codegen/schema/src/types/production.rs b/crates/codegen/schema/src/types/production.rs index 1c21ab0e7d..fcdb44e680 100644 --- a/crates/codegen/schema/src/types/production.rs +++ b/crates/codegen/schema/src/types/production.rs @@ -10,56 +10,32 @@ use super::{parser::Parser, precedence_parser::PrecedenceParser, scanner::Scanne pub type ProductionRef = Rc; #[derive(Deserialize, Serialize, JsonSchema, Clone, Debug)] -#[serde(deny_unknown_fields)] -#[serde(tag = "kind")] -pub enum Production { - Scanner { - name: String, - #[serde(flatten)] - version_map: VersionMap, - }, - TriviaParser { - name: String, - #[serde(flatten)] - version_map: VersionMap, - }, - Parser { - name: String, - #[serde(flatten)] - version_map: VersionMap, - }, - PrecedenceParser { - name: String, - #[serde(flatten)] - version_map: VersionMap, - }, +pub struct Production { + pub name: String, + + #[serde(default)] + pub inlined: bool, + + #[serde(flatten)] + pub definition: ProductionDefinition, } impl Production { - pub fn name(&self) -> &String { - match self { - Self::Scanner { name, .. } - | Self::TriviaParser { name, .. } - | Self::Parser { name, .. } - | Self::PrecedenceParser { name, .. } => name, - } - } - pub fn versions(&self) -> Option> { - match self { - Production::Scanner { version_map, .. } => match version_map { + match &self.definition { + ProductionDefinition::Scanner { version_map, .. } => match version_map { VersionMap::Unversioned(_) => None, VersionMap::Versioned(ref map) => Some(map.keys().collect()), }, - Production::TriviaParser { version_map, .. } => match version_map { + ProductionDefinition::TriviaParser { version_map, .. } => match version_map { VersionMap::Unversioned(_) => None, VersionMap::Versioned(ref map) => Some(map.keys().collect()), }, - Production::Parser { version_map, .. } => match version_map { + ProductionDefinition::Parser { version_map, .. } => match version_map { VersionMap::Unversioned(_) => None, VersionMap::Versioned(ref map) => Some(map.keys().collect()), }, - Production::PrecedenceParser { version_map, .. } => match version_map { + ProductionDefinition::PrecedenceParser { version_map, .. } => match version_map { VersionMap::Unversioned(_) => None, VersionMap::Versioned(ref map) => Some(map.keys().collect()), }, @@ -67,6 +43,28 @@ impl Production { } } +#[derive(Deserialize, Serialize, JsonSchema, Clone, Debug)] +#[serde(deny_unknown_fields)] +#[serde(tag = "kind")] +pub enum ProductionDefinition { + Scanner { + #[serde(flatten)] + version_map: VersionMap, + }, + TriviaParser { + #[serde(flatten)] + version_map: VersionMap, + }, + Parser { + #[serde(flatten)] + version_map: VersionMap, + }, + PrecedenceParser { + #[serde(flatten)] + version_map: VersionMap, + }, +} + #[derive(Deserialize, Serialize, JsonSchema, Clone, Debug)] #[serde(deny_unknown_fields, rename_all = "camelCase")] pub enum VersionMap { diff --git a/crates/codegen/schema/src/validation/rules/definitions/mod.rs b/crates/codegen/schema/src/validation/rules/definitions/mod.rs index 5256665c9d..5ae9579c10 100644 --- a/crates/codegen/schema/src/validation/rules/definitions/mod.rs +++ b/crates/codegen/schema/src/validation/rules/definitions/mod.rs @@ -48,7 +48,7 @@ impl Visitor for Definitions { location: &LocationRef, reporter: &mut Reporter, ) -> bool { - let name = production.name(); + let name = &production.name; if !self.productions_so_far.insert(name.to_owned()) { reporter.report(location, Errors::DuplicateProduction(name.to_owned())); } diff --git a/crates/codegen/schema/src/validation/rules/empty_roots/mod.rs b/crates/codegen/schema/src/validation/rules/empty_roots/mod.rs index dced9b7092..49449b8721 100644 --- a/crates/codegen/schema/src/validation/rules/empty_roots/mod.rs +++ b/crates/codegen/schema/src/validation/rules/empty_roots/mod.rs @@ -36,7 +36,7 @@ impl Visitor for EmptyRoots { _location: &LocationRef, _reporter: &mut Reporter, ) -> bool { - if production.name() == &self.language.root_production { + if production.name == self.language.root_production { // Skip, as it is allowed to be empty. return false; } diff --git a/crates/codegen/schema/src/validation/rules/references/collector.rs b/crates/codegen/schema/src/validation/rules/references/collector.rs index 151432ef01..4fb44b7bfd 100644 --- a/crates/codegen/schema/src/validation/rules/references/collector.rs +++ b/crates/codegen/schema/src/validation/rules/references/collector.rs @@ -31,7 +31,7 @@ impl Visitor for Collector { location: &LocationRef, _reporter: &mut Reporter, ) -> bool { - self.metadata.add_production(&production.name(), location); + self.metadata.add_production(&production.name, location); self.current_production = Some(production.to_owned()); return true; @@ -43,8 +43,8 @@ impl Visitor for Collector { _location: &LocationRef, _reporter: &mut Reporter, ) -> bool { - let production = self.current_production.as_ref().unwrap().name(); - self.metadata.add_version(production, version_set); + let production = self.current_production.as_ref().unwrap(); + self.metadata.add_version(&production.name, version_set); return false; } diff --git a/crates/codegen/schema/src/validation/rules/references/validator.rs b/crates/codegen/schema/src/validation/rules/references/validator.rs index 654633c17c..40877dfde3 100644 --- a/crates/codegen/schema/src/validation/rules/references/validator.rs +++ b/crates/codegen/schema/src/validation/rules/references/validator.rs @@ -1,6 +1,6 @@ use crate::{ types::{ - LanguageDefinitionRef, ParserDefinition, ParserRef, Production, ProductionRef, + LanguageDefinitionRef, ParserDefinition, ParserRef, ProductionDefinition, ProductionRef, ScannerDefinition, ScannerRef, }, validation::{ @@ -116,8 +116,8 @@ impl Validator { reporter: &mut Reporter, ) { match self.language.productions.get(reference) { - Some(production) => match production.as_ref() { - Production::Scanner { .. } => { + Some(production) => match production.definition { + ProductionDefinition::Scanner { .. } => { self.insert_reference(reference, location, reporter); } _ => { @@ -136,12 +136,12 @@ impl Validator { location: &LocationRef, reporter: &mut Reporter, ) { - let production = self.current_production.as_ref().unwrap().name(); + 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, &version_set, reference); + .add_reference(&production.name, &version_set, reference); if !can_be_added { reporter.report( diff --git a/crates/codegen/schema/src/validation/visitors/receivers.rs b/crates/codegen/schema/src/validation/visitors/receivers.rs index 4180047604..a0e2786e26 100644 --- a/crates/codegen/schema/src/validation/visitors/receivers.rs +++ b/crates/codegen/schema/src/validation/visitors/receivers.rs @@ -2,8 +2,8 @@ use std::rc::Rc; use crate::{ types::{ - LanguageDefinitionRef, ParserDefinition, ParserRef, PrecedenceParserRef, Production, - ProductionRef, ScannerDefinition, ScannerRef, VersionMap, + LanguageDefinitionRef, ParserDefinition, ParserRef, PrecedenceParserRef, + ProductionDefinition, ProductionRef, ScannerDefinition, ScannerRef, VersionMap, }, validation::visitors::{ location::LocationRef, reporter::Reporter, visitor::Visitor, VersionSet, @@ -32,17 +32,30 @@ impl Receiver for ProductionRef { return; } - match self.as_ref() { - Production::Scanner { version_map, .. } => { + self.definition + .receive(visitor, language, location, reporter); + } +} + +impl Receiver for ProductionDefinition { + fn receive( + &self, + visitor: &mut impl Visitor, + language: &LanguageDefinitionRef, + location: LocationRef, + reporter: &mut Reporter, + ) { + match self { + Self::Scanner { version_map, .. } => { version_map.receive(visitor, language, location, reporter); } - Production::TriviaParser { version_map, .. } => { + Self::TriviaParser { version_map, .. } => { version_map.receive(visitor, language, location, reporter); } - Production::Parser { version_map, .. } => { + Self::Parser { version_map, .. } => { version_map.receive(visitor, language, location, reporter); } - Production::PrecedenceParser { version_map, .. } => { + Self::PrecedenceParser { version_map, .. } => { version_map.receive(visitor, language, location, reporter); } }; diff --git a/crates/codegen/spec/src/snippets.rs b/crates/codegen/spec/src/snippets.rs index ecba250066..a773648fea 100644 --- a/crates/codegen/spec/src/snippets.rs +++ b/crates/codegen/spec/src/snippets.rs @@ -3,7 +3,8 @@ use std::path::PathBuf; use anyhow::Result; use codegen_ebnf::EbnfSerializer; use codegen_schema::types::{ - LanguageDefinition, LanguageSection, LanguageTopic, Production, ProductionRef, VersionMap, + LanguageDefinition, LanguageSection, LanguageTopic, ProductionDefinition, ProductionRef, + VersionMap, }; use codegen_utils::context::CodegenContext; use inflector::Inflector; @@ -48,11 +49,10 @@ impl<'context> Snippets<'context> { production: &ProductionRef, version: &Version, ) -> Option { - let production_name = &production.name(); - let (section, topic) = self.locate_production(production_name); + let (section, topic) = self.locate_production(&production.name); - let file_name = match production.as_ref() { - Production::Scanner { version_map, .. } => match version_map { + let file_name = match &production.definition { + ProductionDefinition::Scanner { version_map, .. } => match version_map { VersionMap::Unversioned(_) => Some("unversioned".to_owned()), VersionMap::Versioned(versions) => versions .keys() @@ -60,8 +60,8 @@ impl<'context> Snippets<'context> { .find(|v| *v <= version) .and_then(|v| versions.get(v).unwrap().as_ref().map(|_| v.to_string())), }, - Production::TriviaParser { version_map, .. } - | Production::Parser { version_map, .. } => match version_map { + ProductionDefinition::TriviaParser { version_map, .. } + | ProductionDefinition::Parser { version_map, .. } => match version_map { VersionMap::Unversioned(_) => Some("unversioned".to_owned()), VersionMap::Versioned(versions) => versions .keys() @@ -69,7 +69,7 @@ impl<'context> Snippets<'context> { .find(|v| *v <= version) .and_then(|v| versions.get(v).unwrap().as_ref().map(|_| v.to_string())), }, - Production::PrecedenceParser { version_map, .. } => match version_map { + ProductionDefinition::PrecedenceParser { version_map, .. } => match version_map { VersionMap::Unversioned(_) => Some("unversioned".to_owned()), VersionMap::Versioned(versions) => versions .keys() @@ -84,7 +84,7 @@ impl<'context> Snippets<'context> { .join("ebnf") .join(§ion.path) .join(&topic.path) - .join(production_name.to_kebab_case()) + .join(production.name.to_kebab_case()) .join(format!("{file_name}.md")) }); } @@ -94,7 +94,7 @@ impl<'context> Snippets<'context> { let language = "ebnf"; // https://pygments.org/languages/ let class = "slang-ebnf"; // used to select code blocks via JS during runtime - let id = production.name(); // used for navigation (generarating URL hashes) + let id = &production.name; // used for navigation (generarating URL hashes) let contents = &EbnfSerializer::serialize_version(self.language, production, version)?; snippet.write_code_block(language, class, id, contents); @@ -106,7 +106,7 @@ impl<'context> Snippets<'context> { for section in &self.language.sections { for topic in §ion.topics { for production in &topic.productions { - if name == production.name() { + if name == production.name { return (section, topic); } } diff --git a/crates/codegen/syntax/src/char_set.rs b/crates/codegen/syntax/src/char_set.rs index 3e7d955827..90c50be9fd 100644 --- a/crates/codegen/syntax/src/char_set.rs +++ b/crates/codegen/syntax/src/char_set.rs @@ -3,7 +3,7 @@ use std::{ ops::Range, }; -use codegen_schema::types::{Production, ScannerDefinition, ScannerRef}; +use codegen_schema::types::{ProductionDefinition, ScannerDefinition, ScannerRef}; use proc_macro2::TokenStream; use quote::quote; @@ -168,15 +168,15 @@ impl CharSet { ScannerDefinition::Reference(name) => Self::from_scanner( tree, - match tree.context.get_tree_by_name(name).production.as_ref() { - Production::Scanner { name, version_map } => { + match &tree.context.get_tree_by_name(name).production.definition { + ProductionDefinition::Scanner { version_map } => { version_map.get_for_version(&tree.context.version).expect( &format!("Validation should have ensured: no version of {name} exists for version {version}", version = tree.context.version) ).clone() } - Production::TriviaParser { .. } - | Production::Parser { .. } - | Production::PrecedenceParser { .. } => { + ProductionDefinition::TriviaParser { .. } + | ProductionDefinition::Parser { .. } + | ProductionDefinition::PrecedenceParser { .. } => { unreachable!( "Validation should have ensured: scanners can only reference scanners" ) diff --git a/crates/codegen/syntax/src/code_generator.rs b/crates/codegen/syntax/src/code_generator.rs index a2a81cf968..883a3246d1 100644 --- a/crates/codegen/syntax/src/code_generator.rs +++ b/crates/codegen/syntax/src/code_generator.rs @@ -3,7 +3,7 @@ use std::{ path::PathBuf, }; -use codegen_schema::types::LanguageDefinition; +use codegen_schema::types::LanguageDefinitionRef; use codegen_utils::context::CodegenContext; use inflector::Inflector; use proc_macro2::{Ident, TokenStream}; @@ -34,7 +34,11 @@ impl VersionedFunctionBody { let version_name = version.to_string().replace(".", "_"); let per_version_function_name = format_ident!( "{name}_{version_name}",); let function = quote! { - #[allow(unused_assignments, unused_parens)] + #[ + // Inlined scanners are not always inlined in codegen: + // https://github.com/NomicFoundation/slang/issues/365 + allow(dead_code) + ] fn #per_version_function_name(&self, stream: &mut Stream) -> #return_type { #body } }; format!("{comment}\n{function}") @@ -116,6 +120,7 @@ impl VersionedFunctionBody { #[derive(Clone, Debug)] pub struct CodeGenerator { + pub language: LanguageDefinitionRef, pub first_version: Version, pub token_kinds: BTreeMap>, @@ -128,13 +133,17 @@ pub struct CodeGenerator { } impl CodeGenerator { - pub fn new(language: &LanguageDefinition) -> Self { + pub fn new(language: &LanguageDefinitionRef) -> Self { Self { + language: language.clone(), first_version: language.versions.first().unwrap().clone(), + token_kinds: Default::default(), scanners: Default::default(), + rule_kinds: Default::default(), parsers: Default::default(), + errors: Default::default(), } } @@ -237,6 +246,11 @@ impl CodeGenerator { if scanner.is_defined_for_all_versions() { let internal_function = quote! { #[inline] + #[ + // Inlined scanners are not always inlined in codegen: + // https://github.com/NomicFoundation/slang/issues/365 + allow(dead_code) + ] pub(crate) fn #internal_function_name(&self, stream: &mut Stream) -> bool { self.#dispatch_function_name(stream) } @@ -246,12 +260,22 @@ impl CodeGenerator { let external_function_name = format_ident!("maybe_scan_{name}", name = name.to_snake_case()); let external_function = quote! { #[inline] + #[ + // Inlined scanners are not always inlined in codegen: + // https://github.com/NomicFoundation/slang/issues/365 + allow(dead_code) + ] pub(crate) fn #external_function_name(&self, stream: &mut Stream) -> Option { self.#dispatch_function_name(stream) } }; let internal_function = quote! { #[inline] + #[ + // Inlined scanners are not always inlined in codegen: + // https://github.com/NomicFoundation/slang/issues/365 + allow(dead_code) + ] pub(crate) fn #internal_function_name(&self, stream: &mut Stream) -> bool { self.#dispatch_function_name(stream).expect("Validation should have checked that references are valid between versions") } @@ -264,7 +288,9 @@ impl CodeGenerator { } pub fn scanner_invocations(&self) -> TokenStream { - let invocations = self.scanners.iter().map(|(name, scanner)| { + let invocations = self.scanners.iter() + .filter(|(name, _)| !self.language.productions[*name].inlined) + .map(|(name, scanner)| { let production_kind = format_ident!("{name}"); let token_kind = format_ident!("{name}"); if scanner.is_defined_for_all_versions() { @@ -378,11 +404,18 @@ impl CodeGenerator { let kind = format_ident!("{name}"); let internal_function_name = format_ident!("parse_{name}", name = name.to_snake_case()); let (functions, dispatch_function_name) = parser.to_function_body(&internal_function_name, quote! {ParserResult}); + + let kind_wrapper = if self.language.productions[name].inlined { + None + } else { + Some(quote! { .with_kind(RuleKind::#kind) }) + }; + if parser.is_defined_for_all_versions() { let internal_function = quote! { #[inline] pub(crate) fn #internal_function_name(&self, stream: &mut Stream) -> ParserResult { - self.#dispatch_function_name(stream).with_kind(RuleKind::#kind) + self.#dispatch_function_name(stream) #kind_wrapper } }; format!("{functions}\n\n{internal_function}") @@ -390,7 +423,7 @@ impl CodeGenerator { let external_function_name = format_ident!("maybe_parse_{name}", name = name.to_snake_case()); let external_function = quote! { pub(crate) fn #external_function_name(&self, stream: &mut Stream) -> Option { - self.#dispatch_function_name(stream).map(|body| body.with_kind(RuleKind::#kind)) + self.#dispatch_function_name(stream).map(|body| body #kind_wrapper) } }; let internal_function = quote! { @@ -407,7 +440,9 @@ impl CodeGenerator { } pub fn parser_invocations(&self) -> TokenStream { - let invocations = self.parsers.iter().map(|(name, parser)| { + let invocations = self.parsers.iter() + .filter(|(name, _)| !self.language.productions[*name].inlined) + .map(|(name, parser)| { let production_kind = format_ident!("{name}"); if parser.is_defined_for_all_versions() { let function_name = format_ident!("parse_{name}", name = name.to_snake_case()); @@ -443,12 +478,15 @@ impl CodeGenerator { pub fn production_kinds(&self) -> TokenStream { let mut kinds: Vec<_> = self - .scanners - .iter() - .chain(self.parsers.iter()) - .map(|(name, _)| format_ident!("{name}")) + .language + .productions + .values() + .filter(|production| !production.inlined) + .map(|production| format_ident!("{}", production.name)) .collect(); + kinds.sort(); + quote! { pub enum ProductionKind { #(#kinds),* diff --git a/crates/codegen/syntax/src/combinator_tree.rs b/crates/codegen/syntax/src/combinator_tree.rs index fadb16fcd9..e0580f364f 100644 --- a/crates/codegen/syntax/src/combinator_tree.rs +++ b/crates/codegen/syntax/src/combinator_tree.rs @@ -1,7 +1,7 @@ use std::{cell::Cell, fmt::Write}; use codegen_ebnf::EbnfSerializer; -use codegen_schema::types::{Production, ProductionRef}; +use codegen_schema::types::{ProductionDefinition, ProductionRef}; use crate::first_set::FirstSet; @@ -35,15 +35,15 @@ impl<'context> CombinatorTree<'context> { pub fn ensure_tree_is_built(&'context self) { if self.root_node.get().is_none() { let version = &self.context.version; - self.root_node.set(match self.production.as_ref() { - Production::Scanner { version_map, .. } => version_map + self.root_node.set(match &self.production.definition { + ProductionDefinition::Scanner { version_map, .. } => version_map .get_for_version(version) .map(|scanner| CombinatorNode::from_scanner(self, &scanner)), - Production::TriviaParser { version_map, .. } - | Production::Parser { version_map, .. } => version_map + ProductionDefinition::TriviaParser { version_map, .. } + | ProductionDefinition::Parser { version_map, .. } => version_map .get_for_version(version) .map(|parser| CombinatorNode::from_parser(self, &parser)), - Production::PrecedenceParser { version_map, .. } => version_map + ProductionDefinition::PrecedenceParser { version_map, .. } => version_map .get_for_version(version) .map(|parser| CombinatorNode::from_precedence_parser(self, &parser)), }); @@ -61,31 +61,43 @@ impl<'context> CombinatorTree<'context> { return; } + let name = &self.production.name; + let inlined = &self.production.inlined; let comment = self.generate_comment(); - match self.production.as_ref() { - Production::Scanner { name, .. } => { + match self.production.definition { + ProductionDefinition::Scanner { .. } => { let definition = self.root_node.get().map(|node| { if node.first_set().includes_epsilon { unreachable!( "Validation should have discovered that scanner {name} can be empty" ); } - code.add_token_kind(name.clone()); + + if !inlined { + code.add_token_kind(name.clone()); + } + (comment, node.to_scanner_code(code)) }); code.add_scanner(name.clone(), version, definition); } - Production::TriviaParser { name, .. } => { - code.add_rule_kind(name.clone()); + ProductionDefinition::TriviaParser { .. } => { + if !inlined { + code.add_rule_kind(name.clone()); + } + let definition = self .root_node .get() .map(|node| (comment, node.to_parser_code(true, code))); code.add_parser(name.clone(), version, definition); } - Production::Parser { name, .. } | Production::PrecedenceParser { name, .. } => { - code.add_rule_kind(name.clone()); + ProductionDefinition::Parser { .. } | ProductionDefinition::PrecedenceParser { .. } => { + if !inlined { + code.add_rule_kind(name.clone()); + } + let definition = self .root_node .get() diff --git a/crates/codegen/syntax/src/language.rs b/crates/codegen/syntax/src/language.rs index d20ae42ff1..be0b115255 100644 --- a/crates/codegen/syntax/src/language.rs +++ b/crates/codegen/syntax/src/language.rs @@ -1,4 +1,4 @@ -use codegen_schema::types::LanguageDefinition; +use codegen_schema::types::LanguageDefinitionRef; use codegen_utils::context::CodegenContext; use super::code_generator::CodeGenerator; @@ -22,7 +22,7 @@ trait PrivateSyntaxGeneratorExtensions { fn create_code_generator(&self) -> CodeGenerator; } -impl SyntaxGeneratorExtensions for LanguageDefinition { +impl SyntaxGeneratorExtensions for LanguageDefinitionRef { fn generate_rust_lib_sources( &self, context: &mut CodegenContext, @@ -42,7 +42,7 @@ impl SyntaxGeneratorExtensions for LanguageDefinition { } } -impl PrivateSyntaxGeneratorExtensions for LanguageDefinition { +impl PrivateSyntaxGeneratorExtensions for LanguageDefinitionRef { fn create_code_generator(&self) -> CodeGenerator { let version_breaks = self.collect_version_breaks(); @@ -57,7 +57,7 @@ impl PrivateSyntaxGeneratorExtensions for LanguageDefinition { for production in self.productions.values() { trees_by_name.insert( - production.name().clone(), + production.name.clone(), CombinatorTree::new(&context, production), ); } diff --git a/crates/codegen/syntax/src/to_parser_code.rs b/crates/codegen/syntax/src/to_parser_code.rs index f724c6349f..3dfceaf40b 100644 --- a/crates/codegen/syntax/src/to_parser_code.rs +++ b/crates/codegen/syntax/src/to_parser_code.rs @@ -1,4 +1,4 @@ -use codegen_schema::types::{OperatorModel, Production}; +use codegen_schema::types::{OperatorModel, ProductionDefinition}; use inflector::Inflector; use proc_macro2::{Ident, TokenStream}; use quote::{format_ident, quote}; @@ -11,29 +11,34 @@ impl<'context> CombinatorNode<'context> { /********************************************************************** * Simple Reference */ - Self::Reference { tree } => match tree.production.as_ref() { - Production::Scanner { name, .. } => { - let kind = format_ident!("{name}"); - let function_name = format_ident!("scan_{name}", name = name.to_snake_case()); - let scanner = quote! { Self::#function_name }; - scanner_code_to_parser_code(scanner, kind, !is_trivia) - } - Production::TriviaParser { name, .. } => { - let function_name = format_ident!("parse_{name}", name = name.to_snake_case()); - quote! { self.#function_name(stream) } - } - Production::Parser { name, .. } | Production::PrecedenceParser { name, .. } => { - if !is_trivia { - let function_name = - format_ident!("parse_{name}", name = name.to_snake_case()); + Self::Reference { tree } => { + let name = &tree.production.name; + let snake_case = name.to_snake_case(); + + match tree.production.definition { + ProductionDefinition::Scanner { .. } => { + let kind = format_ident!("{name}"); + let function_name = format_ident!("scan_{snake_case}"); + let scanner = quote! { Self::#function_name }; + scanner_code_to_parser_code(scanner, kind, !is_trivia) + } + ProductionDefinition::TriviaParser { .. } => { + let function_name = format_ident!("parse_{snake_case}"); quote! { self.#function_name(stream) } - } else { - unreachable!( - "Trivia productions can only reference trivia or token productions" - ) + } + ProductionDefinition::Parser { .. } + | ProductionDefinition::PrecedenceParser { .. } => { + if !is_trivia { + let function_name = format_ident!("parse_{snake_case}"); + quote! { self.#function_name(stream) } + } else { + unreachable!( + "Trivia productions can only reference trivia or token productions" + ) + } } } - }, + } /********************************************************************** * Sequence and Choice @@ -592,12 +597,15 @@ fn try_wrap_name( } fn scanner_production_to_parser_code( - open: &&crate::combinator_tree::CombinatorTree, + tree: &&crate::combinator_tree::CombinatorTree, is_trivia: bool, ) -> TokenStream { - if let Production::Scanner { name, .. } = open.production.as_ref() { + let name = &tree.production.name; + let snake_case = name.to_snake_case(); + + if let ProductionDefinition::Scanner { .. } = tree.production.definition { let kind = format_ident!("{name}"); - let function_name = format_ident!("scan_{name}", name = name.to_snake_case()); + let function_name = format_ident!("scan_{snake_case}"); let scanner = quote! { Self::#function_name }; scanner_code_to_parser_code(scanner, kind, !is_trivia) } else { diff --git a/crates/codegen/syntax/src/to_scanner_code.rs b/crates/codegen/syntax/src/to_scanner_code.rs index 9d6a3b6d07..8110511fb1 100644 --- a/crates/codegen/syntax/src/to_scanner_code.rs +++ b/crates/codegen/syntax/src/to_scanner_code.rs @@ -1,6 +1,6 @@ use std::collections::BTreeSet; -use codegen_schema::types::Production; +use codegen_schema::types::ProductionDefinition; use inflector::Inflector; use proc_macro2::TokenStream; use quote::{format_ident, quote}; @@ -16,15 +16,17 @@ impl<'context> CombinatorNode<'context> { /********************************************************************** * Simple Reference */ - Self::Reference { tree } => match tree.production.as_ref() { - Production::Scanner { name, .. } => { - let scanner_function_name = - format_ident!("scan_{name}", name = name.to_snake_case()); + Self::Reference { tree } => match tree.production.definition { + ProductionDefinition::Scanner { .. } => { + let name = &tree.production.name; + let snake_case = name.to_snake_case(); + let scanner_function_name = format_ident!("scan_{snake_case}"); + quote! { self.#scanner_function_name(stream) } } - Production::TriviaParser { .. } - | Production::Parser { .. } - | Production::PrecedenceParser { .. } => { + ProductionDefinition::TriviaParser { .. } + | ProductionDefinition::Parser { .. } + | ProductionDefinition::PrecedenceParser { .. } => { unreachable!("Token productions can only reference other token productions") } }, diff --git a/crates/codegen/syntax/src/trie.rs b/crates/codegen/syntax/src/trie.rs index 6c6900ea6a..ae4f1e29be 100644 --- a/crates/codegen/syntax/src/trie.rs +++ b/crates/codegen/syntax/src/trie.rs @@ -1,6 +1,6 @@ use std::{collections::BTreeMap, fmt::Debug}; -use codegen_schema::types::{Production, ScannerDefinition, ScannerRef, VersionMap}; +use codegen_schema::types::{ProductionDefinition, ScannerDefinition, ScannerRef, VersionMap}; use crate::combinator_tree::CombinatorTree; @@ -116,18 +116,18 @@ pub fn from_scanner(tree: &CombinatorTree, scanner: ScannerRef) -> Option { - match tree.context.get_tree_by_name(name).production.as_ref() { - Production::Scanner { + match &tree.context.get_tree_by_name(name).production.definition { + ProductionDefinition::Scanner { version_map: VersionMap::Versioned(_), .. } => false, - Production::Scanner { + ProductionDefinition::Scanner { version_map: VersionMap::Unversioned(scanner), .. } => collect_terminals(trie, tree, scanner.clone()), - Production::TriviaParser { .. } - | Production::Parser { .. } - | Production::PrecedenceParser { .. } => { + ProductionDefinition::TriviaParser { .. } + | ProductionDefinition::Parser { .. } + | ProductionDefinition::PrecedenceParser { .. } => { unreachable!( "Validation should have ensured: scanners can only reference scanners" ) 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 4a0c3f22e0..b96873e2c3 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 @@ -19,11 +19,13 @@ unversioned: sequence: - reference: "SolidityKeyword" - - oneOrMore: + - name: "VersionPragmaExpressionList" + oneOrMore: reference: "VersionPragmaExpression" - name: "VersionPragmaExpression" kind: "PrecedenceParser" + inlined: true unversioned: operators: - name: "VersionPragmaAlternatives" 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 5faa730ba6..55b3f498ea 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 @@ -58,6 +58,7 @@ - name: "ContractBodyElement" kind: "Parser" + inlined: true versioned: 0.4.11: choice: diff --git a/crates/solidity/inputs/language/definition/05-expressions/04-strings/productions.yml b/crates/solidity/inputs/language/definition/05-expressions/04-strings/productions.yml index 3816185c41..f3c4612fe7 100644 --- a/crates/solidity/inputs/language/definition/05-expressions/04-strings/productions.yml +++ b/crates/solidity/inputs/language/definition/05-expressions/04-strings/productions.yml @@ -57,6 +57,7 @@ - name: "HexCharacter" kind: "Scanner" + inlined: true unversioned: choice: - range: diff --git a/crates/solidity/inputs/language/generated/productions.schema.json b/crates/solidity/inputs/language/generated/productions.schema.json index 8a7c597513..638a329352 100644 --- a/crates/solidity/inputs/language/generated/productions.schema.json +++ b/crates/solidity/inputs/language/generated/productions.schema.json @@ -7,6 +7,7 @@ }, "definitions": { "Production": { + "type": "object", "anyOf": [ { "type": "object", @@ -40,14 +41,11 @@ } } ], - "required": ["kind", "name"], + "required": ["kind"], "properties": { "kind": { "type": "string", "enum": ["Scanner"] - }, - "name": { - "type": "string" } } }, @@ -83,14 +81,11 @@ } } ], - "required": ["kind", "name"], + "required": ["kind"], "properties": { "kind": { "type": "string", "enum": ["TriviaParser"] - }, - "name": { - "type": "string" } } }, @@ -126,14 +121,11 @@ } } ], - "required": ["kind", "name"], + "required": ["kind"], "properties": { "kind": { "type": "string", "enum": ["Parser"] - }, - "name": { - "type": "string" } } }, @@ -169,18 +161,25 @@ } } ], - "required": ["kind", "name"], + "required": ["kind"], "properties": { "kind": { "type": "string", "enum": ["PrecedenceParser"] - }, - "name": { - "type": "string" } } } - ] + ], + "required": ["name"], + "properties": { + "name": { + "type": "string" + }, + "inlined": { + "default": false, + "type": "boolean" + } + } }, "Scanner": { "type": "object", diff --git a/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs b/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs index 064ee44020..bc3b0dc58f 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs @@ -91,7 +91,6 @@ pub enum TokenKind { GreaterThanGreaterThanGreaterThanEqual, GweiKeyword, HexByteEscape, - HexCharacter, HexLiteral, HexStringLiteral, HoursKeyword, @@ -232,7 +231,6 @@ pub enum RuleKind { ConstructorAttribute, ConstructorDefinition, ContinueStatement, - ContractBodyElement, ContractBodyElements, ContractDefinition, DataLocation, @@ -340,7 +338,7 @@ pub enum RuleKind { VersionPragma, VersionPragmaAlternatives, VersionPragmaComparator, - VersionPragmaExpression, + VersionPragmaExpressionList, VersionPragmaRange, VersionPragmaSpecifier, WhileStatement, @@ -432,7 +430,6 @@ pub enum ProductionKind { ConstructorKeyword, ContinueKeyword, ContinueStatement, - ContractBodyElement, ContractDefinition, ContractKeyword, DataLocation, @@ -500,7 +497,6 @@ pub enum ProductionKind { GreaterThanGreaterThanGreaterThanEqual, GweiKeyword, HexByteEscape, - HexCharacter, HexLiteral, HexStringLiteral, HoursKeyword, @@ -647,7 +643,6 @@ pub enum ProductionKind { VarKeyword, VariableDeclarationStatement, VersionPragma, - VersionPragmaExpression, VersionPragmaSpecifier, VersionPragmaValue, ViewKeyword, diff --git a/crates/solidity/outputs/cargo/crate/src/generated/language.rs b/crates/solidity/outputs/cargo/crate/src/generated/language.rs index a78087c0b1..988d0638b7 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/language.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/language.rs @@ -835,12 +835,6 @@ impl Language { Language::scan_hex_byte_escape, TokenKind::HexByteEscape, ), - ProductionKind::HexCharacter => call_scanner( - self, - input, - Language::scan_hex_character, - TokenKind::HexCharacter, - ), ProductionKind::HexLiteral => call_scanner( self, input, @@ -1417,9 +1411,6 @@ impl Language { ProductionKind::ContinueStatement => { call_parser(self, input, Language::parse_continue_statement) } - ProductionKind::ContractBodyElement => { - call_parser(self, input, Language::parse_contract_body_element) - } ProductionKind::ContractDefinition => { call_parser(self, input, Language::parse_contract_definition) } @@ -1674,9 +1665,6 @@ impl Language { ProductionKind::VersionPragma => { call_parser(self, input, Language::parse_version_pragma) } - ProductionKind::VersionPragmaExpression => { - call_parser(self, input, Language::parse_version_pragma_expression) - } ProductionKind::VersionPragmaSpecifier => { call_parser(self, input, Language::parse_version_pragma_specifier) } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parsers.rs b/crates/solidity/outputs/cargo/crate/src/generated/parsers.rs index 3cfa828afd..81f4317fa3 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parsers.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parsers.rs @@ -233,7 +233,7 @@ impl Language { } // ABICoderPragma = «AbicoderKeyword» «Identifier»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_abi_coder_pragma_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -282,7 +282,7 @@ impl Language { // AddSubOperator = «Plus» | «Minus»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_add_sub_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -310,7 +310,7 @@ impl Language { // AddressType = «AddressKeyword» «PayableKeyword»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_address_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -371,7 +371,7 @@ impl Language { // AndOperator = «AmpersandAmpersand»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_and_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia( stream, @@ -388,7 +388,7 @@ impl Language { // ArgumentList = «OpenParen» (PositionalArgumentList | NamedArgumentList)? «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_argument_list_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_paren, TokenKind::OpenParen) @@ -463,7 +463,7 @@ impl Language { // ArrayLiteral = «OpenBracket» Expression («Comma» Expression)* «CloseBracket»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_array_literal_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia( @@ -539,7 +539,7 @@ impl Language { // AssemblyFlags = «OpenParen» «DoubleQuotedAsciiStringLiteral» («Comma» «DoubleQuotedAsciiStringLiteral»)* «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_assembly_flags_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_paren, TokenKind::OpenParen) @@ -682,7 +682,7 @@ impl Language { // AssemblyStatement = «AssemblyKeyword» «Evmasm»? AssemblyFlags? YulBlock; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_assembly_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -784,7 +784,7 @@ impl Language { // | «SlashEqual» // | «PercentEqual»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_assignment_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -899,7 +899,7 @@ impl Language { // AsteriskImport = «Asterisk» ImportAlias «FromKeyword» ImportPath; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_asterisk_import_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -970,7 +970,7 @@ impl Language { // BitAndOperator = «Ampersand»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_bit_and_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, Self::scan_ampersand, TokenKind::Ampersand) } @@ -983,7 +983,7 @@ impl Language { // BitOrOperator = «Bar»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_bit_or_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, Self::scan_bar, TokenKind::Bar) } @@ -996,7 +996,7 @@ impl Language { // BitXOrOperator = «Caret»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_bit_x_or_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, Self::scan_caret, TokenKind::Caret) } @@ -1010,7 +1010,7 @@ impl Language { // (* v0.4.11 *) // Block = «OpenBrace» Statement* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_block_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_brace, TokenKind::OpenBrace) @@ -1072,7 +1072,7 @@ impl Language { // (* v0.8.0 *) // Block = «OpenBrace» (Statement | UncheckedBlock)* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_block_0_8_0(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_brace, TokenKind::OpenBrace) @@ -1161,7 +1161,7 @@ impl Language { // BooleanLiteral = «TrueKeyword» | «FalseKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_boolean_literal_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -1197,7 +1197,7 @@ impl Language { // BreakStatement = «BreakKeyword» «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_break_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia( @@ -1240,7 +1240,7 @@ impl Language { // (* v0.6.0 *) // CatchClause = «CatchKeyword» («Identifier»? ParameterList)? Block; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_catch_clause_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -1367,7 +1367,7 @@ impl Language { // ConditionalOperator = «QuestionMark» Expression «Colon» Expression; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_conditional_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -1435,7 +1435,7 @@ impl Language { // ConstantDefinition = TypeName «ConstantKeyword» «Identifier» «Equal» Expression «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_constant_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -1549,7 +1549,7 @@ impl Language { // (* v0.4.22 *) // ConstructorAttribute = ModifierInvocation | «InternalKeyword» | «PayableKeyword» | «PublicKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_constructor_attribute_0_4_22(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -1616,7 +1616,7 @@ impl Language { // (* v0.4.22 *) // ConstructorDefinition = «ConstructorKeyword» ParameterList ConstructorAttribute* Block; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_constructor_definition_0_4_22(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -1718,7 +1718,7 @@ impl Language { // ContinueStatement = «ContinueKeyword» «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_continue_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia( @@ -1769,7 +1769,7 @@ impl Language { // | ErrorDefinition // | StateVariableDeclaration; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_contract_body_element_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -1836,7 +1836,7 @@ impl Language { // | ErrorDefinition // | StateVariableDeclaration; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_contract_body_element_0_4_22(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -1909,7 +1909,7 @@ impl Language { // | ErrorDefinition // | StateVariableDeclaration; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_contract_body_element_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -1988,7 +1988,7 @@ impl Language { // | ErrorDefinition // | StateVariableDeclaration; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_contract_body_element_0_8_8(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2073,13 +2073,12 @@ impl Language { #[inline] pub(crate) fn parse_contract_body_element(&self, stream: &mut Stream) -> ParserResult { self.dispatch_parse_contract_body_element(stream) - .with_kind(RuleKind::ContractBodyElement) } // (* v0.4.11 *) // ContractDefinition = «ContractKeyword» «Identifier» InheritanceSpecifierList? «OpenBrace» ContractBodyElement* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_contract_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -2216,7 +2215,7 @@ impl Language { // (* v0.6.0 *) // ContractDefinition = «AbstractKeyword»? «ContractKeyword» «Identifier» InheritanceSpecifierList? «OpenBrace» ContractBodyElement* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_contract_definition_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -2396,7 +2395,7 @@ impl Language { // (* v0.4.11 *) // DataLocation = «MemoryKeyword» | «StorageKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_data_location_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2427,7 +2426,7 @@ impl Language { // (* v0.5.0 *) // DataLocation = «MemoryKeyword» | «StorageKeyword» | «CalldataKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_data_location_0_5_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2488,7 +2487,7 @@ impl Language { // | LibraryDefinition // | StructDefinition; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2549,7 +2548,7 @@ impl Language { // | StructDefinition // | UserDefinedValueTypeDefinition; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_definition_0_8_8(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2620,7 +2619,7 @@ impl Language { // DeleteStatement = «DeleteKeyword» Expression «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_delete_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -2690,7 +2689,7 @@ impl Language { // Directive = PragmaDirective | ImportDirective | UsingDirective; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_directive_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2723,7 +2722,7 @@ impl Language { // DoWhileStatement = «DoKeyword» Statement «WhileKeyword» «OpenParen» Expression «CloseParen» «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_do_while_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -2867,7 +2866,7 @@ impl Language { // | «SignedFixedType» // | «UnsignedFixedType»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_elementary_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2966,7 +2965,7 @@ impl Language { // | «SignedFixedType» // | «UnsignedFixedType»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_elementary_type_0_8_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -3066,7 +3065,7 @@ impl Language { // (* v0.4.21 *) // EmitStatement = «EmitKeyword» IdentifierPath ArgumentList «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_emit_statement_0_4_21(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -3160,7 +3159,7 @@ impl Language { // EndOfFileTrivia = («Whitespace» | «EndOfLine» | «MultilineComment» | «SingleLineComment»)+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_end_of_file_trivia_0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut result = Vec::new(); @@ -3224,7 +3223,7 @@ impl Language { // EnumDefinition = «EnumKeyword» «Identifier» «OpenBrace» («Identifier» («Comma» «Identifier»)*)? «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_enum_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -3363,7 +3362,7 @@ impl Language { // EqualityComparisonOperator = «EqualEqual» | «BangEqual»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_equality_comparison_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -3396,7 +3395,7 @@ impl Language { // ErrorDefinition = «ErrorKeyword» «Identifier» «OpenParen» (ErrorParameter («Comma» ErrorParameter)*)? «CloseParen» «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_error_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -3558,7 +3557,7 @@ impl Language { // ErrorParameter = TypeName «Identifier»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_error_parameter_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -3615,7 +3614,7 @@ impl Language { // EventDefinition = «EventKeyword» «Identifier» «OpenParen» (EventParameter («Comma» EventParameter)*)? «CloseParen» «AnonymousKeyword»? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_event_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -3806,7 +3805,7 @@ impl Language { // EventParameter = TypeName «IndexedKeyword»? «Identifier»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_event_parameter_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -3890,7 +3889,7 @@ impl Language { // ExperimentalPragma = «ExperimentalKeyword» «Identifier»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_experimental_pragma_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -3939,7 +3938,7 @@ impl Language { // ExponentiationOperator = «AsteriskAsterisk»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_exponentiation_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia( stream, @@ -3993,7 +3992,7 @@ impl Language { // MemberAccessExpression = Expression MemberAccessOperator; // IndexAccessExpression = Expression IndexAccessOperator; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { { enum Pratt { @@ -4445,7 +4444,7 @@ impl Language { // MemberAccessExpression = Expression MemberAccessOperator; // IndexAccessExpression = Expression IndexAccessOperator; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_expression_0_6_0(&self, stream: &mut Stream) -> ParserResult { { enum Pratt { @@ -4874,7 +4873,7 @@ impl Language { // ExpressionStatement = Expression «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_expression_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_expression(stream) { @@ -4919,7 +4918,7 @@ impl Language { // | «ViewKeyword» // | «VirtualKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_fallback_function_attribute_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -5012,7 +5011,7 @@ impl Language { // (* v0.6.0 *) // FallbackFunctionDefinition = «FallbackKeyword» ParameterList FallbackFunctionAttribute* («ReturnsKeyword» ParameterList)? («Semicolon» | Block); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_fallback_function_definition_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -5195,7 +5194,7 @@ impl Language { // ForStatement = «ForKeyword» «OpenParen» (SimpleStatement | «Semicolon») (ExpressionStatement | «Semicolon») Expression? «CloseParen» Statement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_for_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -5393,7 +5392,7 @@ impl Language { // | «PureKeyword» // | «ViewKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_attribute_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -5496,7 +5495,7 @@ impl Language { // | «PureKeyword» // | «ViewKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_attribute_0_5_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -5591,7 +5590,7 @@ impl Language { // | «ViewKeyword» // | «VirtualKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_attribute_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -5702,7 +5701,7 @@ impl Language { // (* v0.4.11 *) // FunctionCallOperator = ArgumentList; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_call_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -5727,7 +5726,7 @@ impl Language { // (* v0.6.2 *) // FunctionCallOperator = FunctionCallOptions* ArgumentList; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_call_operator_0_6_2(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -5782,7 +5781,7 @@ impl Language { // (* v0.8.0 *) // FunctionCallOperator = FunctionCallOptions? ArgumentList; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_call_operator_0_8_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -5846,7 +5845,7 @@ impl Language { // (* v0.6.2 *) // FunctionCallOptions = «OpenBrace» (NamedArgument («Comma» NamedArgument)*)? «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_call_options_0_6_2(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_brace, TokenKind::OpenBrace) @@ -5947,7 +5946,7 @@ impl Language { // FunctionDefinition = «FunctionKeyword» («Identifier» | «FallbackKeyword» | «ReceiveKeyword») ParameterList FunctionAttribute* («ReturnsKeyword» ParameterList)? («Semicolon» | Block); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -6154,7 +6153,7 @@ impl Language { // FunctionType = «FunctionKeyword» ParameterList («InternalKeyword» | «ExternalKeyword» | «PrivateKeyword» | «PublicKeyword» | «PureKeyword» | «ViewKeyword» | «PayableKeyword»)* («ReturnsKeyword» ParameterList)?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -6354,7 +6353,7 @@ impl Language { // IdentifierPath = «Identifier» («Period» «Identifier»)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_identifier_path_0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut result = Vec::new(); @@ -6396,7 +6395,7 @@ impl Language { // IfStatement = «IfKeyword» «OpenParen» Expression «CloseParen» Statement («ElseKeyword» Statement)?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_if_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -6545,7 +6544,7 @@ impl Language { // ImportAlias = «AsKeyword» «Identifier»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_import_alias_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -6594,7 +6593,7 @@ impl Language { // ImportDirective = «ImportKeyword» (SimpleImport | AsteriskImport | SelectiveImport) «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_import_directive_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -6684,7 +6683,7 @@ impl Language { // ImportPath = «AsciiStringLiteral»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_import_path_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia( stream, @@ -6701,7 +6700,7 @@ impl Language { // IndexAccessOperator = «OpenBracket» ((Expression («Colon» Expression?)?) | («Colon» Expression?)) «CloseBracket»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_index_access_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia( @@ -6907,7 +6906,7 @@ impl Language { // InheritanceSpecifier = IdentifierPath ArgumentList?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_inheritance_specifier_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -6960,7 +6959,7 @@ impl Language { // InheritanceSpecifierList = «IsKeyword» InheritanceSpecifier («Comma» InheritanceSpecifier)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_inheritance_specifier_list_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7030,7 +7029,7 @@ impl Language { // InterfaceDefinition = «InterfaceKeyword» «Identifier» InheritanceSpecifierList? «OpenBrace» ContractBodyElement* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_interface_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7170,7 +7169,7 @@ impl Language { // LeadingTrivia = («Whitespace» | «EndOfLine» | «MultilineComment» | «SingleLineComment»)+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_leading_trivia_0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut result = Vec::new(); @@ -7234,7 +7233,7 @@ impl Language { // LibraryDefinition = «LibraryKeyword» «Identifier» «OpenBrace» ContractBodyElement* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_library_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7352,7 +7351,7 @@ impl Language { // (* v0.4.11 *) // MappingKeyType = (ElementaryType | IdentifierPath); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_mapping_key_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7392,7 +7391,7 @@ impl Language { // (* v0.8.18 *) // MappingKeyType = (ElementaryType | IdentifierPath) «Identifier»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_mapping_key_type_0_8_18(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7472,7 +7471,7 @@ impl Language { // MappingType = «MappingKeyword» «OpenParen» MappingKeyType «EqualGreaterThan» MappingValueType «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_mapping_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7604,7 +7603,7 @@ impl Language { // (* v0.4.11 *) // MappingValueType = TypeName; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_mapping_value_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7629,7 +7628,7 @@ impl Language { // (* v0.8.18 *) // MappingValueType = TypeName «Identifier»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_mapping_value_type_0_8_18(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7694,7 +7693,7 @@ impl Language { // MemberAccessOperator = «Period» («Identifier» | «AddressKeyword»); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_member_access_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7760,7 +7759,7 @@ impl Language { // (* v0.4.11 *) // ModifierAttribute = OverrideSpecifier; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_modifier_attribute_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_override_specifier(stream) } @@ -7768,7 +7767,7 @@ impl Language { // (* v0.6.0 *) // ModifierAttribute = OverrideSpecifier | «VirtualKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_modifier_attribute_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -7808,7 +7807,7 @@ impl Language { // ModifierDefinition = «ModifierKeyword» «Identifier» ParameterList? ModifierAttribute* («Semicolon» | Block); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_modifier_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7942,7 +7941,7 @@ impl Language { // ModifierInvocation = IdentifierPath ArgumentList?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_modifier_invocation_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7995,7 +7994,7 @@ impl Language { // MulDivModOperator = «Asterisk» | «Slash» | «Percent»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_mul_div_mod_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8028,7 +8027,7 @@ impl Language { // NamedArgument = «Identifier» «Colon» Expression; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_named_argument_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -8085,7 +8084,7 @@ impl Language { // NamedArgumentList = «OpenBrace» (NamedArgument («Comma» NamedArgument)*)? «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_named_argument_list_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_brace, TokenKind::OpenBrace) @@ -8170,7 +8169,7 @@ impl Language { // NewExpression = «NewKeyword» TypeName; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_new_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -8225,7 +8224,7 @@ impl Language { // | «WeiKeyword» // | «YearsKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_number_unit_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8336,7 +8335,7 @@ impl Language { // | «WeeksKeyword» // | «WeiKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_number_unit_0_5_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8439,7 +8438,7 @@ impl Language { // | «WeeksKeyword» // | «WeiKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_number_unit_0_6_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8549,7 +8548,7 @@ impl Language { // | «WeeksKeyword» // | «WeiKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_number_unit_0_7_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8652,7 +8651,7 @@ impl Language { // (* v0.4.11 *) // NumericExpression = («HexLiteral» | «DecimalLiteral») NumberUnit?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_numeric_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -8723,7 +8722,7 @@ impl Language { // (* v0.5.0 *) // NumericExpression = «HexLiteral» | («DecimalLiteral» NumberUnit?); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_numeric_expression_0_5_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8807,7 +8806,7 @@ impl Language { // OrOperator = «BarBar»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_or_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, Self::scan_bar_bar, TokenKind::BarBar) } @@ -8820,7 +8819,7 @@ impl Language { // OrderComparisonOperator = «LessThan» | «GreaterThan» | «LessThanEqual» | «GreaterThanEqual»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_order_comparison_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8870,7 +8869,7 @@ impl Language { // OverrideSpecifier = «OverrideKeyword» («OpenParen» IdentifierPath («Comma» IdentifierPath)* «CloseParen»)?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_override_specifier_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -8990,7 +8989,7 @@ impl Language { // ParameterDeclaration = TypeName DataLocation? «Identifier»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_parameter_declaration_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -9070,7 +9069,7 @@ impl Language { // ParameterList = «OpenParen» (ParameterDeclaration («Comma» ParameterDeclaration)*)? «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_parameter_list_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_paren, TokenKind::OpenParen) @@ -9155,7 +9154,7 @@ impl Language { // PayableType = «PayableKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_payable_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia( stream, @@ -9172,7 +9171,7 @@ impl Language { // PositionalArgumentList = Expression («Comma» Expression)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_positional_argument_list_0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut result = Vec::new(); @@ -9210,7 +9209,7 @@ impl Language { // PragmaDirective = «PragmaKeyword» (VersionPragma | ABICoderPragma | ExperimentalPragma) «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_pragma_directive_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -9308,7 +9307,7 @@ impl Language { // | ElementaryType // | «Identifier»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_primary_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -9370,7 +9369,7 @@ impl Language { // | ElementaryType // | «Identifier»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_primary_expression_0_5_3(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -9447,7 +9446,7 @@ impl Language { // | «PayableKeyword» // | «VirtualKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_receive_function_attribute_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -9522,7 +9521,7 @@ impl Language { // (* v0.6.0 *) // ReceiveFunctionDefinition = «ReceiveKeyword» ParameterList ReceiveFunctionAttribute* («Semicolon» | Block); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_receive_function_definition_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -9646,7 +9645,7 @@ impl Language { // ReturnStatement = «ReturnKeyword» Expression? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_return_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -9728,7 +9727,7 @@ impl Language { // RevertStatement = «RevertKeyword» IdentifierPath? ArgumentList «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_revert_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -9821,7 +9820,7 @@ impl Language { // SelectiveImport = «OpenBrace» «Identifier» ImportAlias? («Comma» «Identifier» ImportAlias?)* «CloseBrace» «FromKeyword» ImportPath; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_selective_import_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -9992,7 +9991,7 @@ impl Language { // ShiftOperator = «LessThanLessThan» | «GreaterThanGreaterThan» | «GreaterThanGreaterThanGreaterThan»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_shift_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10037,7 +10036,7 @@ impl Language { // SimpleImport = ImportPath ImportAlias?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_simple_import_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -10090,7 +10089,7 @@ impl Language { // SimpleStatement = TupleDeconstructionStatement | VariableDeclarationStatement | ExpressionStatement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_simple_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10123,7 +10122,7 @@ impl Language { // SourceUnit = (Directive | Definition)* EndOfFileTrivia?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_source_unit_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -10215,7 +10214,7 @@ impl Language { // | «PrivateKeyword» // | «PublicKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_state_variable_attribute_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10274,7 +10273,7 @@ impl Language { // | «PrivateKeyword» // | «PublicKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_state_variable_attribute_0_6_5(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10350,7 +10349,7 @@ impl Language { // StateVariableDeclaration = TypeName StateVariableAttribute* «Identifier» («Equal» Expression)? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_state_variable_declaration_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -10522,7 +10521,7 @@ impl Language { // | DeleteStatement // | AssemblyStatement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10613,7 +10612,7 @@ impl Language { // | DeleteStatement // | AssemblyStatement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_statement_0_4_21(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10708,7 +10707,7 @@ impl Language { // | DeleteStatement // | AssemblyStatement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_statement_0_5_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10799,7 +10798,7 @@ impl Language { // | DeleteStatement // | AssemblyStatement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_statement_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10900,7 +10899,7 @@ impl Language { // (* v0.4.11 *) // StringExpression = «HexStringLiteral»+ | «AsciiStringLiteral»+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_string_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10967,7 +10966,7 @@ impl Language { // (* v0.7.0 *) // StringExpression = «HexStringLiteral»+ | «AsciiStringLiteral»+ | «UnicodeStringLiteral»+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_string_expression_0_7_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -11074,7 +11073,7 @@ impl Language { // StructDefinition = «StructKeyword» «Identifier» «OpenBrace» StructMember+ «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_struct_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -11190,7 +11189,7 @@ impl Language { // StructMember = TypeName «Identifier» «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_struct_member_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -11261,7 +11260,7 @@ impl Language { // (* v0.4.11 *) // ThrowStatement = «ThrowKeyword» «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_throw_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia( @@ -11316,7 +11315,7 @@ impl Language { // TrailingTrivia = «Whitespace»? «SingleLineComment»? «EndOfLine»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_trailing_trivia_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -11398,7 +11397,7 @@ impl Language { // (* v0.6.0 *) // TryStatement = «TryKeyword» Expression («ReturnsKeyword» ParameterList)? Block CatchClause+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_try_statement_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -11555,7 +11554,7 @@ impl Language { // TupleDeconstructionStatement = «OpenParen» (((TypeName DataLocation? «Identifier») | (DataLocation? «Identifier»))? («Comma» ((TypeName DataLocation? «Identifier») | (DataLocation? «Identifier»))?)*)? «CloseParen» «Equal» Expression «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_tuple_deconstruction_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -11887,7 +11886,7 @@ impl Language { // TupleExpression = «OpenParen» Expression? («Comma» Expression?)* «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_tuple_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_paren, TokenKind::OpenParen) @@ -11973,7 +11972,7 @@ impl Language { // (* v0.5.3 *) // TypeExpression = «TypeKeyword» «OpenParen» TypeName «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_type_expression_0_5_3(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -12068,7 +12067,7 @@ impl Language { // TypeName = ArrayTypeName | FunctionType | MappingType | ElementaryType | IdentifierPath; // ArrayTypeName = TypeName «OpenBracket» Expression? «CloseBracket»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_type_name_0_4_11(&self, stream: &mut Stream) -> ParserResult { { enum Pratt { @@ -12290,7 +12289,7 @@ impl Language { // UnaryPostfixOperator = «PlusPlus» | «MinusMinus»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_unary_postfix_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -12328,7 +12327,7 @@ impl Language { // | «Minus» // | «Plus»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_unary_prefix_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -12379,7 +12378,7 @@ impl Language { // | «Bang» // | «Minus»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_unary_prefix_operator_0_5_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -12435,7 +12434,7 @@ impl Language { // (* v0.8.0 *) // UncheckedBlock = «UncheckedKeyword» Block; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_unchecked_block_0_8_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -12499,7 +12498,7 @@ impl Language { // | «PureKeyword» // | «ViewKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_unnamed_function_attribute_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -12583,7 +12582,7 @@ impl Language { // (* v0.4.11 *) // UnnamedFunctionDefinition = «FunctionKeyword» ParameterList UnnamedFunctionAttribute* («Semicolon» | Block); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_unnamed_function_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -12722,7 +12721,7 @@ impl Language { // | «Asterisk» // | «Tilde»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_user_defined_operator_0_8_19(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -12849,7 +12848,7 @@ impl Language { // (* v0.8.8 *) // UserDefinedValueTypeDefinition = «TypeKeyword» «Identifier» «IsKeyword» ElementaryType «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_user_defined_value_type_definition_0_8_8(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -12974,7 +12973,7 @@ impl Language { // (* v0.4.11 *) // UsingDirective = «UsingKeyword» (IdentifierPath | («OpenBrace» IdentifierPath («Comma» IdentifierPath)* «CloseBrace»)) «ForKeyword» («Asterisk» | TypeName) «GlobalKeyword»? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_using_directive_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -13193,7 +13192,7 @@ impl Language { // (* v0.8.19 *) // UsingDirective = «UsingKeyword» (IdentifierPath | («OpenBrace» IdentifierPath («AsKeyword» UserDefinedOperator)? («Comma» IdentifierPath («AsKeyword» UserDefinedOperator)?)* «CloseBrace»)) «ForKeyword» («Asterisk» | TypeName) «GlobalKeyword»? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_using_directive_0_8_19(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -13526,7 +13525,7 @@ impl Language { // (* v0.4.11 *) // VariableDeclarationStatement = ((TypeName DataLocation?) | «VarKeyword») «Identifier» («Equal» Expression)? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_variable_declaration_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -13709,7 +13708,7 @@ impl Language { // (* v0.5.0 *) // VariableDeclarationStatement = TypeName DataLocation? «Identifier» («Equal» Expression)? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_variable_declaration_statement_0_5_0(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -13869,7 +13868,7 @@ impl Language { // VersionPragma = «SolidityKeyword» VersionPragmaExpression+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_version_pragma_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -13906,7 +13905,9 @@ impl Language { Pass { builder, .. } => result.push(builder), } } - } { + } + .with_kind(RuleKind::VersionPragmaExpressionList) + { Pass { builder, error } => { furthest_error = error.map(|error| error.maybe_merge_with(furthest_error)); builder @@ -13935,7 +13936,7 @@ impl Language { // VersionPragmaRange = VersionPragmaExpression «Minus» VersionPragmaExpression; // VersionPragmaComparator = («Caret» | «Tilde» | «Equal» | «LessThan» | «GreaterThan» | «LessThanEqual» | «GreaterThanEqual») VersionPragmaExpression; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_version_pragma_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { { enum Pratt { @@ -14191,12 +14192,11 @@ impl Language { #[inline] pub(crate) fn parse_version_pragma_expression(&self, stream: &mut Stream) -> ParserResult { self.parse_version_pragma_expression_0_4_11(stream) - .with_kind(RuleKind::VersionPragmaExpression) } // VersionPragmaSpecifier = «VersionPragmaValue» («Period» «VersionPragmaValue»)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_version_pragma_specifier_0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut result = Vec::new(); @@ -14238,7 +14238,7 @@ impl Language { // WhileStatement = «WhileKeyword» «OpenParen» Expression «CloseParen» Statement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_while_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -14330,7 +14330,7 @@ impl Language { // YulAssignmentStatement = YulIdentifierPath («Comma» YulIdentifierPath)* «ColonEqual» YulExpression; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_assignment_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -14411,7 +14411,7 @@ impl Language { // YulBlock = «OpenBrace» YulStatement* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_block_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_brace, TokenKind::OpenBrace) @@ -14478,7 +14478,7 @@ impl Language { // YulBreakStatement = «BreakKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_break_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, Self::scan_break_keyword, TokenKind::BreakKeyword) } @@ -14491,7 +14491,7 @@ impl Language { // YulContinueStatement = «ContinueKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_continue_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia( stream, @@ -14508,7 +14508,7 @@ impl Language { // YulDeclarationStatement = «LetKeyword» YulIdentifierPath («Comma» YulIdentifierPath)* («ColonEqual» YulExpression)?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_declaration_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -14636,7 +14636,7 @@ impl Language { // YulExpression = YulFunctionCallExpression | YulLiteral | YulIdentifierPath; // YulFunctionCallExpression = YulExpression «OpenParen» (YulExpression («Comma» YulExpression)*)? «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { { enum Pratt { @@ -14877,7 +14877,7 @@ impl Language { // YulForStatement = «ForKeyword» YulBlock YulExpression YulBlock YulBlock; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_for_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -14957,7 +14957,7 @@ impl Language { // YulFunctionDefinition = «FunctionKeyword» «YulIdentifier» «OpenParen» («YulIdentifier» («Comma» «YulIdentifier»)*)? «CloseParen» («MinusGreaterThan» «YulIdentifier» («Comma» «YulIdentifier»)*)? YulBlock; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_function_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -15199,7 +15199,7 @@ impl Language { // YulIdentifierPath = «YulIdentifier» («Period» «YulIdentifier»)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_identifier_path_0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut result = Vec::new(); @@ -15241,7 +15241,7 @@ impl Language { // YulIfStatement = «IfKeyword» YulExpression YulBlock; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_if_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -15298,7 +15298,7 @@ impl Language { // (* v0.6.0 *) // YulLeaveStatement = «LeaveKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_leave_statement_0_6_0(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, Self::scan_leave_keyword, TokenKind::LeaveKeyword) } @@ -15331,7 +15331,7 @@ impl Language { // | «HexStringLiteral» // | «AsciiStringLiteral»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_literal_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -15400,7 +15400,7 @@ impl Language { // | YulContinueStatement // | YulExpression; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -15473,7 +15473,7 @@ impl Language { // | YulContinueStatement // | YulExpression; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_statement_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -15554,7 +15554,7 @@ impl Language { // YulSwitchStatement = «SwitchKeyword» YulExpression (((«CaseKeyword» YulLiteral) | «DefaultKeyword») YulBlock)+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_switch_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; diff --git a/crates/solidity/outputs/cargo/crate/src/generated/scanners.rs b/crates/solidity/outputs/cargo/crate/src/generated/scanners.rs index a24d26f312..c02f4690e0 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/scanners.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/scanners.rs @@ -171,7 +171,7 @@ macro_rules! scan_not_followed_by { impl Language { // «AbicoderKeyword» = "abicoder"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_abicoder_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -185,6 +185,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_abicoder_keyword(&self, stream: &mut Stream) -> bool { self.scan_abicoder_keyword_0_4_11(stream) } @@ -192,7 +193,7 @@ impl Language { // (* v0.6.0 *) // «AbstractKeyword» = "abstract"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_abstract_keyword_0_6_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -214,11 +215,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_abstract_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_abstract_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_abstract_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_abstract_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -226,7 +229,7 @@ impl Language { // «AddressKeyword» = "address"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_address_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -240,13 +243,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_address_keyword(&self, stream: &mut Stream) -> bool { self.scan_address_keyword_0_4_11(stream) } // «Ampersand» = "&"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_ampersand_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -256,37 +260,40 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_ampersand(&self, stream: &mut Stream) -> bool { self.scan_ampersand_0_4_11(stream) } // «AmpersandAmpersand» = "&&"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_ampersand_ampersand_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '&', '&') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_ampersand_ampersand(&self, stream: &mut Stream) -> bool { self.scan_ampersand_ampersand_0_4_11(stream) } // «AmpersandEqual» = "&="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_ampersand_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '&', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_ampersand_equal(&self, stream: &mut Stream) -> bool { self.scan_ampersand_equal_0_4_11(stream) } // «AnonymousKeyword» = "anonymous"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_anonymous_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -300,13 +307,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_anonymous_keyword(&self, stream: &mut Stream) -> bool { self.scan_anonymous_keyword_0_4_11(stream) } // «AsKeyword» = "as"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_as_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -320,6 +328,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_as_keyword(&self, stream: &mut Stream) -> bool { self.scan_as_keyword_0_4_11(stream) } @@ -333,7 +342,7 @@ impl Language { // | "\n" // | "\r"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_ascii_escape_0_4_11(&self, stream: &mut Stream) -> bool { scan_predicate!(stream, |c| c == '\n' || c == '\r' @@ -346,13 +355,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_ascii_escape(&self, stream: &mut Stream) -> bool { self.scan_ascii_escape_0_4_11(stream) } // «AsciiStringLiteral» = «SingleQuotedAsciiStringLiteral» | «DoubleQuotedAsciiStringLiteral»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_ascii_string_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_choice!( stream, @@ -362,13 +372,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_ascii_string_literal(&self, stream: &mut Stream) -> bool { self.scan_ascii_string_literal_0_4_11(stream) } // «AssemblyKeyword» = "assembly"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_assembly_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -382,13 +393,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_assembly_keyword(&self, stream: &mut Stream) -> bool { self.scan_assembly_keyword_0_4_11(stream) } // «Asterisk» = "*"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_asterisk_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -398,61 +410,66 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_asterisk(&self, stream: &mut Stream) -> bool { self.scan_asterisk_0_4_11(stream) } // «AsteriskAsterisk» = "**"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_asterisk_asterisk_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '*', '*') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_asterisk_asterisk(&self, stream: &mut Stream) -> bool { self.scan_asterisk_asterisk_0_4_11(stream) } // «AsteriskEqual» = "*="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_asterisk_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '*', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_asterisk_equal(&self, stream: &mut Stream) -> bool { self.scan_asterisk_equal_0_4_11(stream) } // «Bang» = "!"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_bang_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!(stream, scan_chars!(stream, '!'), scan_chars!(stream, '=')) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_bang(&self, stream: &mut Stream) -> bool { self.scan_bang_0_4_11(stream) } // «BangEqual» = "!="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_bang_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '!', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_bang_equal(&self, stream: &mut Stream) -> bool { self.scan_bang_equal_0_4_11(stream) } // «Bar» = "|"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_bar_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -462,37 +479,40 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_bar(&self, stream: &mut Stream) -> bool { self.scan_bar_0_4_11(stream) } // «BarBar» = "||"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_bar_bar_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '|', '|') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_bar_bar(&self, stream: &mut Stream) -> bool { self.scan_bar_bar_0_4_11(stream) } // «BarEqual» = "|="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_bar_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '|', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_bar_equal(&self, stream: &mut Stream) -> bool { self.scan_bar_equal_0_4_11(stream) } // «BoolKeyword» = "bool"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_bool_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -506,13 +526,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_bool_keyword(&self, stream: &mut Stream) -> bool { self.scan_bool_keyword_0_4_11(stream) } // «BreakKeyword» = "break"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_break_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -526,6 +547,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_break_keyword(&self, stream: &mut Stream) -> bool { self.scan_break_keyword_0_4_11(stream) } @@ -533,7 +555,7 @@ impl Language { // (* v0.4.11 *) // «ByteType» = "byte"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_byte_type_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -555,11 +577,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_byte_type(&self, stream: &mut Stream) -> Option { self.dispatch_scan_byte_type(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_byte_type(&self, stream: &mut Stream) -> bool { self.dispatch_scan_byte_type(stream) .expect("Validation should have checked that references are valid between versions") @@ -568,7 +592,7 @@ impl Language { // (* v0.5.0 *) // «CalldataKeyword» = "calldata"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_calldata_keyword_0_5_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -590,11 +614,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_calldata_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_calldata_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_calldata_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_calldata_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -602,31 +628,33 @@ impl Language { // «Caret» = "^"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_caret_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!(stream, scan_chars!(stream, '^'), scan_chars!(stream, '=')) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_caret(&self, stream: &mut Stream) -> bool { self.scan_caret_0_4_11(stream) } // «CaretEqual» = "^="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_caret_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '^', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_caret_equal(&self, stream: &mut Stream) -> bool { self.scan_caret_equal_0_4_11(stream) } // «CaseKeyword» = "case"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_case_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -640,6 +668,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_case_keyword(&self, stream: &mut Stream) -> bool { self.scan_case_keyword_0_4_11(stream) } @@ -647,7 +676,7 @@ impl Language { // (* v0.6.0 *) // «CatchKeyword» = "catch"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_catch_keyword_0_6_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -669,11 +698,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_catch_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_catch_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_catch_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_catch_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -681,79 +712,85 @@ impl Language { // «CloseBrace» = "}"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_close_brace_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '}') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_close_brace(&self, stream: &mut Stream) -> bool { self.scan_close_brace_0_4_11(stream) } // «CloseBracket» = "]"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_close_bracket_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, ']') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_close_bracket(&self, stream: &mut Stream) -> bool { self.scan_close_bracket_0_4_11(stream) } // «CloseParen» = ")"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_close_paren_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, ')') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_close_paren(&self, stream: &mut Stream) -> bool { self.scan_close_paren_0_4_11(stream) } // «Colon» = ":"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_colon_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!(stream, scan_chars!(stream, ':'), scan_chars!(stream, '=')) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_colon(&self, stream: &mut Stream) -> bool { self.scan_colon_0_4_11(stream) } // «ColonEqual» = ":="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_colon_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, ':', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_colon_equal(&self, stream: &mut Stream) -> bool { self.scan_colon_equal_0_4_11(stream) } // «Comma» = ","; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_comma_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, ',') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_comma(&self, stream: &mut Stream) -> bool { self.scan_comma_0_4_11(stream) } // «ConstantKeyword» = "constant"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_constant_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -767,6 +804,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_constant_keyword(&self, stream: &mut Stream) -> bool { self.scan_constant_keyword_0_4_11(stream) } @@ -774,7 +812,7 @@ impl Language { // (* v0.4.22 *) // «ConstructorKeyword» = "constructor"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_constructor_keyword_0_4_22(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -796,11 +834,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_constructor_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_constructor_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_constructor_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_constructor_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -808,7 +848,7 @@ impl Language { // «ContinueKeyword» = "continue"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_continue_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -822,13 +862,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_continue_keyword(&self, stream: &mut Stream) -> bool { self.scan_continue_keyword_0_4_11(stream) } // «ContractKeyword» = "contract"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_contract_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -842,13 +883,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_contract_keyword(&self, stream: &mut Stream) -> bool { self.scan_contract_keyword_0_4_11(stream) } // «DaysKeyword» = "days"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_days_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -862,13 +904,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_days_keyword(&self, stream: &mut Stream) -> bool { self.scan_days_keyword_0_4_11(stream) } // «DecimalExponent» = ("e" | "E") "-"? «DecimalNumber»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_decimal_exponent_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_predicate!(stream, |c| c == 'E' || c == 'e'), @@ -878,6 +921,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_decimal_exponent(&self, stream: &mut Stream) -> bool { self.scan_decimal_exponent_0_4_11(stream) } @@ -885,7 +929,7 @@ impl Language { // (* v0.4.11 *) // «DecimalLiteral» = ((«DecimalNumber» ("." «DecimalNumber»?)?) | ("." «DecimalNumber»)) «DecimalExponent»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_decimal_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_choice!( @@ -909,7 +953,7 @@ impl Language { // (* v0.5.0 *) // «DecimalLiteral» = ((«DecimalNumber» ("." «DecimalNumber»)?) | ("." «DecimalNumber»)) «DecimalExponent»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_decimal_literal_0_5_0(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_choice!( @@ -936,13 +980,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_decimal_literal(&self, stream: &mut Stream) -> bool { self.dispatch_scan_decimal_literal(stream) } // «DecimalNumber» = ("0"…"9")+ ("_" ("0"…"9")+)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_decimal_number_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))), @@ -957,13 +1002,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_decimal_number(&self, stream: &mut Stream) -> bool { self.scan_decimal_number_0_4_11(stream) } // «DefaultKeyword» = "default"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_default_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -977,13 +1023,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_default_keyword(&self, stream: &mut Stream) -> bool { self.scan_default_keyword_0_4_11(stream) } // «DeleteKeyword» = "delete"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_delete_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -997,13 +1044,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_delete_keyword(&self, stream: &mut Stream) -> bool { self.scan_delete_keyword_0_4_11(stream) } // «DoKeyword» = "do"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_do_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1017,13 +1065,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_do_keyword(&self, stream: &mut Stream) -> bool { self.scan_do_keyword_0_4_11(stream) } // «DoubleQuotedAsciiStringLiteral» = '"' («EscapeSequence» | ((" "…"~") - ('"' | "\\")))* '"'; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_double_quoted_ascii_string_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '"'), @@ -1042,6 +1091,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_double_quoted_ascii_string_literal(&self, stream: &mut Stream) -> bool { self.scan_double_quoted_ascii_string_literal_0_4_11(stream) } @@ -1049,7 +1099,7 @@ impl Language { // (* v0.7.0 *) // «DoubleQuotedUnicodeStringLiteral» = 'unicode"' («EscapeSequence» | !('"' | "\\" | "\n" | "\r"))* '"'; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_double_quoted_unicode_string_literal_0_7_0(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'u', 'n', 'i', 'c', 'o', 'd', 'e', '"'), @@ -1077,6 +1127,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_double_quoted_unicode_string_literal( &self, stream: &mut Stream, @@ -1085,6 +1136,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_double_quoted_unicode_string_literal(&self, stream: &mut Stream) -> bool { self.dispatch_scan_double_quoted_unicode_string_literal(stream) .expect("Validation should have checked that references are valid between versions") @@ -1092,7 +1144,7 @@ impl Language { // «ElseKeyword» = "else"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_else_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1106,6 +1158,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_else_keyword(&self, stream: &mut Stream) -> bool { self.scan_else_keyword_0_4_11(stream) } @@ -1113,7 +1166,7 @@ impl Language { // (* v0.4.21 *) // «EmitKeyword» = "emit"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_emit_keyword_0_4_21(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1135,11 +1188,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_emit_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_emit_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_emit_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_emit_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -1147,7 +1202,7 @@ impl Language { // «EndOfLine» = "\r"? "\n"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_end_of_line_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_optional!(stream, scan_chars!(stream, '\r')), @@ -1156,13 +1211,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_end_of_line(&self, stream: &mut Stream) -> bool { self.scan_end_of_line_0_4_11(stream) } // «EnumKeyword» = "enum"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_enum_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1176,13 +1232,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_enum_keyword(&self, stream: &mut Stream) -> bool { self.scan_enum_keyword_0_4_11(stream) } // «Equal» = "="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1192,37 +1249,40 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_equal(&self, stream: &mut Stream) -> bool { self.scan_equal_0_4_11(stream) } // «EqualEqual» = "=="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_equal_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '=', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_equal_equal(&self, stream: &mut Stream) -> bool { self.scan_equal_equal_0_4_11(stream) } // «EqualGreaterThan» = "=>"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_equal_greater_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '=', '>') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_equal_greater_than(&self, stream: &mut Stream) -> bool { self.scan_equal_greater_than_0_4_11(stream) } // «ErrorKeyword» = "error"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_error_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1236,13 +1296,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_error_keyword(&self, stream: &mut Stream) -> bool { self.scan_error_keyword_0_4_11(stream) } // «EscapeSequence» = "\\" («AsciiEscape» | «HexByteEscape» | «UnicodeEscape»); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_escape_sequence_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '\\'), @@ -1256,13 +1317,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_escape_sequence(&self, stream: &mut Stream) -> bool { self.scan_escape_sequence_0_4_11(stream) } // «EtherKeyword» = "ether"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_ether_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1276,13 +1338,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_ether_keyword(&self, stream: &mut Stream) -> bool { self.scan_ether_keyword_0_4_11(stream) } // «EventKeyword» = "event"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_event_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1296,25 +1359,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_event_keyword(&self, stream: &mut Stream) -> bool { self.scan_event_keyword_0_4_11(stream) } // «Evmasm» = '"evmasm"'; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_evmasm_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '"', 'e', 'v', 'm', 'a', 's', 'm', '"') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_evmasm(&self, stream: &mut Stream) -> bool { self.scan_evmasm_0_4_11(stream) } // «ExperimentalKeyword» = "experimental"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_experimental_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1328,13 +1393,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_experimental_keyword(&self, stream: &mut Stream) -> bool { self.scan_experimental_keyword_0_4_11(stream) } // «ExternalKeyword» = "external"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_external_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1348,13 +1414,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_external_keyword(&self, stream: &mut Stream) -> bool { self.scan_external_keyword_0_4_11(stream) } // «FallbackKeyword» = "fallback"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_fallback_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1368,13 +1435,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_fallback_keyword(&self, stream: &mut Stream) -> bool { self.scan_fallback_keyword_0_4_11(stream) } // «FalseKeyword» = "false"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_false_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1388,6 +1456,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_false_keyword(&self, stream: &mut Stream) -> bool { self.scan_false_keyword_0_4_11(stream) } @@ -1395,7 +1464,7 @@ impl Language { // (* v0.4.11 *) // «FinneyKeyword» = "finney"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_finney_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1417,11 +1486,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_finney_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_finney_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_finney_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_finney_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -1429,7 +1500,7 @@ impl Language { // «FixedBytesType» = "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"); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_fixed_bytes_type_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1460,13 +1531,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_fixed_bytes_type(&self, stream: &mut Stream) -> bool { self.scan_fixed_bytes_type_0_4_11(stream) } // «ForKeyword» = "for"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_for_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1480,13 +1552,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_for_keyword(&self, stream: &mut Stream) -> bool { self.scan_for_keyword_0_4_11(stream) } // «FromKeyword» = "from"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_from_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1500,13 +1573,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_from_keyword(&self, stream: &mut Stream) -> bool { self.scan_from_keyword_0_4_11(stream) } // «FunctionKeyword» = "function"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_function_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1520,13 +1594,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_function_keyword(&self, stream: &mut Stream) -> bool { self.scan_function_keyword_0_4_11(stream) } // «GlobalKeyword» = "global"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_global_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1540,13 +1615,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_global_keyword(&self, stream: &mut Stream) -> bool { self.scan_global_keyword_0_4_11(stream) } // «GreaterThan» = ">"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_greater_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1556,25 +1632,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_greater_than(&self, stream: &mut Stream) -> bool { self.scan_greater_than_0_4_11(stream) } // «GreaterThanEqual» = ">="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_greater_than_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '>', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_greater_than_equal(&self, stream: &mut Stream) -> bool { self.scan_greater_than_equal_0_4_11(stream) } // «GreaterThanGreaterThan» = ">>"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_greater_than_greater_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1584,25 +1662,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_greater_than_greater_than(&self, stream: &mut Stream) -> bool { self.scan_greater_than_greater_than_0_4_11(stream) } // «GreaterThanGreaterThanEqual» = ">>="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_greater_than_greater_than_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '>', '>', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_greater_than_greater_than_equal(&self, stream: &mut Stream) -> bool { self.scan_greater_than_greater_than_equal_0_4_11(stream) } // «GreaterThanGreaterThanGreaterThan» = ">>>"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_greater_than_greater_than_greater_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1612,13 +1692,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_greater_than_greater_than_greater_than(&self, stream: &mut Stream) -> bool { self.scan_greater_than_greater_than_greater_than_0_4_11(stream) } // «GreaterThanGreaterThanGreaterThanEqual» = ">>>="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_greater_than_greater_than_greater_than_equal_0_4_11( &self, stream: &mut Stream, @@ -1627,6 +1708,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_greater_than_greater_than_greater_than_equal( &self, stream: &mut Stream, @@ -1637,7 +1719,7 @@ impl Language { // (* v0.6.11 *) // «GweiKeyword» = "gwei"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_gwei_keyword_0_6_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1659,11 +1741,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_gwei_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_gwei_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_gwei_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_gwei_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -1671,7 +1755,7 @@ impl Language { // «HexByteEscape» = "x" «HexCharacter»{2,2}; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_hex_byte_escape_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'x'), @@ -1687,13 +1771,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_hex_byte_escape(&self, stream: &mut Stream) -> bool { self.scan_hex_byte_escape_0_4_11(stream) } // «HexCharacter» = ("0"…"9") | ("a"…"f") | ("A"…"F"); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_hex_character_0_4_11(&self, stream: &mut Stream) -> bool { scan_predicate!(stream, |c| ('0' <= c && c <= '9') || ('A' <= c && c <= 'F') @@ -1701,6 +1786,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_hex_character(&self, stream: &mut Stream) -> bool { self.scan_hex_character_0_4_11(stream) } @@ -1708,7 +1794,7 @@ impl Language { // (* v0.4.11 *) // «HexLiteral» = "0" ("x" | "X") «HexCharacter»+ ("_" «HexCharacter»+)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_hex_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '0'), @@ -1737,7 +1823,7 @@ impl Language { // (* v0.5.0 *) // «HexLiteral» = "0x" «HexCharacter»+ ("_" «HexCharacter»+)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_hex_literal_0_5_0(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '0', 'x'), @@ -1771,13 +1857,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_hex_literal(&self, stream: &mut Stream) -> bool { self.dispatch_scan_hex_literal(stream) } // «HexStringLiteral» = "hex" (('"' «PossiblySeparatedPairsOfHexDigits»? '"') | ("'" «PossiblySeparatedPairsOfHexDigits»? "'")); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_hex_string_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'h', 'e', 'x'), @@ -1804,13 +1891,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_hex_string_literal(&self, stream: &mut Stream) -> bool { self.scan_hex_string_literal_0_4_11(stream) } // «HoursKeyword» = "hours"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_hours_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1824,13 +1912,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_hours_keyword(&self, stream: &mut Stream) -> bool { self.scan_hours_keyword_0_4_11(stream) } // «Identifier» = «RawIdentifier» - («NotAnIdentifierInAnyVersion» | «NotAnIdentifierInSomeVersions» | «FixedBytesType» | «SignedFixedType» | «UnsignedFixedType» | «SignedIntegerType» | «UnsignedIntegerType»); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_identifier_0_4_11(&self, stream: &mut Stream) -> bool { scan_difference!( stream, @@ -2021,13 +2110,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_identifier(&self, stream: &mut Stream) -> bool { self.scan_identifier_0_4_11(stream) } // «IdentifierPart» = «IdentifierStart» | ("0"…"9"); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_identifier_part_0_4_11(&self, stream: &mut Stream) -> bool { scan_predicate!(stream, |c| c == '$' || ('0' <= c && c <= '9') @@ -2037,13 +2127,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_identifier_part(&self, stream: &mut Stream) -> bool { self.scan_identifier_part_0_4_11(stream) } // «IdentifierStart» = "_" | "$" | ("a"…"z") | ("A"…"Z"); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_identifier_start_0_4_11(&self, stream: &mut Stream) -> bool { scan_predicate!(stream, |c| c == '$' || ('A' <= c && c <= 'Z') @@ -2052,13 +2143,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_identifier_start(&self, stream: &mut Stream) -> bool { self.scan_identifier_start_0_4_11(stream) } // «IfKeyword» = "if"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_if_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2072,6 +2164,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_if_keyword(&self, stream: &mut Stream) -> bool { self.scan_if_keyword_0_4_11(stream) } @@ -2079,7 +2172,7 @@ impl Language { // (* v0.6.5 *) // «ImmutableKeyword» = "immutable"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_immutable_keyword_0_6_5(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2101,11 +2194,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_immutable_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_immutable_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_immutable_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_immutable_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -2113,7 +2208,7 @@ impl Language { // «ImportKeyword» = "import"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_import_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2127,13 +2222,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_import_keyword(&self, stream: &mut Stream) -> bool { self.scan_import_keyword_0_4_11(stream) } // «IndexedKeyword» = "indexed"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_indexed_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2147,13 +2243,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_indexed_keyword(&self, stream: &mut Stream) -> bool { self.scan_indexed_keyword_0_4_11(stream) } // «InterfaceKeyword» = "interface"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_interface_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2167,13 +2264,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_interface_keyword(&self, stream: &mut Stream) -> bool { self.scan_interface_keyword_0_4_11(stream) } // «InternalKeyword» = "internal"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_internal_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2187,13 +2285,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_internal_keyword(&self, stream: &mut Stream) -> bool { self.scan_internal_keyword_0_4_11(stream) } // «IsKeyword» = "is"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_is_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2207,6 +2306,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_is_keyword(&self, stream: &mut Stream) -> bool { self.scan_is_keyword_0_4_11(stream) } @@ -2214,7 +2314,7 @@ impl Language { // (* v0.6.0 *) // «LeaveKeyword» = "leave"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_leave_keyword_0_6_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2236,11 +2336,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_leave_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_leave_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_leave_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_leave_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -2248,7 +2350,7 @@ impl Language { // «LessThan» = "<"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_less_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2258,25 +2360,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_less_than(&self, stream: &mut Stream) -> bool { self.scan_less_than_0_4_11(stream) } // «LessThanEqual» = "<="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_less_than_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '<', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_less_than_equal(&self, stream: &mut Stream) -> bool { self.scan_less_than_equal_0_4_11(stream) } // «LessThanLessThan» = "<<"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_less_than_less_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2286,25 +2390,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_less_than_less_than(&self, stream: &mut Stream) -> bool { self.scan_less_than_less_than_0_4_11(stream) } // «LessThanLessThanEqual» = "<<="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_less_than_less_than_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '<', '<', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_less_than_less_than_equal(&self, stream: &mut Stream) -> bool { self.scan_less_than_less_than_equal_0_4_11(stream) } // «LetKeyword» = "let"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_let_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2318,13 +2424,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_let_keyword(&self, stream: &mut Stream) -> bool { self.scan_let_keyword_0_4_11(stream) } // «LibraryKeyword» = "library"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_library_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2338,13 +2445,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_library_keyword(&self, stream: &mut Stream) -> bool { self.scan_library_keyword_0_4_11(stream) } // «MappingKeyword» = "mapping"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_mapping_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2358,13 +2466,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_mapping_keyword(&self, stream: &mut Stream) -> bool { self.scan_mapping_keyword_0_4_11(stream) } // «MemoryKeyword» = "memory"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_memory_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2378,13 +2487,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_memory_keyword(&self, stream: &mut Stream) -> bool { self.scan_memory_keyword_0_4_11(stream) } // «Minus» = "-"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_minus_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2394,49 +2504,53 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_minus(&self, stream: &mut Stream) -> bool { self.scan_minus_0_4_11(stream) } // «MinusEqual» = "-="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_minus_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '-', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_minus_equal(&self, stream: &mut Stream) -> bool { self.scan_minus_equal_0_4_11(stream) } // «MinusGreaterThan» = "->"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_minus_greater_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '-', '>') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_minus_greater_than(&self, stream: &mut Stream) -> bool { self.scan_minus_greater_than_0_4_11(stream) } // «MinusMinus» = "--"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_minus_minus_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '-', '-') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_minus_minus(&self, stream: &mut Stream) -> bool { self.scan_minus_minus_0_4_11(stream) } // «MinutesKeyword» = "minutes"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_minutes_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2450,13 +2564,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_minutes_keyword(&self, stream: &mut Stream) -> bool { self.scan_minutes_keyword_0_4_11(stream) } // «ModifierKeyword» = "modifier"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_modifier_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2470,13 +2585,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_modifier_keyword(&self, stream: &mut Stream) -> bool { self.scan_modifier_keyword_0_4_11(stream) } // «MultilineComment» = "/*" (!"*" | ("*" !"/"))* "*/"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_multiline_comment_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '/', '*'), @@ -2496,13 +2612,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_multiline_comment(&self, stream: &mut Stream) -> bool { self.scan_multiline_comment_0_4_11(stream) } // «NewKeyword» = "new"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_new_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2516,6 +2633,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_new_keyword(&self, stream: &mut Stream) -> bool { self.scan_new_keyword_0_4_11(stream) } @@ -2594,7 +2712,7 @@ impl Language { // | "while" // | "years"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_not_an_identifier_in_any_version_0_4_11(&self, stream: &mut Stream) -> bool { scan_trie!( stream, @@ -2772,6 +2890,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_not_an_identifier_in_any_version(&self, stream: &mut Stream) -> bool { self.scan_not_an_identifier_in_any_version_0_4_11(stream) } @@ -2779,7 +2898,7 @@ impl Language { // (* v0.4.11 *) // «NotAnIdentifierInSomeVersions» = "finney" | "szabo"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_not_an_identifier_in_some_versions_0_4_11(&self, stream: &mut Stream) -> bool { scan_trie!( stream, @@ -2813,7 +2932,7 @@ impl Language { // | "typedef" // | "unchecked"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_not_an_identifier_in_some_versions_0_5_0(&self, stream: &mut Stream) -> bool { scan_trie!( stream, @@ -2895,7 +3014,7 @@ impl Language { // | "receive" // | "virtual"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_not_an_identifier_in_some_versions_0_6_0(&self, stream: &mut Stream) -> bool { scan_trie!( stream, @@ -2988,7 +3107,7 @@ impl Language { // | "virtual" // | "gwei"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_not_an_identifier_in_some_versions_0_7_0(&self, stream: &mut Stream) -> bool { scan_trie!( stream, @@ -3063,49 +3182,53 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_not_an_identifier_in_some_versions(&self, stream: &mut Stream) -> bool { self.dispatch_scan_not_an_identifier_in_some_versions(stream) } // «OpenBrace» = "{"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_open_brace_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '{') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_open_brace(&self, stream: &mut Stream) -> bool { self.scan_open_brace_0_4_11(stream) } // «OpenBracket» = "["; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_open_bracket_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '[') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_open_bracket(&self, stream: &mut Stream) -> bool { self.scan_open_bracket_0_4_11(stream) } // «OpenParen» = "("; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_open_paren_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '(') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_open_paren(&self, stream: &mut Stream) -> bool { self.scan_open_paren_0_4_11(stream) } // «OverrideKeyword» = "override"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_override_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3119,13 +3242,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_override_keyword(&self, stream: &mut Stream) -> bool { self.scan_override_keyword_0_4_11(stream) } // «PayableKeyword» = "payable"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_payable_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3139,49 +3263,53 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_payable_keyword(&self, stream: &mut Stream) -> bool { self.scan_payable_keyword_0_4_11(stream) } // «Percent» = "%"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_percent_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!(stream, scan_chars!(stream, '%'), scan_chars!(stream, '=')) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_percent(&self, stream: &mut Stream) -> bool { self.scan_percent_0_4_11(stream) } // «PercentEqual» = "%="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_percent_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '%', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_percent_equal(&self, stream: &mut Stream) -> bool { self.scan_percent_equal_0_4_11(stream) } // «Period» = "."; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_period_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '.') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_period(&self, stream: &mut Stream) -> bool { self.scan_period_0_4_11(stream) } // «Plus» = "+"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_plus_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3191,37 +3319,40 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_plus(&self, stream: &mut Stream) -> bool { self.scan_plus_0_4_11(stream) } // «PlusEqual» = "+="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_plus_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '+', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_plus_equal(&self, stream: &mut Stream) -> bool { self.scan_plus_equal_0_4_11(stream) } // «PlusPlus» = "++"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_plus_plus_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '+', '+') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_plus_plus(&self, stream: &mut Stream) -> bool { self.scan_plus_plus_0_4_11(stream) } // «PossiblySeparatedPairsOfHexDigits» = «HexCharacter»{2,2} ("_"? «HexCharacter»{2,2})*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_possibly_separated_pairs_of_hex_digits_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_repeated!( @@ -3250,13 +3381,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_possibly_separated_pairs_of_hex_digits(&self, stream: &mut Stream) -> bool { self.scan_possibly_separated_pairs_of_hex_digits_0_4_11(stream) } // «PragmaKeyword» = "pragma"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_pragma_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3270,13 +3402,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_pragma_keyword(&self, stream: &mut Stream) -> bool { self.scan_pragma_keyword_0_4_11(stream) } // «PrivateKeyword» = "private"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_private_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3290,13 +3423,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_private_keyword(&self, stream: &mut Stream) -> bool { self.scan_private_keyword_0_4_11(stream) } // «PublicKeyword» = "public"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_public_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3310,13 +3444,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_public_keyword(&self, stream: &mut Stream) -> bool { self.scan_public_keyword_0_4_11(stream) } // «PureKeyword» = "pure"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_pure_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3330,25 +3465,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_pure_keyword(&self, stream: &mut Stream) -> bool { self.scan_pure_keyword_0_4_11(stream) } // «QuestionMark» = "?"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_question_mark_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '?') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_question_mark(&self, stream: &mut Stream) -> bool { self.scan_question_mark_0_4_11(stream) } // «RawIdentifier» = «IdentifierStart» «IdentifierPart»*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_raw_identifier_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_predicate!(stream, |c| c == '$' @@ -3367,13 +3504,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_raw_identifier(&self, stream: &mut Stream) -> bool { self.scan_raw_identifier_0_4_11(stream) } // «ReceiveKeyword» = "receive"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_receive_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3387,13 +3525,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_receive_keyword(&self, stream: &mut Stream) -> bool { self.scan_receive_keyword_0_4_11(stream) } // «ReturnKeyword» = "return"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_return_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3407,13 +3546,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_return_keyword(&self, stream: &mut Stream) -> bool { self.scan_return_keyword_0_4_11(stream) } // «ReturnsKeyword» = "returns"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_returns_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3427,13 +3567,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_returns_keyword(&self, stream: &mut Stream) -> bool { self.scan_returns_keyword_0_4_11(stream) } // «RevertKeyword» = "revert"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_revert_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3447,13 +3588,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_revert_keyword(&self, stream: &mut Stream) -> bool { self.scan_revert_keyword_0_4_11(stream) } // «SecondsKeyword» = "seconds"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_seconds_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3467,25 +3609,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_seconds_keyword(&self, stream: &mut Stream) -> bool { self.scan_seconds_keyword_0_4_11(stream) } // «Semicolon» = ";"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_semicolon_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, ';') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_semicolon(&self, stream: &mut Stream) -> bool { self.scan_semicolon_0_4_11(stream) } // «SignedFixedType» = "fixed" (("0"…"9")+ "x" ("0"…"9")+)?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_signed_fixed_type_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3515,13 +3659,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_signed_fixed_type(&self, stream: &mut Stream) -> bool { self.scan_signed_fixed_type_0_4_11(stream) } // «SignedIntegerType» = "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")?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_signed_integer_type_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3572,13 +3717,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_signed_integer_type(&self, stream: &mut Stream) -> bool { self.scan_signed_integer_type_0_4_11(stream) } // «SingleLineComment» = "//" (!("\r" | "\n"))*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_single_line_comment_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '/', '/'), @@ -3587,13 +3733,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_single_line_comment(&self, stream: &mut Stream) -> bool { self.scan_single_line_comment_0_4_11(stream) } // «SingleQuotedAsciiStringLiteral» = "'" («EscapeSequence» | ((" "…"~") - ("'" | "\\")))* "'"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_single_quoted_ascii_string_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '\''), @@ -3612,6 +3759,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_single_quoted_ascii_string_literal(&self, stream: &mut Stream) -> bool { self.scan_single_quoted_ascii_string_literal_0_4_11(stream) } @@ -3619,7 +3767,7 @@ impl Language { // (* v0.7.0 *) // «SingleQuotedUnicodeStringLiteral» = "unicode'" («EscapeSequence» | !("'" | "\\" | "\n" | "\r"))* "'"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_single_quoted_unicode_string_literal_0_7_0(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'u', 'n', 'i', 'c', 'o', 'd', 'e', '\''), @@ -3647,6 +3795,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_single_quoted_unicode_string_literal( &self, stream: &mut Stream, @@ -3655,6 +3804,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_single_quoted_unicode_string_literal(&self, stream: &mut Stream) -> bool { self.dispatch_scan_single_quoted_unicode_string_literal(stream) .expect("Validation should have checked that references are valid between versions") @@ -3662,31 +3812,33 @@ impl Language { // «Slash» = "/"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_slash_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!(stream, scan_chars!(stream, '/'), scan_chars!(stream, '=')) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_slash(&self, stream: &mut Stream) -> bool { self.scan_slash_0_4_11(stream) } // «SlashEqual» = "/="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_slash_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '/', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_slash_equal(&self, stream: &mut Stream) -> bool { self.scan_slash_equal_0_4_11(stream) } // «SolidityKeyword» = "solidity"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_solidity_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3700,13 +3852,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_solidity_keyword(&self, stream: &mut Stream) -> bool { self.scan_solidity_keyword_0_4_11(stream) } // «StorageKeyword» = "storage"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_storage_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3720,13 +3873,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_storage_keyword(&self, stream: &mut Stream) -> bool { self.scan_storage_keyword_0_4_11(stream) } // «StringKeyword» = "string"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_string_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3740,13 +3894,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_string_keyword(&self, stream: &mut Stream) -> bool { self.scan_string_keyword_0_4_11(stream) } // «StructKeyword» = "struct"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_struct_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3760,13 +3915,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_struct_keyword(&self, stream: &mut Stream) -> bool { self.scan_struct_keyword_0_4_11(stream) } // «SwitchKeyword» = "switch"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_switch_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3780,6 +3936,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_switch_keyword(&self, stream: &mut Stream) -> bool { self.scan_switch_keyword_0_4_11(stream) } @@ -3787,7 +3944,7 @@ impl Language { // (* v0.4.11 *) // «SzaboKeyword» = "szabo"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_szabo_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3809,11 +3966,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_szabo_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_szabo_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_szabo_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_szabo_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -3822,7 +3981,7 @@ impl Language { // (* v0.4.11 *) // «ThrowKeyword» = "throw"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_throw_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3844,11 +4003,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_throw_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_throw_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_throw_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_throw_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -3856,19 +4017,20 @@ impl Language { // «Tilde» = "~"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_tilde_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '~') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_tilde(&self, stream: &mut Stream) -> bool { self.scan_tilde_0_4_11(stream) } // «TrueKeyword» = "true"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_true_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3882,6 +4044,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_true_keyword(&self, stream: &mut Stream) -> bool { self.scan_true_keyword_0_4_11(stream) } @@ -3889,7 +4052,7 @@ impl Language { // (* v0.6.0 *) // «TryKeyword» = "try"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_try_keyword_0_6_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3911,11 +4074,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_try_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_try_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_try_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_try_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -3924,7 +4089,7 @@ impl Language { // (* v0.5.3 *) // «TypeKeyword» = "type"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_type_keyword_0_5_3(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3946,11 +4111,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_type_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_type_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_type_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_type_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -3959,7 +4126,7 @@ impl Language { // (* v0.8.0 *) // «UncheckedKeyword» = "unchecked"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_unchecked_keyword_0_8_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3981,11 +4148,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_unchecked_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_unchecked_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_unchecked_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_unchecked_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -3993,7 +4162,7 @@ impl Language { // «UnicodeEscape» = "u" «HexCharacter»{4,4}; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_unicode_escape_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'u'), @@ -4009,6 +4178,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_unicode_escape(&self, stream: &mut Stream) -> bool { self.scan_unicode_escape_0_4_11(stream) } @@ -4016,7 +4186,7 @@ impl Language { // (* v0.7.0 *) // «UnicodeStringLiteral» = «SingleQuotedUnicodeStringLiteral» | «DoubleQuotedUnicodeStringLiteral»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_unicode_string_literal_0_7_0(&self, stream: &mut Stream) -> bool { scan_choice!( stream, @@ -4034,11 +4204,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_unicode_string_literal(&self, stream: &mut Stream) -> Option { self.dispatch_scan_unicode_string_literal(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_unicode_string_literal(&self, stream: &mut Stream) -> bool { self.dispatch_scan_unicode_string_literal(stream) .expect("Validation should have checked that references are valid between versions") @@ -4046,7 +4218,7 @@ impl Language { // «UnsignedFixedType» = "u" «SignedFixedType»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_unsigned_fixed_type_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'u'), @@ -4055,13 +4227,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_unsigned_fixed_type(&self, stream: &mut Stream) -> bool { self.scan_unsigned_fixed_type_0_4_11(stream) } // «UnsignedIntegerType» = "u" «SignedIntegerType»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_unsigned_integer_type_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'u'), @@ -4070,13 +4243,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_unsigned_integer_type(&self, stream: &mut Stream) -> bool { self.scan_unsigned_integer_type_0_4_11(stream) } // «UsingKeyword» = "using"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_using_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4090,6 +4264,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_using_keyword(&self, stream: &mut Stream) -> bool { self.scan_using_keyword_0_4_11(stream) } @@ -4097,7 +4272,7 @@ impl Language { // (* v0.4.11 *) // «VarKeyword» = "var"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_var_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4119,11 +4294,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_var_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_var_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_var_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_var_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -4131,7 +4308,7 @@ impl Language { // «VersionPragmaValue» = (("0"…"9") | "x" | "X" | "*")+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_version_pragma_value_0_4_11(&self, stream: &mut Stream) -> bool { scan_one_or_more!( stream, @@ -4143,13 +4320,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_version_pragma_value(&self, stream: &mut Stream) -> bool { self.scan_version_pragma_value_0_4_11(stream) } // «ViewKeyword» = "view"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_view_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4163,6 +4341,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_view_keyword(&self, stream: &mut Stream) -> bool { self.scan_view_keyword_0_4_11(stream) } @@ -4170,7 +4349,7 @@ impl Language { // (* v0.6.0 *) // «VirtualKeyword» = "virtual"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_virtual_keyword_0_6_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4192,11 +4371,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_virtual_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_virtual_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_virtual_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_virtual_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -4204,7 +4385,7 @@ impl Language { // «WeeksKeyword» = "weeks"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_weeks_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4218,13 +4399,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_weeks_keyword(&self, stream: &mut Stream) -> bool { self.scan_weeks_keyword_0_4_11(stream) } // «WeiKeyword» = "wei"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_wei_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4238,13 +4420,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_wei_keyword(&self, stream: &mut Stream) -> bool { self.scan_wei_keyword_0_4_11(stream) } // «WhileKeyword» = "while"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_while_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4258,18 +4441,20 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_while_keyword(&self, stream: &mut Stream) -> bool { self.scan_while_keyword_0_4_11(stream) } // «Whitespace» = (" " | "\t")+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_whitespace_0_4_11(&self, stream: &mut Stream) -> bool { scan_one_or_more!(stream, scan_predicate!(stream, |c| c == '\t' || c == ' ')) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_whitespace(&self, stream: &mut Stream) -> bool { self.scan_whitespace_0_4_11(stream) } @@ -4277,7 +4462,7 @@ impl Language { // (* v0.4.11 *) // «YearsKeyword» = "years"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_years_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4299,11 +4484,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_years_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_years_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_years_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_years_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -4311,7 +4498,7 @@ impl Language { // «YulDecimalLiteral» = "0" | (("1"…"9") ("0"…"9")*); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_yul_decimal_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_choice!( stream, @@ -4324,13 +4511,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_yul_decimal_literal(&self, stream: &mut Stream) -> bool { self.scan_yul_decimal_literal_0_4_11(stream) } // «YulHexLiteral» = "0x" «HexCharacter»+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_yul_hex_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '0', 'x'), @@ -4344,13 +4532,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_yul_hex_literal(&self, stream: &mut Stream) -> bool { self.scan_yul_hex_literal_0_4_11(stream) } // «YulIdentifier» = «RawIdentifier» - («YulKeyword» | «YulReservedKeyword»); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_yul_identifier_0_4_11(&self, stream: &mut Stream) -> bool { scan_difference!( stream, @@ -4364,6 +4553,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_yul_identifier(&self, stream: &mut Stream) -> bool { self.scan_yul_identifier_0_4_11(stream) } @@ -4381,7 +4571,7 @@ impl Language { // | «SwitchKeyword» // | «TrueKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_yul_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_choice!( stream, @@ -4413,7 +4603,7 @@ impl Language { // | «SwitchKeyword» // | «TrueKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_yul_keyword_0_6_0(&self, stream: &mut Stream) -> bool { scan_choice!( stream, @@ -4441,18 +4631,20 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_yul_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_yul_keyword(stream) } // «YulReservedKeyword» = "hex"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_yul_reserved_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, 'h', 'e', 'x') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_yul_reserved_keyword(&self, stream: &mut Stream) -> bool { self.scan_yul_reserved_keyword_0_4_11(stream) } diff --git a/crates/solidity/outputs/npm/crate/src/generated/kinds.rs b/crates/solidity/outputs/npm/crate/src/generated/kinds.rs index 51bc41354d..73b1361fcc 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/kinds.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/kinds.rs @@ -90,7 +90,6 @@ pub enum TokenKind { GreaterThanGreaterThanGreaterThanEqual, GweiKeyword, HexByteEscape, - HexCharacter, HexLiteral, HexStringLiteral, HoursKeyword, @@ -228,7 +227,6 @@ pub enum RuleKind { ConstructorAttribute, ConstructorDefinition, ContinueStatement, - ContractBodyElement, ContractBodyElements, ContractDefinition, DataLocation, @@ -336,7 +334,7 @@ pub enum RuleKind { VersionPragma, VersionPragmaAlternatives, VersionPragmaComparator, - VersionPragmaExpression, + VersionPragmaExpressionList, VersionPragmaRange, VersionPragmaSpecifier, WhileStatement, @@ -425,7 +423,6 @@ pub enum ProductionKind { ConstructorKeyword, ContinueKeyword, ContinueStatement, - ContractBodyElement, ContractDefinition, ContractKeyword, DataLocation, @@ -493,7 +490,6 @@ pub enum ProductionKind { GreaterThanGreaterThanGreaterThanEqual, GweiKeyword, HexByteEscape, - HexCharacter, HexLiteral, HexStringLiteral, HoursKeyword, @@ -640,7 +636,6 @@ pub enum ProductionKind { VarKeyword, VariableDeclarationStatement, VersionPragma, - VersionPragmaExpression, VersionPragmaSpecifier, VersionPragmaValue, ViewKeyword, diff --git a/crates/solidity/outputs/npm/crate/src/generated/language.rs b/crates/solidity/outputs/npm/crate/src/generated/language.rs index 11741e1084..7e609516aa 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/language.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/language.rs @@ -851,12 +851,6 @@ impl Language { Language::scan_hex_byte_escape, TokenKind::HexByteEscape, ), - ProductionKind::HexCharacter => call_scanner( - self, - input, - Language::scan_hex_character, - TokenKind::HexCharacter, - ), ProductionKind::HexLiteral => call_scanner( self, input, @@ -1433,9 +1427,6 @@ impl Language { ProductionKind::ContinueStatement => { call_parser(self, input, Language::parse_continue_statement) } - ProductionKind::ContractBodyElement => { - call_parser(self, input, Language::parse_contract_body_element) - } ProductionKind::ContractDefinition => { call_parser(self, input, Language::parse_contract_definition) } @@ -1690,9 +1681,6 @@ impl Language { ProductionKind::VersionPragma => { call_parser(self, input, Language::parse_version_pragma) } - ProductionKind::VersionPragmaExpression => { - call_parser(self, input, Language::parse_version_pragma_expression) - } ProductionKind::VersionPragmaSpecifier => { call_parser(self, input, Language::parse_version_pragma_specifier) } diff --git a/crates/solidity/outputs/npm/crate/src/generated/parsers.rs b/crates/solidity/outputs/npm/crate/src/generated/parsers.rs index 3cfa828afd..81f4317fa3 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/parsers.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/parsers.rs @@ -233,7 +233,7 @@ impl Language { } // ABICoderPragma = «AbicoderKeyword» «Identifier»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_abi_coder_pragma_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -282,7 +282,7 @@ impl Language { // AddSubOperator = «Plus» | «Minus»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_add_sub_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -310,7 +310,7 @@ impl Language { // AddressType = «AddressKeyword» «PayableKeyword»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_address_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -371,7 +371,7 @@ impl Language { // AndOperator = «AmpersandAmpersand»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_and_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia( stream, @@ -388,7 +388,7 @@ impl Language { // ArgumentList = «OpenParen» (PositionalArgumentList | NamedArgumentList)? «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_argument_list_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_paren, TokenKind::OpenParen) @@ -463,7 +463,7 @@ impl Language { // ArrayLiteral = «OpenBracket» Expression («Comma» Expression)* «CloseBracket»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_array_literal_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia( @@ -539,7 +539,7 @@ impl Language { // AssemblyFlags = «OpenParen» «DoubleQuotedAsciiStringLiteral» («Comma» «DoubleQuotedAsciiStringLiteral»)* «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_assembly_flags_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_paren, TokenKind::OpenParen) @@ -682,7 +682,7 @@ impl Language { // AssemblyStatement = «AssemblyKeyword» «Evmasm»? AssemblyFlags? YulBlock; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_assembly_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -784,7 +784,7 @@ impl Language { // | «SlashEqual» // | «PercentEqual»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_assignment_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -899,7 +899,7 @@ impl Language { // AsteriskImport = «Asterisk» ImportAlias «FromKeyword» ImportPath; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_asterisk_import_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -970,7 +970,7 @@ impl Language { // BitAndOperator = «Ampersand»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_bit_and_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, Self::scan_ampersand, TokenKind::Ampersand) } @@ -983,7 +983,7 @@ impl Language { // BitOrOperator = «Bar»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_bit_or_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, Self::scan_bar, TokenKind::Bar) } @@ -996,7 +996,7 @@ impl Language { // BitXOrOperator = «Caret»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_bit_x_or_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, Self::scan_caret, TokenKind::Caret) } @@ -1010,7 +1010,7 @@ impl Language { // (* v0.4.11 *) // Block = «OpenBrace» Statement* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_block_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_brace, TokenKind::OpenBrace) @@ -1072,7 +1072,7 @@ impl Language { // (* v0.8.0 *) // Block = «OpenBrace» (Statement | UncheckedBlock)* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_block_0_8_0(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_brace, TokenKind::OpenBrace) @@ -1161,7 +1161,7 @@ impl Language { // BooleanLiteral = «TrueKeyword» | «FalseKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_boolean_literal_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -1197,7 +1197,7 @@ impl Language { // BreakStatement = «BreakKeyword» «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_break_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia( @@ -1240,7 +1240,7 @@ impl Language { // (* v0.6.0 *) // CatchClause = «CatchKeyword» («Identifier»? ParameterList)? Block; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_catch_clause_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -1367,7 +1367,7 @@ impl Language { // ConditionalOperator = «QuestionMark» Expression «Colon» Expression; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_conditional_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -1435,7 +1435,7 @@ impl Language { // ConstantDefinition = TypeName «ConstantKeyword» «Identifier» «Equal» Expression «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_constant_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -1549,7 +1549,7 @@ impl Language { // (* v0.4.22 *) // ConstructorAttribute = ModifierInvocation | «InternalKeyword» | «PayableKeyword» | «PublicKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_constructor_attribute_0_4_22(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -1616,7 +1616,7 @@ impl Language { // (* v0.4.22 *) // ConstructorDefinition = «ConstructorKeyword» ParameterList ConstructorAttribute* Block; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_constructor_definition_0_4_22(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -1718,7 +1718,7 @@ impl Language { // ContinueStatement = «ContinueKeyword» «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_continue_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia( @@ -1769,7 +1769,7 @@ impl Language { // | ErrorDefinition // | StateVariableDeclaration; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_contract_body_element_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -1836,7 +1836,7 @@ impl Language { // | ErrorDefinition // | StateVariableDeclaration; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_contract_body_element_0_4_22(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -1909,7 +1909,7 @@ impl Language { // | ErrorDefinition // | StateVariableDeclaration; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_contract_body_element_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -1988,7 +1988,7 @@ impl Language { // | ErrorDefinition // | StateVariableDeclaration; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_contract_body_element_0_8_8(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2073,13 +2073,12 @@ impl Language { #[inline] pub(crate) fn parse_contract_body_element(&self, stream: &mut Stream) -> ParserResult { self.dispatch_parse_contract_body_element(stream) - .with_kind(RuleKind::ContractBodyElement) } // (* v0.4.11 *) // ContractDefinition = «ContractKeyword» «Identifier» InheritanceSpecifierList? «OpenBrace» ContractBodyElement* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_contract_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -2216,7 +2215,7 @@ impl Language { // (* v0.6.0 *) // ContractDefinition = «AbstractKeyword»? «ContractKeyword» «Identifier» InheritanceSpecifierList? «OpenBrace» ContractBodyElement* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_contract_definition_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -2396,7 +2395,7 @@ impl Language { // (* v0.4.11 *) // DataLocation = «MemoryKeyword» | «StorageKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_data_location_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2427,7 +2426,7 @@ impl Language { // (* v0.5.0 *) // DataLocation = «MemoryKeyword» | «StorageKeyword» | «CalldataKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_data_location_0_5_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2488,7 +2487,7 @@ impl Language { // | LibraryDefinition // | StructDefinition; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2549,7 +2548,7 @@ impl Language { // | StructDefinition // | UserDefinedValueTypeDefinition; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_definition_0_8_8(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2620,7 +2619,7 @@ impl Language { // DeleteStatement = «DeleteKeyword» Expression «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_delete_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -2690,7 +2689,7 @@ impl Language { // Directive = PragmaDirective | ImportDirective | UsingDirective; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_directive_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2723,7 +2722,7 @@ impl Language { // DoWhileStatement = «DoKeyword» Statement «WhileKeyword» «OpenParen» Expression «CloseParen» «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_do_while_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -2867,7 +2866,7 @@ impl Language { // | «SignedFixedType» // | «UnsignedFixedType»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_elementary_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -2966,7 +2965,7 @@ impl Language { // | «SignedFixedType» // | «UnsignedFixedType»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_elementary_type_0_8_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -3066,7 +3065,7 @@ impl Language { // (* v0.4.21 *) // EmitStatement = «EmitKeyword» IdentifierPath ArgumentList «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_emit_statement_0_4_21(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -3160,7 +3159,7 @@ impl Language { // EndOfFileTrivia = («Whitespace» | «EndOfLine» | «MultilineComment» | «SingleLineComment»)+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_end_of_file_trivia_0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut result = Vec::new(); @@ -3224,7 +3223,7 @@ impl Language { // EnumDefinition = «EnumKeyword» «Identifier» «OpenBrace» («Identifier» («Comma» «Identifier»)*)? «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_enum_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -3363,7 +3362,7 @@ impl Language { // EqualityComparisonOperator = «EqualEqual» | «BangEqual»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_equality_comparison_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -3396,7 +3395,7 @@ impl Language { // ErrorDefinition = «ErrorKeyword» «Identifier» «OpenParen» (ErrorParameter («Comma» ErrorParameter)*)? «CloseParen» «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_error_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -3558,7 +3557,7 @@ impl Language { // ErrorParameter = TypeName «Identifier»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_error_parameter_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -3615,7 +3614,7 @@ impl Language { // EventDefinition = «EventKeyword» «Identifier» «OpenParen» (EventParameter («Comma» EventParameter)*)? «CloseParen» «AnonymousKeyword»? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_event_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -3806,7 +3805,7 @@ impl Language { // EventParameter = TypeName «IndexedKeyword»? «Identifier»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_event_parameter_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -3890,7 +3889,7 @@ impl Language { // ExperimentalPragma = «ExperimentalKeyword» «Identifier»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_experimental_pragma_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -3939,7 +3938,7 @@ impl Language { // ExponentiationOperator = «AsteriskAsterisk»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_exponentiation_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia( stream, @@ -3993,7 +3992,7 @@ impl Language { // MemberAccessExpression = Expression MemberAccessOperator; // IndexAccessExpression = Expression IndexAccessOperator; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { { enum Pratt { @@ -4445,7 +4444,7 @@ impl Language { // MemberAccessExpression = Expression MemberAccessOperator; // IndexAccessExpression = Expression IndexAccessOperator; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_expression_0_6_0(&self, stream: &mut Stream) -> ParserResult { { enum Pratt { @@ -4874,7 +4873,7 @@ impl Language { // ExpressionStatement = Expression «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_expression_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_expression(stream) { @@ -4919,7 +4918,7 @@ impl Language { // | «ViewKeyword» // | «VirtualKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_fallback_function_attribute_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -5012,7 +5011,7 @@ impl Language { // (* v0.6.0 *) // FallbackFunctionDefinition = «FallbackKeyword» ParameterList FallbackFunctionAttribute* («ReturnsKeyword» ParameterList)? («Semicolon» | Block); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_fallback_function_definition_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -5195,7 +5194,7 @@ impl Language { // ForStatement = «ForKeyword» «OpenParen» (SimpleStatement | «Semicolon») (ExpressionStatement | «Semicolon») Expression? «CloseParen» Statement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_for_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -5393,7 +5392,7 @@ impl Language { // | «PureKeyword» // | «ViewKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_attribute_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -5496,7 +5495,7 @@ impl Language { // | «PureKeyword» // | «ViewKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_attribute_0_5_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -5591,7 +5590,7 @@ impl Language { // | «ViewKeyword» // | «VirtualKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_attribute_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -5702,7 +5701,7 @@ impl Language { // (* v0.4.11 *) // FunctionCallOperator = ArgumentList; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_call_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -5727,7 +5726,7 @@ impl Language { // (* v0.6.2 *) // FunctionCallOperator = FunctionCallOptions* ArgumentList; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_call_operator_0_6_2(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -5782,7 +5781,7 @@ impl Language { // (* v0.8.0 *) // FunctionCallOperator = FunctionCallOptions? ArgumentList; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_call_operator_0_8_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -5846,7 +5845,7 @@ impl Language { // (* v0.6.2 *) // FunctionCallOptions = «OpenBrace» (NamedArgument («Comma» NamedArgument)*)? «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_call_options_0_6_2(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_brace, TokenKind::OpenBrace) @@ -5947,7 +5946,7 @@ impl Language { // FunctionDefinition = «FunctionKeyword» («Identifier» | «FallbackKeyword» | «ReceiveKeyword») ParameterList FunctionAttribute* («ReturnsKeyword» ParameterList)? («Semicolon» | Block); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -6154,7 +6153,7 @@ impl Language { // FunctionType = «FunctionKeyword» ParameterList («InternalKeyword» | «ExternalKeyword» | «PrivateKeyword» | «PublicKeyword» | «PureKeyword» | «ViewKeyword» | «PayableKeyword»)* («ReturnsKeyword» ParameterList)?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_function_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -6354,7 +6353,7 @@ impl Language { // IdentifierPath = «Identifier» («Period» «Identifier»)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_identifier_path_0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut result = Vec::new(); @@ -6396,7 +6395,7 @@ impl Language { // IfStatement = «IfKeyword» «OpenParen» Expression «CloseParen» Statement («ElseKeyword» Statement)?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_if_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -6545,7 +6544,7 @@ impl Language { // ImportAlias = «AsKeyword» «Identifier»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_import_alias_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -6594,7 +6593,7 @@ impl Language { // ImportDirective = «ImportKeyword» (SimpleImport | AsteriskImport | SelectiveImport) «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_import_directive_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -6684,7 +6683,7 @@ impl Language { // ImportPath = «AsciiStringLiteral»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_import_path_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia( stream, @@ -6701,7 +6700,7 @@ impl Language { // IndexAccessOperator = «OpenBracket» ((Expression («Colon» Expression?)?) | («Colon» Expression?)) «CloseBracket»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_index_access_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia( @@ -6907,7 +6906,7 @@ impl Language { // InheritanceSpecifier = IdentifierPath ArgumentList?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_inheritance_specifier_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -6960,7 +6959,7 @@ impl Language { // InheritanceSpecifierList = «IsKeyword» InheritanceSpecifier («Comma» InheritanceSpecifier)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_inheritance_specifier_list_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7030,7 +7029,7 @@ impl Language { // InterfaceDefinition = «InterfaceKeyword» «Identifier» InheritanceSpecifierList? «OpenBrace» ContractBodyElement* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_interface_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7170,7 +7169,7 @@ impl Language { // LeadingTrivia = («Whitespace» | «EndOfLine» | «MultilineComment» | «SingleLineComment»)+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_leading_trivia_0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut result = Vec::new(); @@ -7234,7 +7233,7 @@ impl Language { // LibraryDefinition = «LibraryKeyword» «Identifier» «OpenBrace» ContractBodyElement* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_library_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7352,7 +7351,7 @@ impl Language { // (* v0.4.11 *) // MappingKeyType = (ElementaryType | IdentifierPath); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_mapping_key_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7392,7 +7391,7 @@ impl Language { // (* v0.8.18 *) // MappingKeyType = (ElementaryType | IdentifierPath) «Identifier»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_mapping_key_type_0_8_18(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7472,7 +7471,7 @@ impl Language { // MappingType = «MappingKeyword» «OpenParen» MappingKeyType «EqualGreaterThan» MappingValueType «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_mapping_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7604,7 +7603,7 @@ impl Language { // (* v0.4.11 *) // MappingValueType = TypeName; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_mapping_value_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7629,7 +7628,7 @@ impl Language { // (* v0.8.18 *) // MappingValueType = TypeName «Identifier»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_mapping_value_type_0_8_18(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7694,7 +7693,7 @@ impl Language { // MemberAccessOperator = «Period» («Identifier» | «AddressKeyword»); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_member_access_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7760,7 +7759,7 @@ impl Language { // (* v0.4.11 *) // ModifierAttribute = OverrideSpecifier; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_modifier_attribute_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_override_specifier(stream) } @@ -7768,7 +7767,7 @@ impl Language { // (* v0.6.0 *) // ModifierAttribute = OverrideSpecifier | «VirtualKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_modifier_attribute_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -7808,7 +7807,7 @@ impl Language { // ModifierDefinition = «ModifierKeyword» «Identifier» ParameterList? ModifierAttribute* («Semicolon» | Block); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_modifier_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7942,7 +7941,7 @@ impl Language { // ModifierInvocation = IdentifierPath ArgumentList?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_modifier_invocation_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -7995,7 +7994,7 @@ impl Language { // MulDivModOperator = «Asterisk» | «Slash» | «Percent»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_mul_div_mod_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8028,7 +8027,7 @@ impl Language { // NamedArgument = «Identifier» «Colon» Expression; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_named_argument_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -8085,7 +8084,7 @@ impl Language { // NamedArgumentList = «OpenBrace» (NamedArgument («Comma» NamedArgument)*)? «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_named_argument_list_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_brace, TokenKind::OpenBrace) @@ -8170,7 +8169,7 @@ impl Language { // NewExpression = «NewKeyword» TypeName; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_new_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -8225,7 +8224,7 @@ impl Language { // | «WeiKeyword» // | «YearsKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_number_unit_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8336,7 +8335,7 @@ impl Language { // | «WeeksKeyword» // | «WeiKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_number_unit_0_5_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8439,7 +8438,7 @@ impl Language { // | «WeeksKeyword» // | «WeiKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_number_unit_0_6_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8549,7 +8548,7 @@ impl Language { // | «WeeksKeyword» // | «WeiKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_number_unit_0_7_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8652,7 +8651,7 @@ impl Language { // (* v0.4.11 *) // NumericExpression = («HexLiteral» | «DecimalLiteral») NumberUnit?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_numeric_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -8723,7 +8722,7 @@ impl Language { // (* v0.5.0 *) // NumericExpression = «HexLiteral» | («DecimalLiteral» NumberUnit?); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_numeric_expression_0_5_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8807,7 +8806,7 @@ impl Language { // OrOperator = «BarBar»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_or_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, Self::scan_bar_bar, TokenKind::BarBar) } @@ -8820,7 +8819,7 @@ impl Language { // OrderComparisonOperator = «LessThan» | «GreaterThan» | «LessThanEqual» | «GreaterThanEqual»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_order_comparison_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -8870,7 +8869,7 @@ impl Language { // OverrideSpecifier = «OverrideKeyword» («OpenParen» IdentifierPath («Comma» IdentifierPath)* «CloseParen»)?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_override_specifier_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -8990,7 +8989,7 @@ impl Language { // ParameterDeclaration = TypeName DataLocation? «Identifier»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_parameter_declaration_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -9070,7 +9069,7 @@ impl Language { // ParameterList = «OpenParen» (ParameterDeclaration («Comma» ParameterDeclaration)*)? «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_parameter_list_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_paren, TokenKind::OpenParen) @@ -9155,7 +9154,7 @@ impl Language { // PayableType = «PayableKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_payable_type_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia( stream, @@ -9172,7 +9171,7 @@ impl Language { // PositionalArgumentList = Expression («Comma» Expression)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_positional_argument_list_0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut result = Vec::new(); @@ -9210,7 +9209,7 @@ impl Language { // PragmaDirective = «PragmaKeyword» (VersionPragma | ABICoderPragma | ExperimentalPragma) «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_pragma_directive_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -9308,7 +9307,7 @@ impl Language { // | ElementaryType // | «Identifier»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_primary_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -9370,7 +9369,7 @@ impl Language { // | ElementaryType // | «Identifier»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_primary_expression_0_5_3(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -9447,7 +9446,7 @@ impl Language { // | «PayableKeyword» // | «VirtualKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_receive_function_attribute_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -9522,7 +9521,7 @@ impl Language { // (* v0.6.0 *) // ReceiveFunctionDefinition = «ReceiveKeyword» ParameterList ReceiveFunctionAttribute* («Semicolon» | Block); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_receive_function_definition_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -9646,7 +9645,7 @@ impl Language { // ReturnStatement = «ReturnKeyword» Expression? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_return_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -9728,7 +9727,7 @@ impl Language { // RevertStatement = «RevertKeyword» IdentifierPath? ArgumentList «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_revert_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -9821,7 +9820,7 @@ impl Language { // SelectiveImport = «OpenBrace» «Identifier» ImportAlias? («Comma» «Identifier» ImportAlias?)* «CloseBrace» «FromKeyword» ImportPath; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_selective_import_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -9992,7 +9991,7 @@ impl Language { // ShiftOperator = «LessThanLessThan» | «GreaterThanGreaterThan» | «GreaterThanGreaterThanGreaterThan»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_shift_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10037,7 +10036,7 @@ impl Language { // SimpleImport = ImportPath ImportAlias?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_simple_import_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -10090,7 +10089,7 @@ impl Language { // SimpleStatement = TupleDeconstructionStatement | VariableDeclarationStatement | ExpressionStatement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_simple_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10123,7 +10122,7 @@ impl Language { // SourceUnit = (Directive | Definition)* EndOfFileTrivia?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_source_unit_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -10215,7 +10214,7 @@ impl Language { // | «PrivateKeyword» // | «PublicKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_state_variable_attribute_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10274,7 +10273,7 @@ impl Language { // | «PrivateKeyword» // | «PublicKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_state_variable_attribute_0_6_5(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10350,7 +10349,7 @@ impl Language { // StateVariableDeclaration = TypeName StateVariableAttribute* «Identifier» («Equal» Expression)? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_state_variable_declaration_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -10522,7 +10521,7 @@ impl Language { // | DeleteStatement // | AssemblyStatement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10613,7 +10612,7 @@ impl Language { // | DeleteStatement // | AssemblyStatement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_statement_0_4_21(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10708,7 +10707,7 @@ impl Language { // | DeleteStatement // | AssemblyStatement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_statement_0_5_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10799,7 +10798,7 @@ impl Language { // | DeleteStatement // | AssemblyStatement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_statement_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10900,7 +10899,7 @@ impl Language { // (* v0.4.11 *) // StringExpression = «HexStringLiteral»+ | «AsciiStringLiteral»+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_string_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -10967,7 +10966,7 @@ impl Language { // (* v0.7.0 *) // StringExpression = «HexStringLiteral»+ | «AsciiStringLiteral»+ | «UnicodeStringLiteral»+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_string_expression_0_7_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -11074,7 +11073,7 @@ impl Language { // StructDefinition = «StructKeyword» «Identifier» «OpenBrace» StructMember+ «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_struct_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -11190,7 +11189,7 @@ impl Language { // StructMember = TypeName «Identifier» «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_struct_member_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -11261,7 +11260,7 @@ impl Language { // (* v0.4.11 *) // ThrowStatement = «ThrowKeyword» «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_throw_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia( @@ -11316,7 +11315,7 @@ impl Language { // TrailingTrivia = «Whitespace»? «SingleLineComment»? «EndOfLine»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_trailing_trivia_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -11398,7 +11397,7 @@ impl Language { // (* v0.6.0 *) // TryStatement = «TryKeyword» Expression («ReturnsKeyword» ParameterList)? Block CatchClause+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_try_statement_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -11555,7 +11554,7 @@ impl Language { // TupleDeconstructionStatement = «OpenParen» (((TypeName DataLocation? «Identifier») | (DataLocation? «Identifier»))? («Comma» ((TypeName DataLocation? «Identifier») | (DataLocation? «Identifier»))?)*)? «CloseParen» «Equal» Expression «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_tuple_deconstruction_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -11887,7 +11886,7 @@ impl Language { // TupleExpression = «OpenParen» Expression? («Comma» Expression?)* «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_tuple_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_paren, TokenKind::OpenParen) @@ -11973,7 +11972,7 @@ impl Language { // (* v0.5.3 *) // TypeExpression = «TypeKeyword» «OpenParen» TypeName «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_type_expression_0_5_3(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -12068,7 +12067,7 @@ impl Language { // TypeName = ArrayTypeName | FunctionType | MappingType | ElementaryType | IdentifierPath; // ArrayTypeName = TypeName «OpenBracket» Expression? «CloseBracket»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_type_name_0_4_11(&self, stream: &mut Stream) -> ParserResult { { enum Pratt { @@ -12290,7 +12289,7 @@ impl Language { // UnaryPostfixOperator = «PlusPlus» | «MinusMinus»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_unary_postfix_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -12328,7 +12327,7 @@ impl Language { // | «Minus» // | «Plus»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_unary_prefix_operator_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -12379,7 +12378,7 @@ impl Language { // | «Bang» // | «Minus»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_unary_prefix_operator_0_5_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -12435,7 +12434,7 @@ impl Language { // (* v0.8.0 *) // UncheckedBlock = «UncheckedKeyword» Block; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_unchecked_block_0_8_0(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -12499,7 +12498,7 @@ impl Language { // | «PureKeyword» // | «ViewKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_unnamed_function_attribute_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -12583,7 +12582,7 @@ impl Language { // (* v0.4.11 *) // UnnamedFunctionDefinition = «FunctionKeyword» ParameterList UnnamedFunctionAttribute* («Semicolon» | Block); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_unnamed_function_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -12722,7 +12721,7 @@ impl Language { // | «Asterisk» // | «Tilde»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_user_defined_operator_0_8_19(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -12849,7 +12848,7 @@ impl Language { // (* v0.8.8 *) // UserDefinedValueTypeDefinition = «TypeKeyword» «Identifier» «IsKeyword» ElementaryType «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_user_defined_value_type_definition_0_8_8(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -12974,7 +12973,7 @@ impl Language { // (* v0.4.11 *) // UsingDirective = «UsingKeyword» (IdentifierPath | («OpenBrace» IdentifierPath («Comma» IdentifierPath)* «CloseBrace»)) «ForKeyword» («Asterisk» | TypeName) «GlobalKeyword»? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_using_directive_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -13193,7 +13192,7 @@ impl Language { // (* v0.8.19 *) // UsingDirective = «UsingKeyword» (IdentifierPath | («OpenBrace» IdentifierPath («AsKeyword» UserDefinedOperator)? («Comma» IdentifierPath («AsKeyword» UserDefinedOperator)?)* «CloseBrace»)) «ForKeyword» («Asterisk» | TypeName) «GlobalKeyword»? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_using_directive_0_8_19(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -13526,7 +13525,7 @@ impl Language { // (* v0.4.11 *) // VariableDeclarationStatement = ((TypeName DataLocation?) | «VarKeyword») «Identifier» («Equal» Expression)? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_variable_declaration_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -13709,7 +13708,7 @@ impl Language { // (* v0.5.0 *) // VariableDeclarationStatement = TypeName DataLocation? «Identifier» («Equal» Expression)? «Semicolon»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_variable_declaration_statement_0_5_0(&self, stream: &mut Stream) -> ParserResult { { match loop { @@ -13869,7 +13868,7 @@ impl Language { // VersionPragma = «SolidityKeyword» VersionPragmaExpression+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_version_pragma_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -13906,7 +13905,9 @@ impl Language { Pass { builder, .. } => result.push(builder), } } - } { + } + .with_kind(RuleKind::VersionPragmaExpressionList) + { Pass { builder, error } => { furthest_error = error.map(|error| error.maybe_merge_with(furthest_error)); builder @@ -13935,7 +13936,7 @@ impl Language { // VersionPragmaRange = VersionPragmaExpression «Minus» VersionPragmaExpression; // VersionPragmaComparator = («Caret» | «Tilde» | «Equal» | «LessThan» | «GreaterThan» | «LessThanEqual» | «GreaterThanEqual») VersionPragmaExpression; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_version_pragma_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { { enum Pratt { @@ -14191,12 +14192,11 @@ impl Language { #[inline] pub(crate) fn parse_version_pragma_expression(&self, stream: &mut Stream) -> ParserResult { self.parse_version_pragma_expression_0_4_11(stream) - .with_kind(RuleKind::VersionPragmaExpression) } // VersionPragmaSpecifier = «VersionPragmaValue» («Period» «VersionPragmaValue»)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_version_pragma_specifier_0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut result = Vec::new(); @@ -14238,7 +14238,7 @@ impl Language { // WhileStatement = «WhileKeyword» «OpenParen» Expression «CloseParen» Statement; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_while_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -14330,7 +14330,7 @@ impl Language { // YulAssignmentStatement = YulIdentifierPath («Comma» YulIdentifierPath)* «ColonEqual» YulExpression; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_assignment_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -14411,7 +14411,7 @@ impl Language { // YulBlock = «OpenBrace» YulStatement* «CloseBrace»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_block_0_4_11(&self, stream: &mut Stream) -> ParserResult { { match self.parse_token_with_trivia(stream, Self::scan_open_brace, TokenKind::OpenBrace) @@ -14478,7 +14478,7 @@ impl Language { // YulBreakStatement = «BreakKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_break_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, Self::scan_break_keyword, TokenKind::BreakKeyword) } @@ -14491,7 +14491,7 @@ impl Language { // YulContinueStatement = «ContinueKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_continue_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia( stream, @@ -14508,7 +14508,7 @@ impl Language { // YulDeclarationStatement = «LetKeyword» YulIdentifierPath («Comma» YulIdentifierPath)* («ColonEqual» YulExpression)?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_declaration_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -14636,7 +14636,7 @@ impl Language { // YulExpression = YulFunctionCallExpression | YulLiteral | YulIdentifierPath; // YulFunctionCallExpression = YulExpression «OpenParen» (YulExpression («Comma» YulExpression)*)? «CloseParen»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_expression_0_4_11(&self, stream: &mut Stream) -> ParserResult { { enum Pratt { @@ -14877,7 +14877,7 @@ impl Language { // YulForStatement = «ForKeyword» YulBlock YulExpression YulBlock YulBlock; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_for_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -14957,7 +14957,7 @@ impl Language { // YulFunctionDefinition = «FunctionKeyword» «YulIdentifier» «OpenParen» («YulIdentifier» («Comma» «YulIdentifier»)*)? «CloseParen» («MinusGreaterThan» «YulIdentifier» («Comma» «YulIdentifier»)*)? YulBlock; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_function_definition_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -15199,7 +15199,7 @@ impl Language { // YulIdentifierPath = «YulIdentifier» («Period» «YulIdentifier»)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_identifier_path_0_4_11(&self, stream: &mut Stream) -> ParserResult { { let mut result = Vec::new(); @@ -15241,7 +15241,7 @@ impl Language { // YulIfStatement = «IfKeyword» YulExpression YulBlock; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_if_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; @@ -15298,7 +15298,7 @@ impl Language { // (* v0.6.0 *) // YulLeaveStatement = «LeaveKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_leave_statement_0_6_0(&self, stream: &mut Stream) -> ParserResult { self.parse_token_with_trivia(stream, Self::scan_leave_keyword, TokenKind::LeaveKeyword) } @@ -15331,7 +15331,7 @@ impl Language { // | «HexStringLiteral» // | «AsciiStringLiteral»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_literal_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -15400,7 +15400,7 @@ impl Language { // | YulContinueStatement // | YulExpression; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -15473,7 +15473,7 @@ impl Language { // | YulContinueStatement // | YulExpression; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_statement_0_6_0(&self, stream: &mut Stream) -> ParserResult { loop { let start_position = stream.position(); @@ -15554,7 +15554,7 @@ impl Language { // YulSwitchStatement = «SwitchKeyword» YulExpression (((«CaseKeyword» YulLiteral) | «DefaultKeyword») YulBlock)+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn parse_yul_switch_statement_0_4_11(&self, stream: &mut Stream) -> ParserResult { loop { let mut furthest_error = None; diff --git a/crates/solidity/outputs/npm/crate/src/generated/scanners.rs b/crates/solidity/outputs/npm/crate/src/generated/scanners.rs index a24d26f312..c02f4690e0 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/scanners.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/scanners.rs @@ -171,7 +171,7 @@ macro_rules! scan_not_followed_by { impl Language { // «AbicoderKeyword» = "abicoder"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_abicoder_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -185,6 +185,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_abicoder_keyword(&self, stream: &mut Stream) -> bool { self.scan_abicoder_keyword_0_4_11(stream) } @@ -192,7 +193,7 @@ impl Language { // (* v0.6.0 *) // «AbstractKeyword» = "abstract"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_abstract_keyword_0_6_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -214,11 +215,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_abstract_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_abstract_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_abstract_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_abstract_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -226,7 +229,7 @@ impl Language { // «AddressKeyword» = "address"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_address_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -240,13 +243,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_address_keyword(&self, stream: &mut Stream) -> bool { self.scan_address_keyword_0_4_11(stream) } // «Ampersand» = "&"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_ampersand_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -256,37 +260,40 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_ampersand(&self, stream: &mut Stream) -> bool { self.scan_ampersand_0_4_11(stream) } // «AmpersandAmpersand» = "&&"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_ampersand_ampersand_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '&', '&') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_ampersand_ampersand(&self, stream: &mut Stream) -> bool { self.scan_ampersand_ampersand_0_4_11(stream) } // «AmpersandEqual» = "&="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_ampersand_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '&', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_ampersand_equal(&self, stream: &mut Stream) -> bool { self.scan_ampersand_equal_0_4_11(stream) } // «AnonymousKeyword» = "anonymous"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_anonymous_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -300,13 +307,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_anonymous_keyword(&self, stream: &mut Stream) -> bool { self.scan_anonymous_keyword_0_4_11(stream) } // «AsKeyword» = "as"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_as_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -320,6 +328,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_as_keyword(&self, stream: &mut Stream) -> bool { self.scan_as_keyword_0_4_11(stream) } @@ -333,7 +342,7 @@ impl Language { // | "\n" // | "\r"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_ascii_escape_0_4_11(&self, stream: &mut Stream) -> bool { scan_predicate!(stream, |c| c == '\n' || c == '\r' @@ -346,13 +355,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_ascii_escape(&self, stream: &mut Stream) -> bool { self.scan_ascii_escape_0_4_11(stream) } // «AsciiStringLiteral» = «SingleQuotedAsciiStringLiteral» | «DoubleQuotedAsciiStringLiteral»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_ascii_string_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_choice!( stream, @@ -362,13 +372,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_ascii_string_literal(&self, stream: &mut Stream) -> bool { self.scan_ascii_string_literal_0_4_11(stream) } // «AssemblyKeyword» = "assembly"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_assembly_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -382,13 +393,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_assembly_keyword(&self, stream: &mut Stream) -> bool { self.scan_assembly_keyword_0_4_11(stream) } // «Asterisk» = "*"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_asterisk_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -398,61 +410,66 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_asterisk(&self, stream: &mut Stream) -> bool { self.scan_asterisk_0_4_11(stream) } // «AsteriskAsterisk» = "**"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_asterisk_asterisk_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '*', '*') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_asterisk_asterisk(&self, stream: &mut Stream) -> bool { self.scan_asterisk_asterisk_0_4_11(stream) } // «AsteriskEqual» = "*="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_asterisk_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '*', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_asterisk_equal(&self, stream: &mut Stream) -> bool { self.scan_asterisk_equal_0_4_11(stream) } // «Bang» = "!"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_bang_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!(stream, scan_chars!(stream, '!'), scan_chars!(stream, '=')) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_bang(&self, stream: &mut Stream) -> bool { self.scan_bang_0_4_11(stream) } // «BangEqual» = "!="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_bang_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '!', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_bang_equal(&self, stream: &mut Stream) -> bool { self.scan_bang_equal_0_4_11(stream) } // «Bar» = "|"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_bar_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -462,37 +479,40 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_bar(&self, stream: &mut Stream) -> bool { self.scan_bar_0_4_11(stream) } // «BarBar» = "||"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_bar_bar_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '|', '|') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_bar_bar(&self, stream: &mut Stream) -> bool { self.scan_bar_bar_0_4_11(stream) } // «BarEqual» = "|="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_bar_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '|', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_bar_equal(&self, stream: &mut Stream) -> bool { self.scan_bar_equal_0_4_11(stream) } // «BoolKeyword» = "bool"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_bool_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -506,13 +526,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_bool_keyword(&self, stream: &mut Stream) -> bool { self.scan_bool_keyword_0_4_11(stream) } // «BreakKeyword» = "break"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_break_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -526,6 +547,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_break_keyword(&self, stream: &mut Stream) -> bool { self.scan_break_keyword_0_4_11(stream) } @@ -533,7 +555,7 @@ impl Language { // (* v0.4.11 *) // «ByteType» = "byte"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_byte_type_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -555,11 +577,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_byte_type(&self, stream: &mut Stream) -> Option { self.dispatch_scan_byte_type(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_byte_type(&self, stream: &mut Stream) -> bool { self.dispatch_scan_byte_type(stream) .expect("Validation should have checked that references are valid between versions") @@ -568,7 +592,7 @@ impl Language { // (* v0.5.0 *) // «CalldataKeyword» = "calldata"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_calldata_keyword_0_5_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -590,11 +614,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_calldata_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_calldata_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_calldata_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_calldata_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -602,31 +628,33 @@ impl Language { // «Caret» = "^"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_caret_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!(stream, scan_chars!(stream, '^'), scan_chars!(stream, '=')) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_caret(&self, stream: &mut Stream) -> bool { self.scan_caret_0_4_11(stream) } // «CaretEqual» = "^="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_caret_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '^', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_caret_equal(&self, stream: &mut Stream) -> bool { self.scan_caret_equal_0_4_11(stream) } // «CaseKeyword» = "case"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_case_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -640,6 +668,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_case_keyword(&self, stream: &mut Stream) -> bool { self.scan_case_keyword_0_4_11(stream) } @@ -647,7 +676,7 @@ impl Language { // (* v0.6.0 *) // «CatchKeyword» = "catch"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_catch_keyword_0_6_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -669,11 +698,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_catch_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_catch_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_catch_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_catch_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -681,79 +712,85 @@ impl Language { // «CloseBrace» = "}"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_close_brace_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '}') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_close_brace(&self, stream: &mut Stream) -> bool { self.scan_close_brace_0_4_11(stream) } // «CloseBracket» = "]"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_close_bracket_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, ']') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_close_bracket(&self, stream: &mut Stream) -> bool { self.scan_close_bracket_0_4_11(stream) } // «CloseParen» = ")"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_close_paren_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, ')') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_close_paren(&self, stream: &mut Stream) -> bool { self.scan_close_paren_0_4_11(stream) } // «Colon» = ":"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_colon_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!(stream, scan_chars!(stream, ':'), scan_chars!(stream, '=')) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_colon(&self, stream: &mut Stream) -> bool { self.scan_colon_0_4_11(stream) } // «ColonEqual» = ":="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_colon_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, ':', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_colon_equal(&self, stream: &mut Stream) -> bool { self.scan_colon_equal_0_4_11(stream) } // «Comma» = ","; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_comma_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, ',') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_comma(&self, stream: &mut Stream) -> bool { self.scan_comma_0_4_11(stream) } // «ConstantKeyword» = "constant"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_constant_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -767,6 +804,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_constant_keyword(&self, stream: &mut Stream) -> bool { self.scan_constant_keyword_0_4_11(stream) } @@ -774,7 +812,7 @@ impl Language { // (* v0.4.22 *) // «ConstructorKeyword» = "constructor"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_constructor_keyword_0_4_22(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -796,11 +834,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_constructor_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_constructor_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_constructor_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_constructor_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -808,7 +848,7 @@ impl Language { // «ContinueKeyword» = "continue"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_continue_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -822,13 +862,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_continue_keyword(&self, stream: &mut Stream) -> bool { self.scan_continue_keyword_0_4_11(stream) } // «ContractKeyword» = "contract"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_contract_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -842,13 +883,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_contract_keyword(&self, stream: &mut Stream) -> bool { self.scan_contract_keyword_0_4_11(stream) } // «DaysKeyword» = "days"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_days_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -862,13 +904,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_days_keyword(&self, stream: &mut Stream) -> bool { self.scan_days_keyword_0_4_11(stream) } // «DecimalExponent» = ("e" | "E") "-"? «DecimalNumber»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_decimal_exponent_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_predicate!(stream, |c| c == 'E' || c == 'e'), @@ -878,6 +921,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_decimal_exponent(&self, stream: &mut Stream) -> bool { self.scan_decimal_exponent_0_4_11(stream) } @@ -885,7 +929,7 @@ impl Language { // (* v0.4.11 *) // «DecimalLiteral» = ((«DecimalNumber» ("." «DecimalNumber»?)?) | ("." «DecimalNumber»)) «DecimalExponent»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_decimal_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_choice!( @@ -909,7 +953,7 @@ impl Language { // (* v0.5.0 *) // «DecimalLiteral» = ((«DecimalNumber» ("." «DecimalNumber»)?) | ("." «DecimalNumber»)) «DecimalExponent»?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_decimal_literal_0_5_0(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_choice!( @@ -936,13 +980,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_decimal_literal(&self, stream: &mut Stream) -> bool { self.dispatch_scan_decimal_literal(stream) } // «DecimalNumber» = ("0"…"9")+ ("_" ("0"…"9")+)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_decimal_number_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_one_or_more!(stream, scan_predicate!(stream, |c| ('0' <= c && c <= '9'))), @@ -957,13 +1002,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_decimal_number(&self, stream: &mut Stream) -> bool { self.scan_decimal_number_0_4_11(stream) } // «DefaultKeyword» = "default"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_default_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -977,13 +1023,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_default_keyword(&self, stream: &mut Stream) -> bool { self.scan_default_keyword_0_4_11(stream) } // «DeleteKeyword» = "delete"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_delete_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -997,13 +1044,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_delete_keyword(&self, stream: &mut Stream) -> bool { self.scan_delete_keyword_0_4_11(stream) } // «DoKeyword» = "do"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_do_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1017,13 +1065,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_do_keyword(&self, stream: &mut Stream) -> bool { self.scan_do_keyword_0_4_11(stream) } // «DoubleQuotedAsciiStringLiteral» = '"' («EscapeSequence» | ((" "…"~") - ('"' | "\\")))* '"'; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_double_quoted_ascii_string_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '"'), @@ -1042,6 +1091,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_double_quoted_ascii_string_literal(&self, stream: &mut Stream) -> bool { self.scan_double_quoted_ascii_string_literal_0_4_11(stream) } @@ -1049,7 +1099,7 @@ impl Language { // (* v0.7.0 *) // «DoubleQuotedUnicodeStringLiteral» = 'unicode"' («EscapeSequence» | !('"' | "\\" | "\n" | "\r"))* '"'; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_double_quoted_unicode_string_literal_0_7_0(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'u', 'n', 'i', 'c', 'o', 'd', 'e', '"'), @@ -1077,6 +1127,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_double_quoted_unicode_string_literal( &self, stream: &mut Stream, @@ -1085,6 +1136,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_double_quoted_unicode_string_literal(&self, stream: &mut Stream) -> bool { self.dispatch_scan_double_quoted_unicode_string_literal(stream) .expect("Validation should have checked that references are valid between versions") @@ -1092,7 +1144,7 @@ impl Language { // «ElseKeyword» = "else"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_else_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1106,6 +1158,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_else_keyword(&self, stream: &mut Stream) -> bool { self.scan_else_keyword_0_4_11(stream) } @@ -1113,7 +1166,7 @@ impl Language { // (* v0.4.21 *) // «EmitKeyword» = "emit"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_emit_keyword_0_4_21(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1135,11 +1188,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_emit_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_emit_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_emit_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_emit_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -1147,7 +1202,7 @@ impl Language { // «EndOfLine» = "\r"? "\n"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_end_of_line_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_optional!(stream, scan_chars!(stream, '\r')), @@ -1156,13 +1211,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_end_of_line(&self, stream: &mut Stream) -> bool { self.scan_end_of_line_0_4_11(stream) } // «EnumKeyword» = "enum"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_enum_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1176,13 +1232,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_enum_keyword(&self, stream: &mut Stream) -> bool { self.scan_enum_keyword_0_4_11(stream) } // «Equal» = "="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1192,37 +1249,40 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_equal(&self, stream: &mut Stream) -> bool { self.scan_equal_0_4_11(stream) } // «EqualEqual» = "=="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_equal_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '=', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_equal_equal(&self, stream: &mut Stream) -> bool { self.scan_equal_equal_0_4_11(stream) } // «EqualGreaterThan» = "=>"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_equal_greater_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '=', '>') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_equal_greater_than(&self, stream: &mut Stream) -> bool { self.scan_equal_greater_than_0_4_11(stream) } // «ErrorKeyword» = "error"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_error_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1236,13 +1296,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_error_keyword(&self, stream: &mut Stream) -> bool { self.scan_error_keyword_0_4_11(stream) } // «EscapeSequence» = "\\" («AsciiEscape» | «HexByteEscape» | «UnicodeEscape»); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_escape_sequence_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '\\'), @@ -1256,13 +1317,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_escape_sequence(&self, stream: &mut Stream) -> bool { self.scan_escape_sequence_0_4_11(stream) } // «EtherKeyword» = "ether"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_ether_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1276,13 +1338,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_ether_keyword(&self, stream: &mut Stream) -> bool { self.scan_ether_keyword_0_4_11(stream) } // «EventKeyword» = "event"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_event_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1296,25 +1359,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_event_keyword(&self, stream: &mut Stream) -> bool { self.scan_event_keyword_0_4_11(stream) } // «Evmasm» = '"evmasm"'; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_evmasm_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '"', 'e', 'v', 'm', 'a', 's', 'm', '"') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_evmasm(&self, stream: &mut Stream) -> bool { self.scan_evmasm_0_4_11(stream) } // «ExperimentalKeyword» = "experimental"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_experimental_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1328,13 +1393,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_experimental_keyword(&self, stream: &mut Stream) -> bool { self.scan_experimental_keyword_0_4_11(stream) } // «ExternalKeyword» = "external"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_external_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1348,13 +1414,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_external_keyword(&self, stream: &mut Stream) -> bool { self.scan_external_keyword_0_4_11(stream) } // «FallbackKeyword» = "fallback"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_fallback_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1368,13 +1435,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_fallback_keyword(&self, stream: &mut Stream) -> bool { self.scan_fallback_keyword_0_4_11(stream) } // «FalseKeyword» = "false"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_false_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1388,6 +1456,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_false_keyword(&self, stream: &mut Stream) -> bool { self.scan_false_keyword_0_4_11(stream) } @@ -1395,7 +1464,7 @@ impl Language { // (* v0.4.11 *) // «FinneyKeyword» = "finney"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_finney_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1417,11 +1486,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_finney_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_finney_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_finney_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_finney_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -1429,7 +1500,7 @@ impl Language { // «FixedBytesType» = "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"); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_fixed_bytes_type_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1460,13 +1531,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_fixed_bytes_type(&self, stream: &mut Stream) -> bool { self.scan_fixed_bytes_type_0_4_11(stream) } // «ForKeyword» = "for"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_for_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1480,13 +1552,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_for_keyword(&self, stream: &mut Stream) -> bool { self.scan_for_keyword_0_4_11(stream) } // «FromKeyword» = "from"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_from_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1500,13 +1573,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_from_keyword(&self, stream: &mut Stream) -> bool { self.scan_from_keyword_0_4_11(stream) } // «FunctionKeyword» = "function"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_function_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1520,13 +1594,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_function_keyword(&self, stream: &mut Stream) -> bool { self.scan_function_keyword_0_4_11(stream) } // «GlobalKeyword» = "global"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_global_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1540,13 +1615,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_global_keyword(&self, stream: &mut Stream) -> bool { self.scan_global_keyword_0_4_11(stream) } // «GreaterThan» = ">"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_greater_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1556,25 +1632,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_greater_than(&self, stream: &mut Stream) -> bool { self.scan_greater_than_0_4_11(stream) } // «GreaterThanEqual» = ">="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_greater_than_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '>', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_greater_than_equal(&self, stream: &mut Stream) -> bool { self.scan_greater_than_equal_0_4_11(stream) } // «GreaterThanGreaterThan» = ">>"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_greater_than_greater_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1584,25 +1662,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_greater_than_greater_than(&self, stream: &mut Stream) -> bool { self.scan_greater_than_greater_than_0_4_11(stream) } // «GreaterThanGreaterThanEqual» = ">>="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_greater_than_greater_than_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '>', '>', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_greater_than_greater_than_equal(&self, stream: &mut Stream) -> bool { self.scan_greater_than_greater_than_equal_0_4_11(stream) } // «GreaterThanGreaterThanGreaterThan» = ">>>"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_greater_than_greater_than_greater_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1612,13 +1692,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_greater_than_greater_than_greater_than(&self, stream: &mut Stream) -> bool { self.scan_greater_than_greater_than_greater_than_0_4_11(stream) } // «GreaterThanGreaterThanGreaterThanEqual» = ">>>="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_greater_than_greater_than_greater_than_equal_0_4_11( &self, stream: &mut Stream, @@ -1627,6 +1708,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_greater_than_greater_than_greater_than_equal( &self, stream: &mut Stream, @@ -1637,7 +1719,7 @@ impl Language { // (* v0.6.11 *) // «GweiKeyword» = "gwei"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_gwei_keyword_0_6_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1659,11 +1741,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_gwei_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_gwei_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_gwei_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_gwei_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -1671,7 +1755,7 @@ impl Language { // «HexByteEscape» = "x" «HexCharacter»{2,2}; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_hex_byte_escape_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'x'), @@ -1687,13 +1771,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_hex_byte_escape(&self, stream: &mut Stream) -> bool { self.scan_hex_byte_escape_0_4_11(stream) } // «HexCharacter» = ("0"…"9") | ("a"…"f") | ("A"…"F"); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_hex_character_0_4_11(&self, stream: &mut Stream) -> bool { scan_predicate!(stream, |c| ('0' <= c && c <= '9') || ('A' <= c && c <= 'F') @@ -1701,6 +1786,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_hex_character(&self, stream: &mut Stream) -> bool { self.scan_hex_character_0_4_11(stream) } @@ -1708,7 +1794,7 @@ impl Language { // (* v0.4.11 *) // «HexLiteral» = "0" ("x" | "X") «HexCharacter»+ ("_" «HexCharacter»+)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_hex_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '0'), @@ -1737,7 +1823,7 @@ impl Language { // (* v0.5.0 *) // «HexLiteral» = "0x" «HexCharacter»+ ("_" «HexCharacter»+)*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_hex_literal_0_5_0(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '0', 'x'), @@ -1771,13 +1857,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_hex_literal(&self, stream: &mut Stream) -> bool { self.dispatch_scan_hex_literal(stream) } // «HexStringLiteral» = "hex" (('"' «PossiblySeparatedPairsOfHexDigits»? '"') | ("'" «PossiblySeparatedPairsOfHexDigits»? "'")); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_hex_string_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'h', 'e', 'x'), @@ -1804,13 +1891,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_hex_string_literal(&self, stream: &mut Stream) -> bool { self.scan_hex_string_literal_0_4_11(stream) } // «HoursKeyword» = "hours"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_hours_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -1824,13 +1912,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_hours_keyword(&self, stream: &mut Stream) -> bool { self.scan_hours_keyword_0_4_11(stream) } // «Identifier» = «RawIdentifier» - («NotAnIdentifierInAnyVersion» | «NotAnIdentifierInSomeVersions» | «FixedBytesType» | «SignedFixedType» | «UnsignedFixedType» | «SignedIntegerType» | «UnsignedIntegerType»); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_identifier_0_4_11(&self, stream: &mut Stream) -> bool { scan_difference!( stream, @@ -2021,13 +2110,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_identifier(&self, stream: &mut Stream) -> bool { self.scan_identifier_0_4_11(stream) } // «IdentifierPart» = «IdentifierStart» | ("0"…"9"); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_identifier_part_0_4_11(&self, stream: &mut Stream) -> bool { scan_predicate!(stream, |c| c == '$' || ('0' <= c && c <= '9') @@ -2037,13 +2127,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_identifier_part(&self, stream: &mut Stream) -> bool { self.scan_identifier_part_0_4_11(stream) } // «IdentifierStart» = "_" | "$" | ("a"…"z") | ("A"…"Z"); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_identifier_start_0_4_11(&self, stream: &mut Stream) -> bool { scan_predicate!(stream, |c| c == '$' || ('A' <= c && c <= 'Z') @@ -2052,13 +2143,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_identifier_start(&self, stream: &mut Stream) -> bool { self.scan_identifier_start_0_4_11(stream) } // «IfKeyword» = "if"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_if_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2072,6 +2164,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_if_keyword(&self, stream: &mut Stream) -> bool { self.scan_if_keyword_0_4_11(stream) } @@ -2079,7 +2172,7 @@ impl Language { // (* v0.6.5 *) // «ImmutableKeyword» = "immutable"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_immutable_keyword_0_6_5(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2101,11 +2194,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_immutable_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_immutable_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_immutable_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_immutable_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -2113,7 +2208,7 @@ impl Language { // «ImportKeyword» = "import"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_import_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2127,13 +2222,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_import_keyword(&self, stream: &mut Stream) -> bool { self.scan_import_keyword_0_4_11(stream) } // «IndexedKeyword» = "indexed"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_indexed_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2147,13 +2243,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_indexed_keyword(&self, stream: &mut Stream) -> bool { self.scan_indexed_keyword_0_4_11(stream) } // «InterfaceKeyword» = "interface"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_interface_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2167,13 +2264,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_interface_keyword(&self, stream: &mut Stream) -> bool { self.scan_interface_keyword_0_4_11(stream) } // «InternalKeyword» = "internal"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_internal_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2187,13 +2285,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_internal_keyword(&self, stream: &mut Stream) -> bool { self.scan_internal_keyword_0_4_11(stream) } // «IsKeyword» = "is"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_is_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2207,6 +2306,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_is_keyword(&self, stream: &mut Stream) -> bool { self.scan_is_keyword_0_4_11(stream) } @@ -2214,7 +2314,7 @@ impl Language { // (* v0.6.0 *) // «LeaveKeyword» = "leave"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_leave_keyword_0_6_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2236,11 +2336,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_leave_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_leave_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_leave_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_leave_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -2248,7 +2350,7 @@ impl Language { // «LessThan» = "<"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_less_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2258,25 +2360,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_less_than(&self, stream: &mut Stream) -> bool { self.scan_less_than_0_4_11(stream) } // «LessThanEqual» = "<="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_less_than_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '<', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_less_than_equal(&self, stream: &mut Stream) -> bool { self.scan_less_than_equal_0_4_11(stream) } // «LessThanLessThan» = "<<"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_less_than_less_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2286,25 +2390,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_less_than_less_than(&self, stream: &mut Stream) -> bool { self.scan_less_than_less_than_0_4_11(stream) } // «LessThanLessThanEqual» = "<<="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_less_than_less_than_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '<', '<', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_less_than_less_than_equal(&self, stream: &mut Stream) -> bool { self.scan_less_than_less_than_equal_0_4_11(stream) } // «LetKeyword» = "let"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_let_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2318,13 +2424,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_let_keyword(&self, stream: &mut Stream) -> bool { self.scan_let_keyword_0_4_11(stream) } // «LibraryKeyword» = "library"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_library_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2338,13 +2445,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_library_keyword(&self, stream: &mut Stream) -> bool { self.scan_library_keyword_0_4_11(stream) } // «MappingKeyword» = "mapping"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_mapping_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2358,13 +2466,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_mapping_keyword(&self, stream: &mut Stream) -> bool { self.scan_mapping_keyword_0_4_11(stream) } // «MemoryKeyword» = "memory"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_memory_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2378,13 +2487,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_memory_keyword(&self, stream: &mut Stream) -> bool { self.scan_memory_keyword_0_4_11(stream) } // «Minus» = "-"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_minus_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2394,49 +2504,53 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_minus(&self, stream: &mut Stream) -> bool { self.scan_minus_0_4_11(stream) } // «MinusEqual» = "-="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_minus_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '-', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_minus_equal(&self, stream: &mut Stream) -> bool { self.scan_minus_equal_0_4_11(stream) } // «MinusGreaterThan» = "->"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_minus_greater_than_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '-', '>') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_minus_greater_than(&self, stream: &mut Stream) -> bool { self.scan_minus_greater_than_0_4_11(stream) } // «MinusMinus» = "--"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_minus_minus_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '-', '-') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_minus_minus(&self, stream: &mut Stream) -> bool { self.scan_minus_minus_0_4_11(stream) } // «MinutesKeyword» = "minutes"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_minutes_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2450,13 +2564,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_minutes_keyword(&self, stream: &mut Stream) -> bool { self.scan_minutes_keyword_0_4_11(stream) } // «ModifierKeyword» = "modifier"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_modifier_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2470,13 +2585,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_modifier_keyword(&self, stream: &mut Stream) -> bool { self.scan_modifier_keyword_0_4_11(stream) } // «MultilineComment» = "/*" (!"*" | ("*" !"/"))* "*/"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_multiline_comment_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '/', '*'), @@ -2496,13 +2612,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_multiline_comment(&self, stream: &mut Stream) -> bool { self.scan_multiline_comment_0_4_11(stream) } // «NewKeyword» = "new"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_new_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -2516,6 +2633,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_new_keyword(&self, stream: &mut Stream) -> bool { self.scan_new_keyword_0_4_11(stream) } @@ -2594,7 +2712,7 @@ impl Language { // | "while" // | "years"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_not_an_identifier_in_any_version_0_4_11(&self, stream: &mut Stream) -> bool { scan_trie!( stream, @@ -2772,6 +2890,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_not_an_identifier_in_any_version(&self, stream: &mut Stream) -> bool { self.scan_not_an_identifier_in_any_version_0_4_11(stream) } @@ -2779,7 +2898,7 @@ impl Language { // (* v0.4.11 *) // «NotAnIdentifierInSomeVersions» = "finney" | "szabo"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_not_an_identifier_in_some_versions_0_4_11(&self, stream: &mut Stream) -> bool { scan_trie!( stream, @@ -2813,7 +2932,7 @@ impl Language { // | "typedef" // | "unchecked"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_not_an_identifier_in_some_versions_0_5_0(&self, stream: &mut Stream) -> bool { scan_trie!( stream, @@ -2895,7 +3014,7 @@ impl Language { // | "receive" // | "virtual"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_not_an_identifier_in_some_versions_0_6_0(&self, stream: &mut Stream) -> bool { scan_trie!( stream, @@ -2988,7 +3107,7 @@ impl Language { // | "virtual" // | "gwei"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_not_an_identifier_in_some_versions_0_7_0(&self, stream: &mut Stream) -> bool { scan_trie!( stream, @@ -3063,49 +3182,53 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_not_an_identifier_in_some_versions(&self, stream: &mut Stream) -> bool { self.dispatch_scan_not_an_identifier_in_some_versions(stream) } // «OpenBrace» = "{"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_open_brace_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '{') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_open_brace(&self, stream: &mut Stream) -> bool { self.scan_open_brace_0_4_11(stream) } // «OpenBracket» = "["; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_open_bracket_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '[') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_open_bracket(&self, stream: &mut Stream) -> bool { self.scan_open_bracket_0_4_11(stream) } // «OpenParen» = "("; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_open_paren_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '(') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_open_paren(&self, stream: &mut Stream) -> bool { self.scan_open_paren_0_4_11(stream) } // «OverrideKeyword» = "override"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_override_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3119,13 +3242,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_override_keyword(&self, stream: &mut Stream) -> bool { self.scan_override_keyword_0_4_11(stream) } // «PayableKeyword» = "payable"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_payable_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3139,49 +3263,53 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_payable_keyword(&self, stream: &mut Stream) -> bool { self.scan_payable_keyword_0_4_11(stream) } // «Percent» = "%"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_percent_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!(stream, scan_chars!(stream, '%'), scan_chars!(stream, '=')) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_percent(&self, stream: &mut Stream) -> bool { self.scan_percent_0_4_11(stream) } // «PercentEqual» = "%="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_percent_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '%', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_percent_equal(&self, stream: &mut Stream) -> bool { self.scan_percent_equal_0_4_11(stream) } // «Period» = "."; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_period_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '.') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_period(&self, stream: &mut Stream) -> bool { self.scan_period_0_4_11(stream) } // «Plus» = "+"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_plus_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3191,37 +3319,40 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_plus(&self, stream: &mut Stream) -> bool { self.scan_plus_0_4_11(stream) } // «PlusEqual» = "+="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_plus_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '+', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_plus_equal(&self, stream: &mut Stream) -> bool { self.scan_plus_equal_0_4_11(stream) } // «PlusPlus» = "++"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_plus_plus_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '+', '+') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_plus_plus(&self, stream: &mut Stream) -> bool { self.scan_plus_plus_0_4_11(stream) } // «PossiblySeparatedPairsOfHexDigits» = «HexCharacter»{2,2} ("_"? «HexCharacter»{2,2})*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_possibly_separated_pairs_of_hex_digits_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_repeated!( @@ -3250,13 +3381,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_possibly_separated_pairs_of_hex_digits(&self, stream: &mut Stream) -> bool { self.scan_possibly_separated_pairs_of_hex_digits_0_4_11(stream) } // «PragmaKeyword» = "pragma"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_pragma_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3270,13 +3402,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_pragma_keyword(&self, stream: &mut Stream) -> bool { self.scan_pragma_keyword_0_4_11(stream) } // «PrivateKeyword» = "private"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_private_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3290,13 +3423,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_private_keyword(&self, stream: &mut Stream) -> bool { self.scan_private_keyword_0_4_11(stream) } // «PublicKeyword» = "public"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_public_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3310,13 +3444,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_public_keyword(&self, stream: &mut Stream) -> bool { self.scan_public_keyword_0_4_11(stream) } // «PureKeyword» = "pure"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_pure_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3330,25 +3465,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_pure_keyword(&self, stream: &mut Stream) -> bool { self.scan_pure_keyword_0_4_11(stream) } // «QuestionMark» = "?"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_question_mark_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '?') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_question_mark(&self, stream: &mut Stream) -> bool { self.scan_question_mark_0_4_11(stream) } // «RawIdentifier» = «IdentifierStart» «IdentifierPart»*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_raw_identifier_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_predicate!(stream, |c| c == '$' @@ -3367,13 +3504,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_raw_identifier(&self, stream: &mut Stream) -> bool { self.scan_raw_identifier_0_4_11(stream) } // «ReceiveKeyword» = "receive"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_receive_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3387,13 +3525,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_receive_keyword(&self, stream: &mut Stream) -> bool { self.scan_receive_keyword_0_4_11(stream) } // «ReturnKeyword» = "return"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_return_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3407,13 +3546,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_return_keyword(&self, stream: &mut Stream) -> bool { self.scan_return_keyword_0_4_11(stream) } // «ReturnsKeyword» = "returns"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_returns_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3427,13 +3567,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_returns_keyword(&self, stream: &mut Stream) -> bool { self.scan_returns_keyword_0_4_11(stream) } // «RevertKeyword» = "revert"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_revert_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3447,13 +3588,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_revert_keyword(&self, stream: &mut Stream) -> bool { self.scan_revert_keyword_0_4_11(stream) } // «SecondsKeyword» = "seconds"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_seconds_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3467,25 +3609,27 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_seconds_keyword(&self, stream: &mut Stream) -> bool { self.scan_seconds_keyword_0_4_11(stream) } // «Semicolon» = ";"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_semicolon_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, ';') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_semicolon(&self, stream: &mut Stream) -> bool { self.scan_semicolon_0_4_11(stream) } // «SignedFixedType» = "fixed" (("0"…"9")+ "x" ("0"…"9")+)?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_signed_fixed_type_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3515,13 +3659,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_signed_fixed_type(&self, stream: &mut Stream) -> bool { self.scan_signed_fixed_type_0_4_11(stream) } // «SignedIntegerType» = "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")?; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_signed_integer_type_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3572,13 +3717,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_signed_integer_type(&self, stream: &mut Stream) -> bool { self.scan_signed_integer_type_0_4_11(stream) } // «SingleLineComment» = "//" (!("\r" | "\n"))*; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_single_line_comment_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '/', '/'), @@ -3587,13 +3733,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_single_line_comment(&self, stream: &mut Stream) -> bool { self.scan_single_line_comment_0_4_11(stream) } // «SingleQuotedAsciiStringLiteral» = "'" («EscapeSequence» | ((" "…"~") - ("'" | "\\")))* "'"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_single_quoted_ascii_string_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '\''), @@ -3612,6 +3759,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_single_quoted_ascii_string_literal(&self, stream: &mut Stream) -> bool { self.scan_single_quoted_ascii_string_literal_0_4_11(stream) } @@ -3619,7 +3767,7 @@ impl Language { // (* v0.7.0 *) // «SingleQuotedUnicodeStringLiteral» = "unicode'" («EscapeSequence» | !("'" | "\\" | "\n" | "\r"))* "'"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_single_quoted_unicode_string_literal_0_7_0(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'u', 'n', 'i', 'c', 'o', 'd', 'e', '\''), @@ -3647,6 +3795,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_single_quoted_unicode_string_literal( &self, stream: &mut Stream, @@ -3655,6 +3804,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_single_quoted_unicode_string_literal(&self, stream: &mut Stream) -> bool { self.dispatch_scan_single_quoted_unicode_string_literal(stream) .expect("Validation should have checked that references are valid between versions") @@ -3662,31 +3812,33 @@ impl Language { // «Slash» = "/"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_slash_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!(stream, scan_chars!(stream, '/'), scan_chars!(stream, '=')) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_slash(&self, stream: &mut Stream) -> bool { self.scan_slash_0_4_11(stream) } // «SlashEqual» = "/="; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_slash_equal_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '/', '=') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_slash_equal(&self, stream: &mut Stream) -> bool { self.scan_slash_equal_0_4_11(stream) } // «SolidityKeyword» = "solidity"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_solidity_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3700,13 +3852,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_solidity_keyword(&self, stream: &mut Stream) -> bool { self.scan_solidity_keyword_0_4_11(stream) } // «StorageKeyword» = "storage"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_storage_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3720,13 +3873,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_storage_keyword(&self, stream: &mut Stream) -> bool { self.scan_storage_keyword_0_4_11(stream) } // «StringKeyword» = "string"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_string_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3740,13 +3894,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_string_keyword(&self, stream: &mut Stream) -> bool { self.scan_string_keyword_0_4_11(stream) } // «StructKeyword» = "struct"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_struct_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3760,13 +3915,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_struct_keyword(&self, stream: &mut Stream) -> bool { self.scan_struct_keyword_0_4_11(stream) } // «SwitchKeyword» = "switch"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_switch_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3780,6 +3936,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_switch_keyword(&self, stream: &mut Stream) -> bool { self.scan_switch_keyword_0_4_11(stream) } @@ -3787,7 +3944,7 @@ impl Language { // (* v0.4.11 *) // «SzaboKeyword» = "szabo"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_szabo_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3809,11 +3966,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_szabo_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_szabo_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_szabo_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_szabo_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -3822,7 +3981,7 @@ impl Language { // (* v0.4.11 *) // «ThrowKeyword» = "throw"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_throw_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3844,11 +4003,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_throw_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_throw_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_throw_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_throw_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -3856,19 +4017,20 @@ impl Language { // «Tilde» = "~"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_tilde_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, '~') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_tilde(&self, stream: &mut Stream) -> bool { self.scan_tilde_0_4_11(stream) } // «TrueKeyword» = "true"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_true_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3882,6 +4044,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_true_keyword(&self, stream: &mut Stream) -> bool { self.scan_true_keyword_0_4_11(stream) } @@ -3889,7 +4052,7 @@ impl Language { // (* v0.6.0 *) // «TryKeyword» = "try"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_try_keyword_0_6_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3911,11 +4074,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_try_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_try_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_try_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_try_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -3924,7 +4089,7 @@ impl Language { // (* v0.5.3 *) // «TypeKeyword» = "type"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_type_keyword_0_5_3(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3946,11 +4111,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_type_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_type_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_type_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_type_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -3959,7 +4126,7 @@ impl Language { // (* v0.8.0 *) // «UncheckedKeyword» = "unchecked"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_unchecked_keyword_0_8_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -3981,11 +4148,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_unchecked_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_unchecked_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_unchecked_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_unchecked_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -3993,7 +4162,7 @@ impl Language { // «UnicodeEscape» = "u" «HexCharacter»{4,4}; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_unicode_escape_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'u'), @@ -4009,6 +4178,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_unicode_escape(&self, stream: &mut Stream) -> bool { self.scan_unicode_escape_0_4_11(stream) } @@ -4016,7 +4186,7 @@ impl Language { // (* v0.7.0 *) // «UnicodeStringLiteral» = «SingleQuotedUnicodeStringLiteral» | «DoubleQuotedUnicodeStringLiteral»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_unicode_string_literal_0_7_0(&self, stream: &mut Stream) -> bool { scan_choice!( stream, @@ -4034,11 +4204,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_unicode_string_literal(&self, stream: &mut Stream) -> Option { self.dispatch_scan_unicode_string_literal(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_unicode_string_literal(&self, stream: &mut Stream) -> bool { self.dispatch_scan_unicode_string_literal(stream) .expect("Validation should have checked that references are valid between versions") @@ -4046,7 +4218,7 @@ impl Language { // «UnsignedFixedType» = "u" «SignedFixedType»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_unsigned_fixed_type_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'u'), @@ -4055,13 +4227,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_unsigned_fixed_type(&self, stream: &mut Stream) -> bool { self.scan_unsigned_fixed_type_0_4_11(stream) } // «UnsignedIntegerType» = "u" «SignedIntegerType»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_unsigned_integer_type_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, 'u'), @@ -4070,13 +4243,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_unsigned_integer_type(&self, stream: &mut Stream) -> bool { self.scan_unsigned_integer_type_0_4_11(stream) } // «UsingKeyword» = "using"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_using_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4090,6 +4264,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_using_keyword(&self, stream: &mut Stream) -> bool { self.scan_using_keyword_0_4_11(stream) } @@ -4097,7 +4272,7 @@ impl Language { // (* v0.4.11 *) // «VarKeyword» = "var"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_var_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4119,11 +4294,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_var_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_var_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_var_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_var_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -4131,7 +4308,7 @@ impl Language { // «VersionPragmaValue» = (("0"…"9") | "x" | "X" | "*")+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_version_pragma_value_0_4_11(&self, stream: &mut Stream) -> bool { scan_one_or_more!( stream, @@ -4143,13 +4320,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_version_pragma_value(&self, stream: &mut Stream) -> bool { self.scan_version_pragma_value_0_4_11(stream) } // «ViewKeyword» = "view"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_view_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4163,6 +4341,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_view_keyword(&self, stream: &mut Stream) -> bool { self.scan_view_keyword_0_4_11(stream) } @@ -4170,7 +4349,7 @@ impl Language { // (* v0.6.0 *) // «VirtualKeyword» = "virtual"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_virtual_keyword_0_6_0(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4192,11 +4371,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_virtual_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_virtual_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_virtual_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_virtual_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -4204,7 +4385,7 @@ impl Language { // «WeeksKeyword» = "weeks"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_weeks_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4218,13 +4399,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_weeks_keyword(&self, stream: &mut Stream) -> bool { self.scan_weeks_keyword_0_4_11(stream) } // «WeiKeyword» = "wei"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_wei_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4238,13 +4420,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_wei_keyword(&self, stream: &mut Stream) -> bool { self.scan_wei_keyword_0_4_11(stream) } // «WhileKeyword» = "while"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_while_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4258,18 +4441,20 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_while_keyword(&self, stream: &mut Stream) -> bool { self.scan_while_keyword_0_4_11(stream) } // «Whitespace» = (" " | "\t")+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_whitespace_0_4_11(&self, stream: &mut Stream) -> bool { scan_one_or_more!(stream, scan_predicate!(stream, |c| c == '\t' || c == ' ')) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_whitespace(&self, stream: &mut Stream) -> bool { self.scan_whitespace_0_4_11(stream) } @@ -4277,7 +4462,7 @@ impl Language { // (* v0.4.11 *) // «YearsKeyword» = "years"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_years_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_not_followed_by!( stream, @@ -4299,11 +4484,13 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn maybe_scan_years_keyword(&self, stream: &mut Stream) -> Option { self.dispatch_scan_years_keyword(stream) } #[inline] + #[allow(dead_code)] pub(crate) fn scan_years_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_years_keyword(stream) .expect("Validation should have checked that references are valid between versions") @@ -4311,7 +4498,7 @@ impl Language { // «YulDecimalLiteral» = "0" | (("1"…"9") ("0"…"9")*); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_yul_decimal_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_choice!( stream, @@ -4324,13 +4511,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_yul_decimal_literal(&self, stream: &mut Stream) -> bool { self.scan_yul_decimal_literal_0_4_11(stream) } // «YulHexLiteral» = "0x" «HexCharacter»+; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_yul_hex_literal_0_4_11(&self, stream: &mut Stream) -> bool { scan_sequence!( scan_chars!(stream, '0', 'x'), @@ -4344,13 +4532,14 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_yul_hex_literal(&self, stream: &mut Stream) -> bool { self.scan_yul_hex_literal_0_4_11(stream) } // «YulIdentifier» = «RawIdentifier» - («YulKeyword» | «YulReservedKeyword»); - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_yul_identifier_0_4_11(&self, stream: &mut Stream) -> bool { scan_difference!( stream, @@ -4364,6 +4553,7 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_yul_identifier(&self, stream: &mut Stream) -> bool { self.scan_yul_identifier_0_4_11(stream) } @@ -4381,7 +4571,7 @@ impl Language { // | «SwitchKeyword» // | «TrueKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_yul_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_choice!( stream, @@ -4413,7 +4603,7 @@ impl Language { // | «SwitchKeyword» // | «TrueKeyword»; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_yul_keyword_0_6_0(&self, stream: &mut Stream) -> bool { scan_choice!( stream, @@ -4441,18 +4631,20 @@ impl Language { } #[inline] + #[allow(dead_code)] pub(crate) fn scan_yul_keyword(&self, stream: &mut Stream) -> bool { self.dispatch_scan_yul_keyword(stream) } // «YulReservedKeyword» = "hex"; - #[allow(unused_assignments, unused_parens)] + #[allow(dead_code)] fn scan_yul_reserved_keyword_0_4_11(&self, stream: &mut Stream) -> bool { scan_chars!(stream, 'h', 'e', 'x') } #[inline] + #[allow(dead_code)] pub(crate) fn scan_yul_reserved_keyword(&self, stream: &mut Stream) -> bool { self.scan_yul_reserved_keyword_0_4_11(stream) } diff --git a/crates/solidity/outputs/npm/package/src/generated/index.d.ts b/crates/solidity/outputs/npm/package/src/generated/index.d.ts index 9874426df5..b342b107e9 100644 --- a/crates/solidity/outputs/npm/package/src/generated/index.d.ts +++ b/crates/solidity/outputs/npm/package/src/generated/index.d.ts @@ -89,101 +89,100 @@ export enum TokenKind { GreaterThanGreaterThanGreaterThanEqual = 73, GweiKeyword = 74, HexByteEscape = 75, - HexCharacter = 76, - HexLiteral = 77, - HexStringLiteral = 78, - HoursKeyword = 79, - Identifier = 80, - IdentifierPart = 81, - IdentifierStart = 82, - IfKeyword = 83, - ImmutableKeyword = 84, - ImportKeyword = 85, - IndexedKeyword = 86, - InterfaceKeyword = 87, - InternalKeyword = 88, - IsKeyword = 89, - LeaveKeyword = 90, - LessThan = 91, - LessThanEqual = 92, - LessThanLessThan = 93, - LessThanLessThanEqual = 94, - LetKeyword = 95, - LibraryKeyword = 96, - MappingKeyword = 97, - MemoryKeyword = 98, - Minus = 99, - MinusEqual = 100, - MinusGreaterThan = 101, - MinusMinus = 102, - MinutesKeyword = 103, - ModifierKeyword = 104, - MultilineComment = 105, - NewKeyword = 106, - NotAnIdentifierInAnyVersion = 107, - NotAnIdentifierInSomeVersions = 108, - OpenBrace = 109, - OpenBracket = 110, - OpenParen = 111, - OverrideKeyword = 112, - PayableKeyword = 113, - Percent = 114, - PercentEqual = 115, - Period = 116, - Plus = 117, - PlusEqual = 118, - PlusPlus = 119, - PossiblySeparatedPairsOfHexDigits = 120, - PragmaKeyword = 121, - PrivateKeyword = 122, - PublicKeyword = 123, - PureKeyword = 124, - QuestionMark = 125, - RawIdentifier = 126, - ReceiveKeyword = 127, - ReturnKeyword = 128, - ReturnsKeyword = 129, - RevertKeyword = 130, - SecondsKeyword = 131, - Semicolon = 132, - SignedFixedType = 133, - SignedIntegerType = 134, - SingleLineComment = 135, - SingleQuotedAsciiStringLiteral = 136, - SingleQuotedUnicodeStringLiteral = 137, - Slash = 138, - SlashEqual = 139, - SolidityKeyword = 140, - StorageKeyword = 141, - StringKeyword = 142, - StructKeyword = 143, - SwitchKeyword = 144, - SzaboKeyword = 145, - ThrowKeyword = 146, - Tilde = 147, - TrueKeyword = 148, - TryKeyword = 149, - TypeKeyword = 150, - UncheckedKeyword = 151, - UnicodeEscape = 152, - UnicodeStringLiteral = 153, - UnsignedFixedType = 154, - UnsignedIntegerType = 155, - UsingKeyword = 156, - VarKeyword = 157, - VersionPragmaValue = 158, - ViewKeyword = 159, - VirtualKeyword = 160, - WeeksKeyword = 161, - WeiKeyword = 162, - WhileKeyword = 163, - Whitespace = 164, - YearsKeyword = 165, - YulDecimalLiteral = 166, - YulHexLiteral = 167, - YulIdentifier = 168, - YulKeyword = 169, - YulReservedKeyword = 170, + HexLiteral = 76, + HexStringLiteral = 77, + HoursKeyword = 78, + Identifier = 79, + IdentifierPart = 80, + IdentifierStart = 81, + IfKeyword = 82, + ImmutableKeyword = 83, + ImportKeyword = 84, + IndexedKeyword = 85, + InterfaceKeyword = 86, + InternalKeyword = 87, + IsKeyword = 88, + LeaveKeyword = 89, + LessThan = 90, + LessThanEqual = 91, + LessThanLessThan = 92, + LessThanLessThanEqual = 93, + LetKeyword = 94, + LibraryKeyword = 95, + MappingKeyword = 96, + MemoryKeyword = 97, + Minus = 98, + MinusEqual = 99, + MinusGreaterThan = 100, + MinusMinus = 101, + MinutesKeyword = 102, + ModifierKeyword = 103, + MultilineComment = 104, + NewKeyword = 105, + NotAnIdentifierInAnyVersion = 106, + NotAnIdentifierInSomeVersions = 107, + OpenBrace = 108, + OpenBracket = 109, + OpenParen = 110, + OverrideKeyword = 111, + PayableKeyword = 112, + Percent = 113, + PercentEqual = 114, + Period = 115, + Plus = 116, + PlusEqual = 117, + PlusPlus = 118, + PossiblySeparatedPairsOfHexDigits = 119, + PragmaKeyword = 120, + PrivateKeyword = 121, + PublicKeyword = 122, + PureKeyword = 123, + QuestionMark = 124, + RawIdentifier = 125, + ReceiveKeyword = 126, + ReturnKeyword = 127, + ReturnsKeyword = 128, + RevertKeyword = 129, + SecondsKeyword = 130, + Semicolon = 131, + SignedFixedType = 132, + SignedIntegerType = 133, + SingleLineComment = 134, + SingleQuotedAsciiStringLiteral = 135, + SingleQuotedUnicodeStringLiteral = 136, + Slash = 137, + SlashEqual = 138, + SolidityKeyword = 139, + StorageKeyword = 140, + StringKeyword = 141, + StructKeyword = 142, + SwitchKeyword = 143, + SzaboKeyword = 144, + ThrowKeyword = 145, + Tilde = 146, + TrueKeyword = 147, + TryKeyword = 148, + TypeKeyword = 149, + UncheckedKeyword = 150, + UnicodeEscape = 151, + UnicodeStringLiteral = 152, + UnsignedFixedType = 153, + UnsignedIntegerType = 154, + UsingKeyword = 155, + VarKeyword = 156, + VersionPragmaValue = 157, + ViewKeyword = 158, + VirtualKeyword = 159, + WeeksKeyword = 160, + WeiKeyword = 161, + WhileKeyword = 162, + Whitespace = 163, + YearsKeyword = 164, + YulDecimalLiteral = 165, + YulHexLiteral = 166, + YulIdentifier = 167, + YulKeyword = 168, + YulReservedKeyword = 169, } export enum RuleKind { ABICoderPragma = 0, @@ -217,133 +216,132 @@ export enum RuleKind { ConstructorAttribute = 28, ConstructorDefinition = 29, ContinueStatement = 30, - ContractBodyElement = 31, - ContractBodyElements = 32, - ContractDefinition = 33, - DataLocation = 34, - Definition = 35, - DeleteStatement = 36, - Directive = 37, - DoWhileStatement = 38, - ElementaryType = 39, - EmitStatement = 40, - EndOfFileTrivia = 41, - EnumDefinition = 42, - EqualityComparisonExpression = 43, - EqualityComparisonOperator = 44, - ErrorDefinition = 45, - ErrorParameter = 46, - EventDefinition = 47, - EventParameter = 48, - ExperimentalPragma = 49, - ExponentiationExpression = 50, - ExponentiationOperator = 51, - Expression = 52, - ExpressionStatement = 53, - FallbackFunctionAttribute = 54, - FallbackFunctionDefinition = 55, - ForStatement = 56, - FunctionAttribute = 57, - FunctionCallExpression = 58, - FunctionCallOperator = 59, - FunctionCallOptions = 60, - FunctionDefinition = 61, - FunctionType = 62, - IdentifierPath = 63, - IfStatement = 64, - ImportAlias = 65, - ImportDirective = 66, - ImportPath = 67, - IndexAccessExpression = 68, - IndexAccessOperator = 69, - InheritanceSpecifier = 70, - InheritanceSpecifierList = 71, - InterfaceDefinition = 72, - LeadingTrivia = 73, - LibraryDefinition = 74, - MappingKeyType = 75, - MappingType = 76, - MappingValueType = 77, - MemberAccessExpression = 78, - MemberAccessOperator = 79, - ModifierAttribute = 80, - ModifierDefinition = 81, - ModifierInvocation = 82, - MulDivModExpression = 83, - MulDivModOperator = 84, - NamedArgument = 85, - NamedArgumentList = 86, - NewExpression = 87, - NumberUnit = 88, - NumericExpression = 89, - OrExpression = 90, - OrOperator = 91, - OrderComparisonExpression = 92, - OrderComparisonOperator = 93, - OverrideSpecifier = 94, - ParameterDeclaration = 95, - ParameterList = 96, - PayableType = 97, - PositionalArgumentList = 98, - PragmaDirective = 99, - PrimaryExpression = 100, - ReceiveFunctionAttribute = 101, - ReceiveFunctionDefinition = 102, - Results = 103, - ReturnStatement = 104, - RevertStatement = 105, - SelectiveImport = 106, - ShiftExpression = 107, - ShiftOperator = 108, - SimpleImport = 109, - SimpleStatement = 110, - SourceUnit = 111, - StateVariableAttribute = 112, - StateVariableDeclaration = 113, - Statement = 114, - StringExpression = 115, - StructDefinition = 116, - StructMember = 117, - ThrowStatement = 118, - TrailingTrivia = 119, - TryStatement = 120, - TupleDeconstructionStatement = 121, - TupleExpression = 122, - TypeExpression = 123, - TypeName = 124, - UnaryPostfixExpression = 125, - UnaryPostfixOperator = 126, - UnaryPrefixExpression = 127, - UnaryPrefixOperator = 128, - UncheckedBlock = 129, - UnnamedFunctionAttribute = 130, - UnnamedFunctionDefinition = 131, - UserDefinedOperator = 132, - UserDefinedValueTypeDefinition = 133, - UsingDirective = 134, - VariableDeclarationStatement = 135, - VersionPragma = 136, - VersionPragmaAlternatives = 137, - VersionPragmaComparator = 138, - VersionPragmaExpression = 139, - VersionPragmaRange = 140, - VersionPragmaSpecifier = 141, - WhileStatement = 142, - YulAssignmentStatement = 143, - YulBlock = 144, - YulBreakStatement = 145, - YulContinueStatement = 146, - YulDeclarationStatement = 147, - YulExpression = 148, - YulForStatement = 149, - YulFunctionCallExpression = 150, - YulFunctionDefinition = 151, - YulIdentifierPath = 152, - YulIfStatement = 153, - YulLeaveStatement = 154, - YulLiteral = 155, - YulStatement = 156, - YulSwitchStatement = 157, + ContractBodyElements = 31, + ContractDefinition = 32, + DataLocation = 33, + Definition = 34, + DeleteStatement = 35, + Directive = 36, + DoWhileStatement = 37, + ElementaryType = 38, + EmitStatement = 39, + EndOfFileTrivia = 40, + EnumDefinition = 41, + EqualityComparisonExpression = 42, + EqualityComparisonOperator = 43, + ErrorDefinition = 44, + ErrorParameter = 45, + EventDefinition = 46, + EventParameter = 47, + ExperimentalPragma = 48, + ExponentiationExpression = 49, + ExponentiationOperator = 50, + Expression = 51, + ExpressionStatement = 52, + FallbackFunctionAttribute = 53, + FallbackFunctionDefinition = 54, + ForStatement = 55, + FunctionAttribute = 56, + FunctionCallExpression = 57, + FunctionCallOperator = 58, + FunctionCallOptions = 59, + FunctionDefinition = 60, + FunctionType = 61, + IdentifierPath = 62, + IfStatement = 63, + ImportAlias = 64, + ImportDirective = 65, + ImportPath = 66, + IndexAccessExpression = 67, + IndexAccessOperator = 68, + InheritanceSpecifier = 69, + InheritanceSpecifierList = 70, + InterfaceDefinition = 71, + LeadingTrivia = 72, + LibraryDefinition = 73, + MappingKeyType = 74, + MappingType = 75, + MappingValueType = 76, + MemberAccessExpression = 77, + MemberAccessOperator = 78, + ModifierAttribute = 79, + ModifierDefinition = 80, + ModifierInvocation = 81, + MulDivModExpression = 82, + MulDivModOperator = 83, + NamedArgument = 84, + NamedArgumentList = 85, + NewExpression = 86, + NumberUnit = 87, + NumericExpression = 88, + OrExpression = 89, + OrOperator = 90, + OrderComparisonExpression = 91, + OrderComparisonOperator = 92, + OverrideSpecifier = 93, + ParameterDeclaration = 94, + ParameterList = 95, + PayableType = 96, + PositionalArgumentList = 97, + PragmaDirective = 98, + PrimaryExpression = 99, + ReceiveFunctionAttribute = 100, + ReceiveFunctionDefinition = 101, + Results = 102, + ReturnStatement = 103, + RevertStatement = 104, + SelectiveImport = 105, + ShiftExpression = 106, + ShiftOperator = 107, + SimpleImport = 108, + SimpleStatement = 109, + SourceUnit = 110, + StateVariableAttribute = 111, + StateVariableDeclaration = 112, + Statement = 113, + StringExpression = 114, + StructDefinition = 115, + StructMember = 116, + ThrowStatement = 117, + TrailingTrivia = 118, + TryStatement = 119, + TupleDeconstructionStatement = 120, + TupleExpression = 121, + TypeExpression = 122, + TypeName = 123, + UnaryPostfixExpression = 124, + UnaryPostfixOperator = 125, + UnaryPrefixExpression = 126, + UnaryPrefixOperator = 127, + UncheckedBlock = 128, + UnnamedFunctionAttribute = 129, + UnnamedFunctionDefinition = 130, + UserDefinedOperator = 131, + UserDefinedValueTypeDefinition = 132, + UsingDirective = 133, + VariableDeclarationStatement = 134, + VersionPragma = 135, + VersionPragmaAlternatives = 136, + VersionPragmaComparator = 137, + VersionPragmaExpressionList = 138, + VersionPragmaRange = 139, + VersionPragmaSpecifier = 140, + WhileStatement = 141, + YulAssignmentStatement = 142, + YulBlock = 143, + YulBreakStatement = 144, + YulContinueStatement = 145, + YulDeclarationStatement = 146, + YulExpression = 147, + YulForStatement = 148, + YulFunctionCallExpression = 149, + YulFunctionDefinition = 150, + YulIdentifierPath = 151, + YulIfStatement = 152, + YulLeaveStatement = 153, + YulLiteral = 154, + YulStatement = 155, + YulSwitchStatement = 156, } export enum ProductionKind { ABICoderPragma = 0, @@ -404,251 +402,248 @@ export enum ProductionKind { ConstructorKeyword = 55, ContinueKeyword = 56, ContinueStatement = 57, - ContractBodyElement = 58, - ContractDefinition = 59, - ContractKeyword = 60, - DataLocation = 61, - DaysKeyword = 62, - DecimalExponent = 63, - DecimalLiteral = 64, - DecimalNumber = 65, - DefaultKeyword = 66, - Definition = 67, - DeleteKeyword = 68, - DeleteStatement = 69, - Directive = 70, - DoKeyword = 71, - DoWhileStatement = 72, - DoubleQuotedAsciiStringLiteral = 73, - DoubleQuotedUnicodeStringLiteral = 74, - ElementaryType = 75, - ElseKeyword = 76, - EmitKeyword = 77, - EmitStatement = 78, - EndOfFileTrivia = 79, - EndOfLine = 80, - EnumDefinition = 81, - EnumKeyword = 82, - Equal = 83, - EqualEqual = 84, - EqualGreaterThan = 85, - EqualityComparisonOperator = 86, - ErrorDefinition = 87, - ErrorKeyword = 88, - ErrorParameter = 89, - EscapeSequence = 90, - EtherKeyword = 91, - EventDefinition = 92, - EventKeyword = 93, - EventParameter = 94, - Evmasm = 95, - ExperimentalKeyword = 96, - ExperimentalPragma = 97, - ExponentiationOperator = 98, - Expression = 99, - ExpressionStatement = 100, - ExternalKeyword = 101, - FallbackFunctionAttribute = 102, - FallbackFunctionDefinition = 103, - FallbackKeyword = 104, - FalseKeyword = 105, - FinneyKeyword = 106, - FixedBytesType = 107, - ForKeyword = 108, - ForStatement = 109, - FromKeyword = 110, - FunctionAttribute = 111, - FunctionCallOperator = 112, - FunctionCallOptions = 113, - FunctionDefinition = 114, - FunctionKeyword = 115, - FunctionType = 116, - GlobalKeyword = 117, - GreaterThan = 118, - GreaterThanEqual = 119, - GreaterThanGreaterThan = 120, - GreaterThanGreaterThanEqual = 121, - GreaterThanGreaterThanGreaterThan = 122, - GreaterThanGreaterThanGreaterThanEqual = 123, - GweiKeyword = 124, - HexByteEscape = 125, - HexCharacter = 126, - HexLiteral = 127, - HexStringLiteral = 128, - HoursKeyword = 129, - Identifier = 130, - IdentifierPart = 131, - IdentifierPath = 132, - IdentifierStart = 133, - IfKeyword = 134, - IfStatement = 135, - ImmutableKeyword = 136, - ImportAlias = 137, - ImportDirective = 138, - ImportKeyword = 139, - ImportPath = 140, - IndexAccessOperator = 141, - IndexedKeyword = 142, - InheritanceSpecifier = 143, - InheritanceSpecifierList = 144, - InterfaceDefinition = 145, - InterfaceKeyword = 146, - InternalKeyword = 147, - IsKeyword = 148, - LeadingTrivia = 149, - LeaveKeyword = 150, - LessThan = 151, - LessThanEqual = 152, - LessThanLessThan = 153, - LessThanLessThanEqual = 154, - LetKeyword = 155, - LibraryDefinition = 156, - LibraryKeyword = 157, - MappingKeyType = 158, - MappingKeyword = 159, - MappingType = 160, - MappingValueType = 161, - MemberAccessOperator = 162, - MemoryKeyword = 163, - Minus = 164, - MinusEqual = 165, - MinusGreaterThan = 166, - MinusMinus = 167, - MinutesKeyword = 168, - ModifierAttribute = 169, - ModifierDefinition = 170, - ModifierInvocation = 171, - ModifierKeyword = 172, - MulDivModOperator = 173, - MultilineComment = 174, - NamedArgument = 175, - NamedArgumentList = 176, - NewExpression = 177, - NewKeyword = 178, - NotAnIdentifierInAnyVersion = 179, - NotAnIdentifierInSomeVersions = 180, - NumberUnit = 181, - NumericExpression = 182, - OpenBrace = 183, - OpenBracket = 184, - OpenParen = 185, - OrOperator = 186, - OrderComparisonOperator = 187, - OverrideKeyword = 188, - OverrideSpecifier = 189, - ParameterDeclaration = 190, - ParameterList = 191, - PayableKeyword = 192, - PayableType = 193, - Percent = 194, - PercentEqual = 195, - Period = 196, - Plus = 197, - PlusEqual = 198, - PlusPlus = 199, - PositionalArgumentList = 200, - PossiblySeparatedPairsOfHexDigits = 201, - PragmaDirective = 202, - PragmaKeyword = 203, - PrimaryExpression = 204, - PrivateKeyword = 205, - PublicKeyword = 206, - PureKeyword = 207, - QuestionMark = 208, - RawIdentifier = 209, - ReceiveFunctionAttribute = 210, - ReceiveFunctionDefinition = 211, - ReceiveKeyword = 212, - ReturnKeyword = 213, - ReturnStatement = 214, - ReturnsKeyword = 215, - RevertKeyword = 216, - RevertStatement = 217, - SecondsKeyword = 218, - SelectiveImport = 219, - Semicolon = 220, - ShiftOperator = 221, - SignedFixedType = 222, - SignedIntegerType = 223, - SimpleImport = 224, - SimpleStatement = 225, - SingleLineComment = 226, - SingleQuotedAsciiStringLiteral = 227, - SingleQuotedUnicodeStringLiteral = 228, - Slash = 229, - SlashEqual = 230, - SolidityKeyword = 231, - SourceUnit = 232, - StateVariableAttribute = 233, - StateVariableDeclaration = 234, - Statement = 235, - StorageKeyword = 236, - StringExpression = 237, - StringKeyword = 238, - StructDefinition = 239, - StructKeyword = 240, - StructMember = 241, - SwitchKeyword = 242, - SzaboKeyword = 243, - ThrowKeyword = 244, - ThrowStatement = 245, - Tilde = 246, - TrailingTrivia = 247, - TrueKeyword = 248, - TryKeyword = 249, - TryStatement = 250, - TupleDeconstructionStatement = 251, - TupleExpression = 252, - TypeExpression = 253, - TypeKeyword = 254, - TypeName = 255, - UnaryPostfixOperator = 256, - UnaryPrefixOperator = 257, - UncheckedBlock = 258, - UncheckedKeyword = 259, - UnicodeEscape = 260, - UnicodeStringLiteral = 261, - UnnamedFunctionAttribute = 262, - UnnamedFunctionDefinition = 263, - UnsignedFixedType = 264, - UnsignedIntegerType = 265, - UserDefinedOperator = 266, - UserDefinedValueTypeDefinition = 267, - UsingDirective = 268, - UsingKeyword = 269, - VarKeyword = 270, - VariableDeclarationStatement = 271, - VersionPragma = 272, - VersionPragmaExpression = 273, - VersionPragmaSpecifier = 274, - VersionPragmaValue = 275, - ViewKeyword = 276, - VirtualKeyword = 277, - WeeksKeyword = 278, - WeiKeyword = 279, - WhileKeyword = 280, - WhileStatement = 281, - Whitespace = 282, - YearsKeyword = 283, - YulAssignmentStatement = 284, - YulBlock = 285, - YulBreakStatement = 286, - YulContinueStatement = 287, - YulDecimalLiteral = 288, - YulDeclarationStatement = 289, - YulExpression = 290, - YulForStatement = 291, - YulFunctionDefinition = 292, - YulHexLiteral = 293, - YulIdentifier = 294, - YulIdentifierPath = 295, - YulIfStatement = 296, - YulKeyword = 297, - YulLeaveStatement = 298, - YulLiteral = 299, - YulReservedKeyword = 300, - YulStatement = 301, - YulSwitchStatement = 302, + ContractDefinition = 58, + ContractKeyword = 59, + DataLocation = 60, + DaysKeyword = 61, + DecimalExponent = 62, + DecimalLiteral = 63, + DecimalNumber = 64, + DefaultKeyword = 65, + Definition = 66, + DeleteKeyword = 67, + DeleteStatement = 68, + Directive = 69, + DoKeyword = 70, + DoWhileStatement = 71, + DoubleQuotedAsciiStringLiteral = 72, + DoubleQuotedUnicodeStringLiteral = 73, + ElementaryType = 74, + ElseKeyword = 75, + EmitKeyword = 76, + EmitStatement = 77, + EndOfFileTrivia = 78, + EndOfLine = 79, + EnumDefinition = 80, + EnumKeyword = 81, + Equal = 82, + EqualEqual = 83, + EqualGreaterThan = 84, + EqualityComparisonOperator = 85, + ErrorDefinition = 86, + ErrorKeyword = 87, + ErrorParameter = 88, + EscapeSequence = 89, + EtherKeyword = 90, + EventDefinition = 91, + EventKeyword = 92, + EventParameter = 93, + Evmasm = 94, + ExperimentalKeyword = 95, + ExperimentalPragma = 96, + ExponentiationOperator = 97, + Expression = 98, + ExpressionStatement = 99, + ExternalKeyword = 100, + FallbackFunctionAttribute = 101, + FallbackFunctionDefinition = 102, + FallbackKeyword = 103, + FalseKeyword = 104, + FinneyKeyword = 105, + FixedBytesType = 106, + ForKeyword = 107, + ForStatement = 108, + FromKeyword = 109, + FunctionAttribute = 110, + FunctionCallOperator = 111, + FunctionCallOptions = 112, + FunctionDefinition = 113, + FunctionKeyword = 114, + FunctionType = 115, + GlobalKeyword = 116, + GreaterThan = 117, + GreaterThanEqual = 118, + GreaterThanGreaterThan = 119, + GreaterThanGreaterThanEqual = 120, + GreaterThanGreaterThanGreaterThan = 121, + GreaterThanGreaterThanGreaterThanEqual = 122, + GweiKeyword = 123, + HexByteEscape = 124, + HexLiteral = 125, + HexStringLiteral = 126, + HoursKeyword = 127, + Identifier = 128, + IdentifierPart = 129, + IdentifierPath = 130, + IdentifierStart = 131, + IfKeyword = 132, + IfStatement = 133, + ImmutableKeyword = 134, + ImportAlias = 135, + ImportDirective = 136, + ImportKeyword = 137, + ImportPath = 138, + IndexAccessOperator = 139, + IndexedKeyword = 140, + InheritanceSpecifier = 141, + InheritanceSpecifierList = 142, + InterfaceDefinition = 143, + InterfaceKeyword = 144, + InternalKeyword = 145, + IsKeyword = 146, + LeadingTrivia = 147, + LeaveKeyword = 148, + LessThan = 149, + LessThanEqual = 150, + LessThanLessThan = 151, + LessThanLessThanEqual = 152, + LetKeyword = 153, + LibraryDefinition = 154, + LibraryKeyword = 155, + MappingKeyType = 156, + MappingKeyword = 157, + MappingType = 158, + MappingValueType = 159, + MemberAccessOperator = 160, + MemoryKeyword = 161, + Minus = 162, + MinusEqual = 163, + MinusGreaterThan = 164, + MinusMinus = 165, + MinutesKeyword = 166, + ModifierAttribute = 167, + ModifierDefinition = 168, + ModifierInvocation = 169, + ModifierKeyword = 170, + MulDivModOperator = 171, + MultilineComment = 172, + NamedArgument = 173, + NamedArgumentList = 174, + NewExpression = 175, + NewKeyword = 176, + NotAnIdentifierInAnyVersion = 177, + NotAnIdentifierInSomeVersions = 178, + NumberUnit = 179, + NumericExpression = 180, + OpenBrace = 181, + OpenBracket = 182, + OpenParen = 183, + OrOperator = 184, + OrderComparisonOperator = 185, + OverrideKeyword = 186, + OverrideSpecifier = 187, + ParameterDeclaration = 188, + ParameterList = 189, + PayableKeyword = 190, + PayableType = 191, + Percent = 192, + PercentEqual = 193, + Period = 194, + Plus = 195, + PlusEqual = 196, + PlusPlus = 197, + PositionalArgumentList = 198, + PossiblySeparatedPairsOfHexDigits = 199, + PragmaDirective = 200, + PragmaKeyword = 201, + PrimaryExpression = 202, + PrivateKeyword = 203, + PublicKeyword = 204, + PureKeyword = 205, + QuestionMark = 206, + RawIdentifier = 207, + ReceiveFunctionAttribute = 208, + ReceiveFunctionDefinition = 209, + ReceiveKeyword = 210, + ReturnKeyword = 211, + ReturnStatement = 212, + ReturnsKeyword = 213, + RevertKeyword = 214, + RevertStatement = 215, + SecondsKeyword = 216, + SelectiveImport = 217, + Semicolon = 218, + ShiftOperator = 219, + SignedFixedType = 220, + SignedIntegerType = 221, + SimpleImport = 222, + SimpleStatement = 223, + SingleLineComment = 224, + SingleQuotedAsciiStringLiteral = 225, + SingleQuotedUnicodeStringLiteral = 226, + Slash = 227, + SlashEqual = 228, + SolidityKeyword = 229, + SourceUnit = 230, + StateVariableAttribute = 231, + StateVariableDeclaration = 232, + Statement = 233, + StorageKeyword = 234, + StringExpression = 235, + StringKeyword = 236, + StructDefinition = 237, + StructKeyword = 238, + StructMember = 239, + SwitchKeyword = 240, + SzaboKeyword = 241, + ThrowKeyword = 242, + ThrowStatement = 243, + Tilde = 244, + TrailingTrivia = 245, + TrueKeyword = 246, + TryKeyword = 247, + TryStatement = 248, + TupleDeconstructionStatement = 249, + TupleExpression = 250, + TypeExpression = 251, + TypeKeyword = 252, + TypeName = 253, + UnaryPostfixOperator = 254, + UnaryPrefixOperator = 255, + UncheckedBlock = 256, + UncheckedKeyword = 257, + UnicodeEscape = 258, + UnicodeStringLiteral = 259, + UnnamedFunctionAttribute = 260, + UnnamedFunctionDefinition = 261, + UnsignedFixedType = 262, + UnsignedIntegerType = 263, + UserDefinedOperator = 264, + UserDefinedValueTypeDefinition = 265, + UsingDirective = 266, + UsingKeyword = 267, + VarKeyword = 268, + VariableDeclarationStatement = 269, + VersionPragma = 270, + VersionPragmaSpecifier = 271, + VersionPragmaValue = 272, + ViewKeyword = 273, + VirtualKeyword = 274, + WeeksKeyword = 275, + WeiKeyword = 276, + WhileKeyword = 277, + WhileStatement = 278, + Whitespace = 279, + YearsKeyword = 280, + YulAssignmentStatement = 281, + YulBlock = 282, + YulBreakStatement = 283, + YulContinueStatement = 284, + YulDecimalLiteral = 285, + YulDeclarationStatement = 286, + YulExpression = 287, + YulForStatement = 288, + YulFunctionDefinition = 289, + YulHexLiteral = 290, + YulIdentifier = 291, + YulIdentifierPath = 292, + YulIfStatement = 293, + YulKeyword = 294, + YulLeaveStatement = 295, + YulLiteral = 296, + YulReservedKeyword = 297, + YulStatement = 298, + YulSwitchStatement = 299, } export class RuleNode { get type(): NodeType.Rule; 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 65f40d3efd..037700240f 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,38 +16,36 @@ Tree: - InterfaceKeyword (Token): "interface" # 0..9 - Identifier (Token): "ICounter" # 10..18 - OpenBrace (Token): "{" # 19..20 - - ContractBodyElement (Rule): # 21..105 " // returns the current count\n function coun..." - - FunctionDefinition (Rule): # 21..105 " // returns the current count\n function coun..." - - FunctionKeyword (Token): # 21..66 " // returns the current count\n function" - - SingleLineComment (Trivia): "// returns the current count" # 25..53 - - Contents: "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 - - ContractBodyElement (Rule): # 105..171 "\n // increments the counter\n function increm..." - - FunctionDefinition (Rule): # 105..171 "\n // increments the counter\n function increm..." - - FunctionKeyword (Token): # 105..148 "\n // increments the counter\n function" - - SingleLineComment (Trivia): "// increments the counter" # 110..135 - - Contents: "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 + - FunctionDefinition (Rule): # 21..105 " // returns the current count\n function coun..." + - FunctionKeyword (Token): # 21..66 " // returns the current count\n function" + - SingleLineComment (Trivia): "// returns the current count" # 25..53 + - Contents: "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..." + - FunctionKeyword (Token): # 105..148 "\n // increments the counter\n function" + - SingleLineComment (Trivia): "// increments the counter" # 110..135 + - Contents: "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 - CloseBrace (Token): "}" # 171..172 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 8852529b13..a756be6f38 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,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..33 "solidity 0.5.0 || 0.6.0 || ^0.7.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpression (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" + - 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" 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 ffaccc8d64..1d0e7690c9 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,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..15 "solidity =0.8.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpression (Rule): # 8..15 " =0.8.0" + - 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" 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 55083e5fa8..e6925af5dc 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,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..14 "solidity 0.8.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpression (Rule): # 8..14 " 0.8.0" + - VersionPragmaExpressionList (Rule): # 8..14 " 0.8.0" - VersionPragmaSpecifier (Rule): # 8..14 " 0.8.0" - VersionPragmaValue (Token): "0" # 9..10 - Period (Token): "." # 10..11 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 f7d24b49e2..5ffb04dfed 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,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..15 "solidity <1.0.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpression (Rule): # 8..15 " <1.0.0" + - 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" 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 492200c012..4e144da5fa 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,14 +8,13 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..20 "solidity 0.7.0 0.8.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpression (Rule): # 8..14 " 0.7.0" + - 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 - - VersionPragmaExpression (Rule): # 14..20 " 0.8.0" - VersionPragmaSpecifier (Rule): # 14..20 " 0.8.0" - VersionPragmaValue (Token): "0" # 15..16 - Period (Token): "." # 16..17 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 aae14aac88..f95cf58578 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,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..30 "solidity ^1.0.0 || 2.0.0-3.0.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpression (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" + - 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 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 7deb6f47c5..920f0eb7e7 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,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..22 "solidity 0.6.0 - 0.7.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpression (Rule): # 8..22 " 0.6.0 - 0.7.0" + - 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 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 4cb3025ef6..ab99f8f308 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,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..68 "solidity /* comments */ 0 /* are */ . /* allowed *..." - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpression (Rule): # 8..68 " /* comments */ 0 /* are */ . /* allowed */ 0 . /*..." + - VersionPragmaExpressionList (Rule): # 8..68 " /* comments */ 0 /* are */ . /* allowed */ 0 . /*..." - VersionPragmaSpecifier (Rule): # 8..68 " /* comments */ 0 /* are */ . /* allowed */ 0 . /*..." - VersionPragmaValue (Token): # 8..25 " /* comments */ 0" - MultilineComment (Trivia): "/* comments */" # 9..23 diff --git a/crates/solidity/testing/utils/src/version_pragmas/mod.rs b/crates/solidity/testing/utils/src/version_pragmas/mod.rs index db97a71afb..71da3641c9 100644 --- a/crates/solidity/testing/utils/src/version_pragmas/mod.rs +++ b/crates/solidity/testing/utils/src/version_pragmas/mod.rs @@ -3,7 +3,7 @@ mod tests; use std::{rc::Rc, str::FromStr}; -use anyhow::{bail, Context, Error, Result}; +use anyhow::{bail, ensure, Context, Error, Result}; use semver::{Comparator, Op, Version}; use slang_solidity::{ language::Language, @@ -50,25 +50,24 @@ impl<'context> Visitor for PragmaCollector<'context> { kind: RuleKind, range: &TextRange, children: &Vec>, - node: &Rc, + _node: &Rc, _path: &Vec>, ) -> Result { - if kind != RuleKind::VersionPragmaExpression { + if kind != RuleKind::VersionPragmaExpressionList { return Ok(VisitorEntryResponse::StepIn); } - let pragma = match &children[..] { - [child] => self.extract_pragma(child).with_context(|| { + for child in children { + let pragma = self.extract_pragma(child).with_context(|| { format!( "Failed to extract pragma at {range:?}: '{value}'", range = range.start.byte..range.end.byte, value = child.extract_non_trivia(self.source) ) - })?, - _ => unreachable!("Expected single child: {node:?}"), - }; + }); - self.pragmas.push(pragma); + self.pragmas.push(pragma?); + } return Ok(VisitorEntryResponse::StepOver); } @@ -78,50 +77,53 @@ impl<'context> PragmaCollector<'context> { fn extract_pragma(&self, node: &Node) -> Result { let (kind, children) = match node { Node::Rule { kind, children, .. } => (kind, children), - _ => panic!("Expected rule: {node:?}"), + _ => bail!("Expected rule: {node:?}"), }; match kind { RuleKind::VersionPragmaAlternatives => match &children[..] { [left, operator, right] => { - assert_eq!(operator.extract_non_trivia(self.source), "||"); + ensure!(operator.extract_non_trivia(self.source) == "||"); let left = self.extract_pragma(left)?; let right = self.extract_pragma(right)?; - return Ok(VersionPragma::Or(Box::new(left), Box::new(right))); + return Ok(VersionPragma::or(left, right)); } - _ => unreachable!("Expected 3 children: {node:?}"), + _ => bail!("Expected 3 children: {node:?}"), }, RuleKind::VersionPragmaRange => match &children[..] { - [left, operator, right] => { - assert_eq!(operator.extract_non_trivia(self.source), "-"); + [start, operator, end] => { + ensure!(operator.extract_non_trivia(self.source) == "-"); - let mut left = self.extract_pragma(left)?.extract_single()?; - let mut right = self.extract_pragma(right)?.extract_single()?; + 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 - left.op = Op::GreaterEq; - right.op = Op::LessEq; + start.op = Op::GreaterEq; + end.op = Op::LessEq; - return Ok(VersionPragma::And(left, right)); + return Ok(VersionPragma::and( + VersionPragma::single(start), + VersionPragma::single(end), + )); } - _ => unreachable!("Expected 3 children: {node:?}"), + _ => bail!("Expected 3 children: {node:?}"), }, RuleKind::VersionPragmaComparator => { let value = node.extract_non_trivia(self.source); let comparator = Comparator::from_str(&value)?; - return Ok(VersionPragma::Single(comparator)); + return Ok(VersionPragma::single(comparator)); } RuleKind::VersionPragmaSpecifier => { let specifier = node.extract_non_trivia(self.source); let comparator = Comparator::from_str(&format!("={specifier}"))?; - return Ok(VersionPragma::Single(comparator)); + return Ok(VersionPragma::single(comparator)); } - _ => unreachable!("Unexpected {kind:?}: {children:?}"), + _ => bail!("Unexpected {kind:?}: {children:?}"), }; } } @@ -129,11 +131,23 @@ impl<'context> PragmaCollector<'context> { #[derive(Debug)] pub enum VersionPragma { Or(Box, Box), - And(Comparator, Comparator), + And(Box, Box), Single(Comparator), } impl VersionPragma { + pub fn or(left: Self, right: Self) -> Self { + return Self::Or(Box::new(left), Box::new(right)); + } + + pub fn and(left: Self, right: Self) -> Self { + return Self::And(Box::new(left), Box::new(right)); + } + + pub fn single(comparator: Comparator) -> Self { + return Self::Single(comparator); + } + pub fn matches(&self, version: &Version) -> bool { match self { Self::Or(left, right) => { @@ -148,10 +162,10 @@ impl VersionPragma { }; } - fn extract_single(self) -> Result { + fn comparator(self) -> Result { match self { Self::Single(comparator) => return Ok(comparator), - _ => bail!("Expected Single: {self:?}"), + _ => bail!("Expected Single Comparator: {self:?}"), }; } }