rggen / rggen

Code generation tool for control and status registers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Ruby 3.2 support and drop Ruby 2.6 support

taichi-ishitani opened this issue · comments

update development gems too.

  • rspec 3.12.0
  • rubocop 1.39.0
    • the latest version supported by codeclimate
  • simplecov 0.22.0
  • simplecov-cobertura 2.1.0

A rspec example related to regexp is failed due to a following Ruby 3.2 bug.
https://bugs.ruby-lang.org/issues/19273

  1) bit_field/bit_assignment 入力が文字列の場合 入力フォーマット設定が:lsb_firstの場合 LSBが第一要素となる
     Failure/Error: error "illegal input value for bit assignment: #{value.inspect}"
     
     RgGen::Core::RegisterMap::RegisterMapError:
       illegal input value for bit assignment: "23:4:7" -- /home/taichi/workspace/rggen/rggen-default-register-map/spec/rggen/default_register_map/bit_field/bit_assignment_spec.rb:23:in `block (4 levels) in create_bit_fields'

Need workaround.

This bug affetcs the following regexp pattern.

https://github.com/rggen/rggen-default-register-map/blob/9997065c0cb1f5ba8aa9a9a3e2579137b4c7dc51/lib/rggen/default_register_map/bit_field/bit_assignment.rb#L26

Workaround for this bug is:

  • change regexp pattern
    • replace {0,3} with *
  • count number of : splitter characther
    • number of : <= 3 is valid condition