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

ErbAst: Handles block calls #425

Merged
merged 2 commits into from
Mar 24, 2022
Merged

ErbAst: Handles block calls #425

merged 2 commits into from
Mar 24, 2022

Conversation

davidwessman
Copy link
Collaborator

- Fixes glebm#424 by allowing blocks to be parsed by ignoring `do`.
- Adds specs for block calls.
- Changes structure for erb tests to test relative keys as well.
- Inspired by
https://github.com/Shopify/better-html/blob/087943ffd2a5877fa977d71532010b0c91239519/lib/better_html/test_helper/ruby_node.rb#L24
@@ -48,7 +48,7 @@ def initialize(path:, pos:, line_num:, line_pos:, line:, raw_key: nil, default_a
# rubocop:enable Metrics/ParameterLists

def inspect
"Occurrence(#{@path}:#{@line_num}:#{@line_pos}:#{@pos}:#{@raw_key}:#{@default_arg}:#{@line})"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@glebm Not sure what you think about this, can revert it 🙂

Copy link
Owner

Choose a reason for hiding this comment

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

"#{@path}:#{@line_num}" is standard notation, let's remove the field names there but keep the rest

Copy link
Owner

@glebm glebm Mar 24, 2022

Choose a reason for hiding this comment

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

Going to merge this as-is for now and release 1.0.2 anyway

@glebm glebm merged commit 0fe8ee5 into glebm:main Mar 24, 2022
@davidwessman davidwessman deleted the erb-ast-nested branch March 24, 2022 17:02
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.

With the new parser, some key usage is not found
2 participants