Skip to content

Inline #2377

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

Draft
wants to merge 39 commits into
base: master
Choose a base branch
from
Draft

Inline #2377

Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a5d2545
bundle prism
soutaro Jan 16, 2025
8bc685f
Update Steepfile
soutaro Jan 16, 2025
f24735d
Add syntax and parser
soutaro Jan 16, 2025
369a377
Add `Constant#type`
soutaro Jan 16, 2025
edce3a1
Update `Environment`
soutaro Jan 17, 2025
8dc1f67
DefinitionBuilder
soutaro Jan 18, 2025
b59256c
WIP
soutaro Jan 21, 2025
de7979e
Bump version to 4.0
soutaro Jan 21, 2025
fa21e59
Update `steep/Gemfile` for ruby-lsp environment
soutaro Jan 21, 2025
81585b8
:cat2:
soutaro Feb 5, 2025
84cde79
Add CommentBlock
soutaro Feb 12, 2025
f85fa0d
Add rbs-inline keywords, no changes on parser
soutaro Feb 12, 2025
7cb29b3
Working for parser
soutaro Feb 14, 2025
504f29f
WIP
soutaro Feb 19, 2025
c0154c2
Support generic module definition
soutaro Feb 19, 2025
598416a
Implement module-self annotation parsing
soutaro Feb 19, 2025
d009ef1
Fix module parsing
soutaro Feb 20, 2025
67a38fa
Parse module-self annotation
soutaro Feb 20, 2025
aa0565a
Implement `@rbs inherits` annotation parsing
soutaro Feb 20, 2025
f66233f
module self parsing
soutaro Feb 20, 2025
2b87b4f
Super annotation
soutaro Feb 20, 2025
4816d5a
Let `Buffer` can be nested
soutaro Feb 21, 2025
cb4d1a7
`module-self` annotation support
soutaro Feb 21, 2025
e1bd844
ivars: Implement annotation parser
soutaro Feb 21, 2025
1450863
Buffer/location fixup
soutaro Feb 21, 2025
39bc718
ivars: InlineParser
soutaro Feb 21, 2025
e626997
ivars: Fix DefinitionBuilder
soutaro Feb 21, 2025
e5ee033
@rbs!: annotation parsing
soutaro Feb 25, 2025
73636d7
@rbs!: implement inline parser
soutaro Feb 25, 2025
8777fee
Load declarations from embedded RBS
soutaro Feb 27, 2025
b39a58b
@rbs!: ancestor builder
soutaro Feb 27, 2025
f09c9f4
@rbs!: method builder
soutaro Feb 27, 2025
b9d0bc3
@rbs!: definition builder
soutaro Feb 27, 2025
0d14123
WIP
soutaro Mar 3, 2025
8b33b87
Limit singleton class members
soutaro Mar 19, 2025
bf124b5
WIP: singleton method definition ast
soutaro Mar 24, 2025
ad341f4
Fix type parameter handling
soutaro Mar 25, 2025
4b9f9fd
Method definition specific `private`/`public` visibility
soutaro Mar 27, 2025
5a39ba3
Add attribute members
soutaro Apr 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix module parsing
  • Loading branch information
soutaro committed Mar 19, 2025
commit d009ef1a44d99f152023a53dc3ebc0da58428563
17 changes: 7 additions & 10 deletions ext/rbs_extension/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -2357,11 +2357,11 @@ static VALUE parse_interface_decl(parserstate *state, position comment_pos, VALU
* @param state
* @param module_name Pointer to VALUE to store a TypeName object
* @param type_args Pointer to an array to store type arguments
* @param ranges An array of range to store three ranges: module name, open paren, type args, and the close paren.
* @param ranges An array of 4-range to store three ranges: module name, open paren, type args, and the close paren.
*/
static void parse_module_self(parserstate *state, VALUE *module_name, VALUE *type_args, range ranges[4]) {
parser_advance(state);

ranges[0].start = state->current_token.range.start;
*module_name = parse_type_name(state, CLASS_NAME | INTERFACE_NAME, &ranges[0]);
ranges[0].end = state->current_token.range.end;
Expand All @@ -2383,15 +2383,10 @@ static void parse_module_self(parserstate *state, VALUE *module_name, VALUE *typ

/*
module_self_types ::= {`:`} module_self_type `,` ... `,` <module_self_type>

module_self_type ::= <module_name>
| module_name `[` type_list <`]`>
*/
static void parse_module_self_types(parserstate *state, VALUE *array) {
while (true) {
parser_advance(state);

range ranges[3];
range ranges[4];
VALUE module_name;
VALUE type_args = EMPTY_ARRAY;

Expand Down Expand Up @@ -2423,7 +2418,8 @@ static void parse_module_self_types(parserstate *state, VALUE *array) {
static VALUE parse_nested_decl(parserstate *state, const char *nested_in, position annot_pos, VALUE annotations);

/*
module_members ::= {} ...<module_member> kEND
module_members ::= {} module_member ... <module_member> kEND
| {<>} kEND

module_member ::= def_member
| variable_member
Expand Down Expand Up @@ -2606,7 +2602,8 @@ static VALUE parse_module_decl(parserstate *state, position comment_pos, VALUE a

return rbs_ast_decl_module_alias(module_name, old_name, location, comment, annotations);
} else {
return parse_module_decl0(state, keyword_range, module_name, module_name_range, comment, annotations);
VALUE decl = parse_module_decl0(state, keyword_range, module_name, module_name_range, comment, annotations);
return decl;
}
}

Expand Down