Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move pragma-specific keywords under dedicated topic #661

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 15 additions & 24 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,21 @@ codegen_language_macros::compile!(Language(
Atom("*")
]))
)]
),
Keyword(
name = SolidityKeyword,
identifier = Identifier,
definitions = [KeywordDefinition(value = Atom("solidity"))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would also need creating a PragmaIdentifier as well for reservation, but I'm happy to tackle this separately after the migration is done. Will add a note for myself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think there are any identifiers in pragmas, but we can separate that for clarity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an Identifier in ExperimentalFeature. Having a dedicated PragmaIdentifier will also force us to think about how the other three keywords affect the reservation of the original Identifier .. But I'm happy to tackle this after the migration, and add some integration tests for it with solc.

),
Keyword(
name = ExperimentalKeyword,
identifier = Identifier,
definitions = [KeywordDefinition(value = Atom("experimental"))]
),
Keyword(
name = AbicoderKeyword,
identifier = Identifier,
definitions = [KeywordDefinition(value = Atom("abicoder"))]
)
]
),
Expand Down Expand Up @@ -407,14 +422,6 @@ codegen_language_macros::compile!(Language(
Topic(
title = "Keywords",
items = [
Keyword(
name = AbicoderKeyword,
identifier = Identifier,
definitions = [KeywordDefinition(
reserved = Never,
value = Atom("abicoder")
)]
),
Keyword(
name = AbstractKeyword,
identifier = Identifier,
Expand Down Expand Up @@ -661,14 +668,6 @@ codegen_language_macros::compile!(Language(
identifier = Identifier,
definitions = [KeywordDefinition(value = Atom("event"))]
),
Keyword(
name = ExperimentalKeyword,
identifier = Identifier,
definitions = [KeywordDefinition(
reserved = Never,
value = Atom("experimental")
)]
),
Keyword(
name = ExternalKeyword,
identifier = Identifier,
Expand Down Expand Up @@ -1314,14 +1313,6 @@ codegen_language_macros::compile!(Language(
value = Atom("sizeof")
)]
),
Keyword(
name = SolidityKeyword,
identifier = Identifier,
definitions = [KeywordDefinition(
reserved = Never,
value = Atom("solidity")
)]
),
Keyword(
name = StaticKeyword,
identifier = Identifier,
Expand Down