-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
feat(compiler)!: Remove arbitrary per-file compiler flags, add acceptable options as module attributes #1804
Changes from 3 commits
2918d8c
03b45e7
39aa39d
003f1d7
49d44f7
8069c43
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 |
---|---|---|
|
@@ -3,8 +3,6 @@ open Parsetree; | |
type hooks = { | ||
enter_location: Location.t => unit, | ||
leave_location: Location.t => unit, | ||
enter_attribute: attribute => unit, | ||
leave_attribute: attribute => unit, | ||
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. Can you put these back please? I don't see a reason to remove them |
||
enter_parsed_program: parsed_program => unit, | ||
leave_parsed_program: parsed_program => unit, | ||
enter_include: include_declaration => unit, | ||
|
@@ -74,11 +72,9 @@ let iter_ident = (hooks, id) => { | |
|
||
let iter_attribute = | ||
(hooks, {Asttypes.attr_name, attr_args, attr_loc} as attr) => { | ||
hooks.enter_attribute(attr); | ||
iter_loc(hooks, attr_name); | ||
List.iter(iter_loc(hooks), attr_args); | ||
iter_location(hooks, attr_loc); | ||
hooks.leave_attribute(attr); | ||
}; | ||
|
||
let iter_attributes = (hooks, attrs) => { | ||
|
@@ -87,6 +83,7 @@ let iter_attributes = (hooks, attrs) => { | |
|
||
let rec iter_parsed_program = (hooks, {statements} as program) => { | ||
hooks.enter_parsed_program(program); | ||
iter_attributes(hooks, program.attributes); | ||
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. What's going on here? 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. What do you mean? It's iterating over the attributes in the same way done with expressions and toplevels |
||
iter_toplevel_stmts(hooks, statements); | ||
hooks.leave_parsed_program(program); | ||
} | ||
|
@@ -524,9 +521,6 @@ let default_hooks = { | |
enter_location: _ => (), | ||
leave_location: _ => (), | ||
|
||
enter_attribute: _ => (), | ||
leave_attribute: _ => (), | ||
|
||
enter_parsed_program: _ => (), | ||
leave_parsed_program: _ => (), | ||
|
||
|
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.
I'm pretty sure that the
~none
and/or~trail
being hardline here are causing your extra newline in the attributes.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.
Doesn't look like that fixed it; I think it's the fact that
print_comment_range
insertsphatom_hardline ++ phantom_hardline
sinceline_delta
> 1 between the comment and module header