Skip to content

Conversation

@schneems
Copy link
Collaborator

@schneems schneems commented Nov 17, 2021

While investigating #116 I realized that the shorthand syntax does not have to be limited to our existing "pairs" characters that we already track. While coming up with additional test cases I realized that the existing on_parse_error does not emit an error for the code: %Q* lol (missing a * to close the string).

This commit adds the missing check (coming from compile_error) as well as several others coming from the event table:

Ripper::PARSER_EVENT_TABLE.select {|(k,v)| k.to_s.end_with?("error") }.keys
=> [:alias_error, :assign_error, :class_name_error, :param_error, :parse_error]

While investigating #116 I realized that the shorthand syntax does not have to be limited to our existing "pairs" characters that we already track. While coming up with additional test cases I realized that the existing `on_parse_error` does not emit an error for the code: `%Q* lol` (missing a `*` to close the string).

This commit adds the missing check (coming from `compile_error`) as well as several others coming from the event table:

```
irb(main):008:0> Ripper::PARSER_EVENT_TABLE.select {|(k,v)| k.to_s.end_with?("error") }.keys
=> [:alias_error, :assign_error, :class_name_error, :param_error, :irb(main):008:0> Ripper::PARSER_EVENT_TABLE.select {|(k,v)| k.to_s.end_with?("error") }.keys
=> [:alias_error, :assign_error, :class_name_error, :param_error, :parse_error]
```
@schneems schneems force-pushed the schneems/more-ripper-errors branch from dc58908 to 1e526e0 Compare November 17, 2021 17:41
@schneems schneems merged commit d7f8d58 into main Nov 17, 2021
@schneems schneems deleted the schneems/more-ripper-errors branch November 17, 2021 17:42
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.

2 participants