Skip to content

Should quote var name#178

Merged
pocke merged 2 commits intopocke:masterfrom
ksss:quoted
Aug 9, 2021
Merged

Should quote var name#178
pocke merged 2 commits intopocke:masterfrom
ksss:quoted

Conversation

@ksss
Copy link
Contributor

@ksss ksss commented Aug 1, 2021

Fix the problem that rake fails when using rbs reserved words (e.g. type) in variable names.
The following is the log of the failure.

rake aborted!
RBS::Parser::SyntaxError: parse error on value: #<RBS::Parser::LocatedValue:0x0000aaaaea01def8 @location=#<RBS::Location:19500 @buffer=, @pos=6514...6518, source='type', start_line=142, start_column=27>, @value=:type> (kTYPE)
parser.y:1757:in `on_error'
(eval):3:in `_racc_do_parse_c'
(eval):3:in `do_parse'
parser.y:1458:in `parse_signature'
/api/vendor/bundle/ruby/3.0.0/gems/rbs_rails-0.8.2/lib/rbs_rails/util.rb:19:in `format_rbs'
/api/vendor/bundle/ruby/3.0.0/gems/rbs_rails-0.8.2/lib/rbs_rails/active_record.rb:25:in `generate'
/api/vendor/bundle/ruby/3.0.0/gems/rbs_rails-0.8.2/lib/rbs_rails/active_record.rb:11:in `class_to_rbs'
/api/vendor/bundle/ruby/3.0.0/gems/rbs_rails-0.8.2/lib/rbs_rails/rake_task.rb:45:in `block (2 levels) in def_generate_rbs_for_models'
/api/vendor/bundle/ruby/3.0.0/gems/rbs_rails-0.8.2/lib/rbs_rails/rake_task.rb:38:in `each'
/api/vendor/bundle/ruby/3.0.0/gems/rbs_rails-0.8.2/lib/rbs_rails/rake_task.rb:38:in `block in def_generate_rbs_for_models'
/api/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
/api/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
/api/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3.2/lib/active_support/fork_tracker.rb:10:in `block in fork'
/api/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3.2/lib/active_support/fork_tracker.rb:10:in `block in fork'
/api/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3.2/lib/active_support/fork_tracker.rb:8:in `fork'
/api/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3.2/lib/active_support/fork_tracker.rb:8:in `fork'
/api/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3.2/lib/active_support/fork_tracker.rb:26:in `fork'
/api/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3.2/lib/active_support/fork_tracker.rb:8:in `fork'
/api/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3.2/lib/active_support/fork_tracker.rb:26:in `fork'
<internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
-e:1:in `<main>'
Tasks: TOP => rbs_rails:generate_rbs_for_models
(See full trace by running task with --trace)

@ksss
Copy link
Contributor Author

ksss commented Aug 2, 2021

Here seems to be the reason why the ruby-head CI is failing
rails/globalid#132

@ksss
Copy link
Contributor Author

ksss commented Aug 2, 2021

Maybe fixed.

Copy link
Owner

@pocke pocke left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thanks!

@pocke pocke merged commit f71f8e8 into pocke:master Aug 9, 2021
@ksss ksss deleted the quoted branch August 10, 2021 00:34
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