Skip to content

Added a few location while parsing - #13624

Merged
gasche merged 2 commits into
ocaml:trunkfrom
samsa1:add_locs
Nov 21, 2024
Merged

gasche merged 2 commits into
ocaml:trunkfrom
samsa1:add_locs

Conversation

@samsa1

@samsa1 samsa1 commented Nov 20, 2024

Copy link
Copy Markdown
Contributor

Added the locations at 3 parsing locations where it had been forgotten.

This does not impact the interface because nobody reads those locations but it is cleaner to have them.

@gasche gasche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fine, thanks!

Comment thread parsing/parser.mly Outdated
{ let docs = symbol_docs $sloc in
let attrs = attrs1 @ attrs2 in
Te.mk tid cs ~params ~priv ~attrs ~docs,
Te.mk tid cs ~params ~priv ~attrs ~docs ~loc:(make_loc $sloc),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let loc = make_loc $sloc in would be more consistent with other cases above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is indeed more coherent with the other changes but not with the overall cases in the lines around that one (for example on line 3416)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should I do this change to have coherence with similar cases or keep it that way for local coherence ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Whatever. I think let loc is slightly nicer, but Those Who Do the Work Decide, so let's keep things as you prefer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I concluded that it was indeed nicer if we didn't care about the local coherence and did the modification

Comment thread Changes Outdated
### Internal/compiler-libs changes:

- #XXXXX: Added location to exception definitions and type extensions
(Samuel Vivien, review by ...)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should complete this and the PR is good to go.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should be good now

@gasche
gasche merged commit 2270fbc into ocaml:trunk Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants