-
Notifications
You must be signed in to change notification settings - Fork 28
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 grammar/code directory types #417
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b25483f
add rule_action.rbs
Little-Rubyist b7e288f
add no_reference_code.rbs
Little-Rubyist 616998e
add initial_action_code.rbs
Little-Rubyist e16f0fb
fix destructor_code.rbs
Little-Rubyist 9d0a37f
remove untyped type in grammar/code
Little-Rubyist 6c23e5c
steep check grammar/code directory
Little-Rubyist cd31cd3
fix types and refactor steepfile
Little-Rubyist 43cd9ea
Corrected the way the type is written
Little-Rubyist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Lrama | ||
class Grammar | ||
class Code | ||
class InitialActionCode < Code | ||
private | ||
|
||
# * ($$) yylval | ||
# * (@$) yylloc | ||
# * ($1) error | ||
# * (@1) error | ||
def reference_to_c: (Reference ref) -> (String | bot) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Lrama | ||
class Grammar | ||
class Code | ||
class NoReferenceCode < Code | ||
private | ||
|
||
# * ($$) error | ||
# * (@$) error | ||
# * ($1) error | ||
# * (@1) error | ||
def reference_to_c: (Reference ref) -> bot | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module Lrama | ||
class Grammar | ||
class Code | ||
class RuleAction < Code | ||
@rule: Rule | ||
|
||
def initialize: (type: ::Symbol, token_code: Grammar::Code, rule: Rule) -> void | ||
|
||
private | ||
|
||
def reference_to_c: (Reference ref) -> String | ||
def position_in_rhs: () -> Integer | ||
def rhs: () -> Array[Grammar::Symbol] | ||
def lhs: () -> Symbol | ||
def raise_tag_not_found_error: (Reference ref) -> bot | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
module Lrama | ||
class Grammar | ||
class Rule | ||
attr_accessor id: Integer | ||
attr_accessor _lhs: Lexer::Token | ||
attr_accessor lhs: Symbol | ||
attr_accessor lhs_tag: untyped | ||
attr_accessor _rhs: untyped | ||
attr_accessor rhs: untyped | ||
attr_accessor token_code: Lexer::Token::UserCode? | ||
attr_accessor position_in_original_rule_rhs: untyped | ||
attr_accessor nullable: bool | ||
attr_accessor precedence_sym: Lexer::Token? | ||
attr_accessor lineno: Integer? | ||
attr_accessor original_rule: Rule | ||
|
||
def initialize: ( | ||
?id: untyped, ?_lhs: untyped, ?lhs: untyped, ?lhs_tag: untyped, ?_rhs: untyped, ?rhs: untyped, | ||
?token_code: untyped, ?position_in_original_rule_rhs: untyped, ?nullable: untyped, | ||
?precedence_sym: untyped, ?lineno: untyped | ||
?id: Integer, ?_lhs: Lexer::Token, ?lhs: Lexer::Token, ?lhs_tag: untyped, ?_rhs: untyped, ?rhs: untyped, | ||
?token_code: Lexer::Token::UserCode?, ?position_in_original_rule_rhs: Integer?, ?nullable: bool, | ||
?precedence_sym: Lexer::Token?, ?lineno: Integer? | ||
) -> void | ||
|
||
def as_comment: -> String | ||
|
||
def empty_rule?: -> bool | ||
|
||
def initial_rule?: -> bool | ||
|
||
def with_actions: -> String | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any intention to use "Symbol" however
rhs
isGrammar::Symbol
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, seems like a simple mistake. I fixed.