Skip to content
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

Add rbs for Grammar::Type and Grammar::Symbols::Resolver #368

Merged
merged 5 commits into from
Feb 11, 2024

Conversation

ydah
Copy link
Collaborator

@ydah ydah commented Feb 7, 2024

No description provided.

ydah added 5 commits February 7, 2024 18:13
```
❯ bundle exec rake steep
bundle exec steep check
# Type checking files:

...................................................................................................................................F...................

lib/lrama/grammar/symbols/resolver.rb:24:31: [error] Cannot pass a value of type `(::String | nil)` as an argument of type `::String`
│   (::String | nil) <: ::String
│     nil <: ::String
│
│ Diagnostic ID: Ruby::ArgumentTypeMismatch
│
└               sym.alias_name = alias_name
                                 ~~~~~~~~~~

lib/lrama/grammar/symbols/resolver.rb:36:24: [error] More keyword arguments are required: precedence, printer
│ Diagnostic ID: Ruby::InsufficientKeywordArguments
│
└           term = Symbol.new(
                          ~~~~

lib/lrama/grammar/symbols/resolver.rb:48:25: [error] More keyword arguments are required: precedence, printer
│ Diagnostic ID: Ruby::InsufficientKeywordArguments
│
└           nterm = Symbol.new(
                           ~~~~

Detected 3 problems from 1 file
```
```
❯ bundle exec rake steep
bundle exec steep check
# Type checking files:

.............................................................................................................................F.........................

lib/lrama/grammar/symbols/resolver.rb:201:33: [error] Cannot pass a value of type `(::Integer | nil)` as an argument of type `::Integer`
│   (::Integer | nil) <: ::Integer
│     nil <: ::Integer
│
│ Diagnostic ID: Ruby::ArgumentTypeMismatch
│
└                   sym.token_id = Integer($1, 8)
                                   ~~~~~~~~~~~~~~

lib/lrama/grammar/symbols/resolver.rb:203:36: [error] Type `(::String | nil)` does not have method `bytes`
│ Diagnostic ID: Ruby::NoMethod
│
└                   sym.token_id = $1.bytes.first
                                      ~~~~~

Detected 2 problems from 1 file
```
@yui-knk yui-knk merged commit ed67d67 into ruby:master Feb 11, 2024
17 checks passed
@yui-knk
Copy link
Collaborator

yui-knk commented Feb 11, 2024

Thank you!

@ydah ydah deleted the types branch February 11, 2024 12:15
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