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

Use Token instead of IToken in lexical token locations #5957

Merged
merged 9 commits into from
Dec 3, 2024

Conversation

keyboardDrummer
Copy link
Member

@keyboardDrummer keyboardDrummer commented Dec 3, 2024

This PR extract some refactorings from #5931 to make that PR easier to review.

Description

Use Token instead of IToken in locations where we want to work with a lexical token. This only makes sense in conjunction with other changes. Namely I will rename IToken to IOrigin (#5956) and make Token no longer inherit from IOrigin (future PR).

How has this been tested?

Covered by existing tests

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

MikaelMayer
MikaelMayer previously approved these changes Dec 3, 2024
keyboardDrummer added a commit that referenced this pull request Dec 3, 2024
…5956)

This PR extract some refactorings from
#5931 to make that PR easier to
review.

### Description
- Rename some things that are not lexical tokens, from Token to Origin.
In particular, `Microsoft.Dafny.IToken` is now
`Microsoft.Dafny.IOrigin`. Same renaming is done for classes that
inherit from `IToken`, except `Token` and `RangeToken`
- Extract two classes into separate files, `IOrigin` and `OriginWrapper`
- Note: there are same locations where lexical tokens are handled,
particularly in the parser and the formatter, where the name `IOrigin`
does not make sense. That is addressed by this PR:
#5957

### How has this been tested?
Pure refactoring, covered by existing tests

<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
@keyboardDrummer keyboardDrummer merged commit de81b69 into dafny-lang:master Dec 3, 2024
22 checks passed
@keyboardDrummer keyboardDrummer deleted the lexicalTokenType branch December 4, 2024 09:51
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