Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Location information in outer lexer #1052

Closed
wants to merge 29 commits into from
Closed

Location information in outer lexer #1052

wants to merge 29 commits into from

Conversation

gtrepta
Copy link
Contributor

@gtrepta gtrepta commented Mar 30, 2024

src/pyk/kast/outer_lexer.py Show resolved Hide resolved
src/pyk/kast/outer_lexer.py Outdated Show resolved Hide resolved
@gtrepta
Copy link
Contributor Author

gtrepta commented Apr 3, 2024

Marking this for review without doing tokens for attributes. Attributes don't have any location information in the kast format, so supporting it would require more work than just getting locations on these tokens.

@gtrepta gtrepta marked this pull request as ready for review April 3, 2024 20:28
src/pyk/kast/outer_lexer.py Outdated Show resolved Hide resolved
src/pyk/kast/outer_lexer.py Outdated Show resolved Hide resolved
src/pyk/kast/outer_lexer.py Outdated Show resolved Hide resolved
src/pyk/kast/outer_lexer.py Outdated Show resolved Hide resolved
src/pyk/kast/outer_lexer.py Outdated Show resolved Hide resolved
src/pyk/kast/outer_lexer.py Outdated Show resolved Hide resolved
src/pyk/kast/outer_lexer.py Outdated Show resolved Hide resolved
src/pyk/kast/outer_lexer.py Show resolved Hide resolved
src/pyk/kast/outer_lexer.py Outdated Show resolved Hide resolved
src/tests/unit/kast/test_outer_lexer.py Show resolved Hide resolved
@gtrepta gtrepta requested a review from tothtamas28 April 9, 2024 21:41
Copy link
Collaborator

@tothtamas28 tothtamas28 left a comment

Choose a reason for hiding this comment

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

I appreciate the work you put in to update the tests, thank you!

@@ -53,25 +61,33 @@ BUBBLE
</k>

LBRACK
1,0
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't look right.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is one of the attribute tokens, which aren't getting location info because attributes don't have source locations in KAST, so it would be extra work in this PR for nothing. Instead, they're getting the default INIT_LOC.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is not for nothing, it enables more fine-grained error reporting for attributes. Please open an issue so that we can address this later.

Copy link
Collaborator

@tothtamas28 tothtamas28 Apr 11, 2024

Choose a reason for hiding this comment

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

In that issue, please also include that we should add the following test.

After lexing, for each token, if we consider the substring of the input text starting at the token location, it will start with the token text.

Copy link
Contributor Author

@gtrepta gtrepta Apr 11, 2024

Choose a reason for hiding this comment

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

src/tests/unit/kast/test_outer_lexer.py Outdated Show resolved Hide resolved
src/tests/unit/kast/test_outer_lexer.py Outdated Show resolved Hide resolved
src/pyk/kast/outer_lexer.py Show resolved Hide resolved
@gtrepta gtrepta requested a review from tothtamas28 April 10, 2024 15:57
Copy link
Collaborator

@tothtamas28 tothtamas28 left a comment

Choose a reason for hiding this comment

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

Looks great!

@tothtamas28 tothtamas28 marked this pull request as draft April 11, 2024 07:35
@tothtamas28
Copy link
Collaborator

Converting this to draft to avoid accidentally merging it before the repo merge.

@Baltoli
Copy link
Contributor

Baltoli commented Apr 16, 2024

@Baltoli Baltoli closed this Apr 16, 2024
@Baltoli Baltoli deleted the lexer-locations branch April 16, 2024 09:08
rv-jenkins pushed a commit to runtimeverification/k that referenced this pull request Apr 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants