-
Notifications
You must be signed in to change notification settings - Fork 40
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
bool struct member parsing not working #168
Comments
Could you open a PR with a test? |
hsbt
pushed a commit
to hsbt/ruby
that referenced
this issue
Jan 14, 2025
parsing (ruby/fiddle#169) GitHub: fix ruby/fiddle#168 Struct parsing invokes "parse_ctype" on the whole member signature, which fails if member type is "bool" due to plain string matching for it. This change updates "bool" type matching to a regexp, so TYPE_BOOL is correctly parsed for a whole signature like "bool toggle" as well as just "bool". --------- ruby/fiddle@71607446d4 Co-authored-by: Sutou Kouhei <[email protected]>
hsbt
pushed a commit
to hsbt/ruby
that referenced
this issue
Jan 14, 2025
parsing (ruby/fiddle#169) GitHub: fix ruby/fiddle#168 Struct parsing invokes "parse_ctype" on the whole member signature, which fails if member type is "bool" due to plain string matching for it. This change updates "bool" type matching to a regexp, so TYPE_BOOL is correctly parsed for a whole signature like "bool toggle" as well as just "bool". --------- ruby/fiddle@71607446d4 Co-authored-by: Sutou Kouhei <[email protected]>
hsbt
pushed a commit
to ruby/ruby
that referenced
this issue
Jan 14, 2025
parsing (ruby/fiddle#169) GitHub: fix ruby/fiddle#168 Struct parsing invokes "parse_ctype" on the whole member signature, which fails if member type is "bool" due to plain string matching for it. This change updates "bool" type matching to a regexp, so TYPE_BOOL is correctly parsed for a whole signature like "bool toggle" as well as just "bool". --------- ruby/fiddle@71607446d4 Co-authored-by: Sutou Kouhei <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script
fails with this error:
Looks like
parse_struct_signature
passes the wholebool boolean_member
string toparse_ctype
, where it fails to be parsed because case expression tries to match on"bool"
(i.e. a plain string) instead of a regex, something like/\Abool(?:\s+\w+)?\z/
:fiddle/lib/fiddle/cparser.rb
Line 250 in 2131aa1
The text was updated successfully, but these errors were encountered: