-
Notifications
You must be signed in to change notification settings - Fork 38
Simplify parsing and printing attributes of function and arguments #683
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,13 @@ module V3 = { | |
|
||
@react.component | ||
let make = | ||
(@warning("-16") ~a, @warning("-16") ~b, _) => { | ||
Js.log("This function should be named 'TopLevel.react'") | ||
ReactDOMRe.createDOMElementVariadic("div", []) | ||
} | ||
@warning("-16") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This warning is added to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Parsing and printing should not change anything for JSX right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, this is printing change. The ast is not changed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don’t think the printing changes of JSX output would be a problem unless the ast is changed. What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JSX is never printed |
||
(~a) => | ||
@warning("-16") | ||
(~b, _) => { | ||
Js.log("This function should be named 'TopLevel.react'") | ||
ReactDOMRe.createDOMElementVariadic("div", []) | ||
} | ||
let make = { | ||
let \"TopLevel$V3" = (\"Props": {"a": 'a, "b": 'b}) => | ||
make(~b=\"Props"["b"], ~a=\"Props"["a"], ()) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,7 +106,7 @@ let _ = await { | |
|
||
let f1 = async (~x, ~y) => x + y | ||
let f2 = async (@foo ~x, @bar ~y) => x + y | ||
let f3 = async (@bar @foo ~x as @zz z, ~y) => x + y | ||
let f3 = @foo async (~x as @bar @zz z, ~y) => x + y | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure about this expression There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks fine. There's only one place for attributes on labels. |
||
let f4 = async x => x | ||
let f5 = async x => async y => 3 | ||
let f6 = async (~x1, ~x2) => async y => 3 | ||
|
@@ -116,8 +116,8 @@ let f9 = x => async (~y) => 3 | |
let f10 = x => async y => 3 | ||
let f11 = (. ~x) => (. ~y) => 3 | ||
|
||
let f12 = @a x => 3 | ||
let f13 = (@a @b ~x) => 3 | ||
let f12 = @a (@b x) => 3 | ||
let f13 = @a @b (~x) => 3 | ||
Comment on lines
+119
to
+120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks printing okay now. |
||
|
||
let aw = (await server->start)->foo | ||
let aw = @foo (server->start)->foo | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this comment/mental model to the appropriate place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f2a9720 How about this?
EDIT: f902e3a