Skip to content

Move more internal components into util folder #33

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

Merged
merged 7 commits into from
Apr 1, 2025
Merged

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Apr 1, 2025

Assuming the top-level include/rbs holds public components (e.g. parser.h), and include/rbs/util holds internal components, more stuff should be moved under util.

This follows the same convention prism uses.

Before

include
├── rbs
│   ├── ast.h
│   ├── defines.h
│   ├── encoding.h
│   ├── lexer.h
│   ├── parser.h
│   ├── rbs_buffer.h
│   ├── rbs_encoding.h
│   ├── rbs_location.h
│   ├── rbs_location_internals.h
│   ├── rbs_string.h
│   ├── rbs_strncasecmp.h
│   ├── rbs_unescape.h
│   └── util
│       ├── rbs_allocator.h
│       ├── rbs_assert.h
│       └── rbs_constant_pool.h
└── rbs.h

After

include
├── rbs
│   ├── ast.h
│   ├── defines.h
│   ├── lexer.h
│   ├── parser.h
│   ├── rbs_location.h
│   ├── rbs_string.h
│   └── util
│       ├── rbs_allocator.h
│       ├── rbs_assert.h
│       ├── rbs_buffer.h
│       ├── rbs_constant_pool.h
│       ├── rbs_encoding.h
│       └── rbs_unescape.h
└── rbs.h

@st0012 st0012 requested review from Morriar and amomchilov April 1, 2025 11:25
@st0012 st0012 force-pushed the hide-components branch from e3761b2 to 20c5146 Compare April 1, 2025 15:58
@st0012 st0012 requested a review from amomchilov April 1, 2025 15:58
Comment on lines +21 to +22
// The flexible array always allocates, but it's okay.
// This struct is not allocated when the `rbs_loc` doesn't have children.

Choose a reason for hiding this comment

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

Aside, but this is a weird comment. There is no flexible array member here (that would be rbs_loc_entry entries[]), and there's no allocation there, either.

Copy link
Member Author

Choose a reason for hiding this comment

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

FWIW this is the PR introduced the usage: ruby#1786

@st0012 st0012 merged commit 5c7885e into c-api Apr 1, 2025
19 of 20 checks passed
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