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

unreserve AddressKeyword and allow it to be used as a field name #1134

Merged

Conversation

OmarTawfik
Copy link
Contributor

No description provided.

@OmarTawfik OmarTawfik requested a review from a team as a code owner October 29, 2024 13:15
@OmarTawfik OmarTawfik enabled auto-merge October 29, 2024 13:15
Copy link

changeset-bot bot commented Oct 29, 2024

🦋 Changeset detected

Latest commit: b658ec2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nomicfoundation/slang Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@OmarTawfik OmarTawfik force-pushed the unreserve-address-keyword branch from 49ac859 to b658ec2 Compare October 29, 2024 13:53
@OmarTawfik OmarTawfik requested a review from a team October 29, 2024 21:33
Copy link
Contributor

@ggiraldez ggiraldez left a comment

Choose a reason for hiding this comment

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

I don't think we should move forward with this change. While I like that it simplifies the grammar (and binding) rules, address is reserved in Solidity. The language does not allow using it to name variables, functions or fields. We would be successfully parsing invalid Solidity source files.

Copy link
Contributor

@ggiraldez ggiraldez left a comment

Choose a reason for hiding this comment

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

As we discussed, since validating Solidity source is not a main concern for Slang you can disregard my previous review. Other than that, this looks good to me.

@OmarTawfik OmarTawfik added this pull request to the merge queue Oct 30, 2024
Merged via the queue into NomicFoundation:main with commit cfc62f2 Oct 30, 2024
1 check passed
@OmarTawfik OmarTawfik deleted the unreserve-address-keyword branch October 30, 2024 19:08
@github-actions github-actions bot mentioned this pull request Oct 30, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jan 24, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## @nomicfoundation/[email protected]

### Minor Changes

- [#1156](#1156)
[`3a82f06`](3a82f06)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add
`node.descendants()` and `cursor.descendants()` APIs to allow iterating
over all descendants of the current node in pre-order traversal.

- [#1156](#1156)
[`3a82f06`](3a82f06)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - fix
`node.children()` and `parseOutput.errors()` return types

- [#1194](#1194)
[`7a25d63`](7a25d63)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - split
`parser/Parser.supportedVersions()` into a new `utils/LanguageFacts`
API, with `allVersions()`, `earliestVersion()`, and `latestVersion()`
methods.

- [#1194](#1194)
[`7a25d63`](7a25d63)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - expose the
`BingingGraph` API to allow querying definitions/references between
source files.

- [#1156](#1156)
[`3a82f06`](3a82f06)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add
`cursor.ancestors()` API to allow iterating over all ancestors of the
current node, starting with the immediate parent, and moving upwards,
ending with the root node.

- [#1156](#1156)
[`3a82f06`](3a82f06)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add
`cursor.remainingNodes()` API to allow iterating over all the remaining
nodes in the current tree, moving in pre-order traversal, until the tree
is completed.

- [#1223](#1223)
[`3e85a14`](3e85a14)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - split
`Parser.parse()` API into `parse_file_contents()` and
`parse_nonterminal()`.

- [#1194](#1194)
[`7a25d63`](7a25d63)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add a
`CompilationBuilder` API to incrementally load and resolve source files
and their imports.

- [#1223](#1223)
[`3e85a14`](3e85a14)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - rename
`Query.parse()` to `Query.create()`, and provide exact `TextRange` for
any errors it returns.

- [#1172](#1172)
[`6102886`](6102886)
Thanks [@beta-ziliani](https://github.com/beta-ziliani)! - Improved
error recovery, where leading trivia are always parsed and included
before an erroneous terminal.

- [#1223](#1223)
[`3e85a14`](3e85a14)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add
`TerminalKindExtensions.is_identifier()` API to distinguish terminals
like Solidity's `Identifier` and Yul's `YulIdentifier`.

### Patch Changes

- [#1134](#1134)
[`cfc62f2`](cfc62f2)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - remove
`YulPathComponent` and just use `YulIdentifier` instead.

- [#1138](#1138)
[`44a706f`](44a706f)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add `ThisKeyword`
and `SuperKeyword` to the grammar, instead of parsing them as
identifiers.

- [#1134](#1134)
[`cfc62f2`](cfc62f2)
Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - unreserve
`AddressKeyword`, and let it be used for `MemberAccessExpression`,
`StructMember`, etc...

- [#1154](#1154)
[`7b9b478`](7b9b478)
Thanks [@beta-ziliani](https://github.com/beta-ziliani)! - Adding
support for deprecated keywords `jump` and `jumpi`

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants