Skip to content

Commit

Permalink
Use rbs-inline style for Lrama::Lexer::Token::UserCode
Browse files Browse the repository at this point in the history
  • Loading branch information
ydah committed Jan 13, 2025
1 parent 6e90e96 commit cb384dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/lrama/lexer/token/user_code.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
# frozen_string_literal: true

require "strscan"
Expand All @@ -6,14 +7,16 @@ module Lrama
class Lexer
class Token
class UserCode < Token
attr_accessor :tag
attr_accessor :tag #: Lexer::Token::Tag

# @rbs () -> Array[Lrama::Grammar::Reference]
def references
@references ||= _references
end

private

# @rbs () -> Array[Lrama::Grammar::Reference]
def _references
scanner = StringScanner.new(s_value)
references = [] #: Array[Grammar::Reference]
Expand All @@ -32,6 +35,7 @@ def _references
references
end

# @rbs (StringScanner scanner) -> Lrama::Grammar::Reference?
def scan_reference(scanner)
start = scanner.pos
case
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# Generated from lib/lrama/lexer/token/user_code.rb with RBS::Inline

module Lrama
class Lexer
class Token
class UserCode < Token
attr_accessor tag: Lexer::Token::Tag
@references: Array[Lrama::Grammar::Reference]

# @rbs () -> Array[Lrama::Grammar::Reference]
def references: () -> Array[Lrama::Grammar::Reference]

private

# @rbs () -> Array[Lrama::Grammar::Reference]
def _references: () -> Array[Lrama::Grammar::Reference]

# @rbs (StringScanner scanner) -> Lrama::Grammar::Reference?
def scan_reference: (StringScanner scanner) -> Lrama::Grammar::Reference?
end
end
Expand Down

0 comments on commit cb384dd

Please sign in to comment.