Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Parser leading attr strictness#7787

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
zth merged 5 commits intomasterfromparser-leading-attr-strictness
Aug 23, 2025
Merged

Conversation

@zth
Copy link
Member

@zthzth commentedAug 22, 2025

Follow up for#7782.

@zthzthforce-pushed theparser-leading-attr-strictness branch fromc91ae80 to01158ebCompareAugust 22, 2025 09:24
@zthzth requested a review fromcristianocAugust 22, 2025 09:24
@pkg-pr-new
Copy link

pkg-pr-newbot commentedAug 22, 2025
edited
Loading

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7787

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7787

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7787

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7787

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7787

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7787

commit:945a61f

Copy link
Collaborator

@cristianoccristianoc 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.
Just some comments on code duplication.

|Lbrace ->
(* consume the attributes and any doc comments before the record*)
ignore (parse_attributes p);
letrecskip_docs()=
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same fun defined a few lines above.

|DotDot ->
(* attributes before an open variant marker; consume attrs/docs then handle `..`*)
ignore (parse_attributes p);
letrecskip_docs()=
Copy link
Collaborator

Choose a reason for hiding this comment

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

And here

Parser.lookahead p (funstate ->
ignore (parse_attributes state);
(* optionally skip a run of doc comments before deciding*)
letrecskip_docs()=
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again

x: int ;
y: int }
y: int }
type nonrec t = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The printer will also need attention. Perhaps for later and one can just add the issue for now.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

What do you mean?

@zthzthforce-pushed theparser-leading-attr-strictness branch from01158eb to4329600CompareAugust 23, 2025 18:48
@zthzthenabled auto-merge (squash)August 23, 2025 18:49
@zthzth merged commit18ff979 intomasterAug 23, 2025
27 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@cristianoccristianoccristianoc approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@zth@cristianoc

[8]ページ先頭

©2009-2025 Movatter.jp