Skip to content
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

Use invalid identifier names for bindings introduced by ppx #50

Merged
merged 5 commits into from
Nov 10, 2019

Conversation

glennsl
Copy link
Collaborator

@glennsl glennsl commented Nov 9, 2019

Fixes #49

This ensures that you cannot accidentally shadow or use "hidden" bindings.

jsx/brisk_jsx.ml Outdated
Ast_builder.(pexp_ident ~loc (Located.lident ~loc "brisk-component"))

let component_ident_pattern ~loc =
Ast_builder.(ppat_var ~loc AT.{ txt = "brisk-component"; loc })
Copy link
Member

Choose a reason for hiding this comment

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

Can we avoid AT and use (Located.lident ~loc "brisk-component") here? I know I've been using it in a few places but I'd like to remove occurrences rather than multiply.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They're not equivalent. Located.lident returns a longident Located.t while ppat_var expects a string Located.t...

I'm sure that makes sense somehow, but I'm struggling to find it...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, but I can use Located.mk!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in d03fea9

@wokalski wokalski merged commit 0ed77ff into briskml:master Nov 10, 2019
@wokalski
Copy link
Member

Thank you @glennsl. Cool contribution.

@glennsl glennsl deleted the component-prop-fix branch November 10, 2019 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use a prop called "component" with %component syntax
2 participants