Skip to content

Commit

Permalink
Use rbs-inline styled type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ydah committed Feb 5, 2025
1 parent 569f568 commit 2ffb091
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 10 deletions.
24 changes: 18 additions & 6 deletions lib/lrama/options.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
# rbs_inline: enabled
# frozen_string_literal: true

module Lrama
# Command line options.
class Options
attr_accessor :skeleton, :header, :header_file,
:report_file, :outfile,
:error_recovery, :grammar_file,
:trace_opts, :report_opts,
:diagnostic, :y, :debug, :define,
:diagram, :diagram_file, :profile_opts
attr_accessor :skeleton #: String
attr_accessor :header #: bool
attr_accessor :header_file #: String
attr_accessor :report_file #: String
attr_accessor :outfile #: String
attr_accessor :error_recovery #: bool
attr_accessor :grammar_file #: String
attr_accessor :trace_opts #: Hash[Symbol, bool]?
attr_accessor :report_opts #: Hash[Symbol, bool]?
attr_accessor :diagnostic #: bool
attr_accessor :y #: IO
attr_accessor :debug #: bool
attr_accessor :define #: Hash[String, String]
attr_accessor :diagram #: bool
attr_accessor :diagram_file #: String
attr_accessor :profile_opts #: Hash[Symbol, bool]?

# @rbs () -> void
def initialize
@skeleton = "bison/yacc.c"
@define = {}
Expand Down
29 changes: 25 additions & 4 deletions sig/lrama/options.rbs → sig/generated/lrama/options.rbs
Original file line number Diff line number Diff line change
@@ -1,20 +1,41 @@
# Generated from lib/lrama/options.rb with RBS::Inline

module Lrama
# Command line options.
class Options
attr_accessor skeleton: String
attr_accessor define: Hash[String, String]

attr_accessor header: bool
attr_accessor header_file: String?
attr_accessor report_file: String?

attr_accessor header_file: String

attr_accessor report_file: String

attr_accessor outfile: String

attr_accessor error_recovery: bool
attr_accessor grammar_file: String?

attr_accessor grammar_file: String

attr_accessor trace_opts: Hash[Symbol, bool]?

attr_accessor report_opts: Hash[Symbol, bool]?

attr_accessor diagnostic: bool

attr_accessor y: IO

attr_accessor debug: bool

attr_accessor define: Hash[String, String]

attr_accessor diagram: bool

attr_accessor diagram_file: String

attr_accessor profile_opts: Hash[Symbol, bool]?

# @rbs () -> void
def initialize: () -> void
end
end

0 comments on commit 2ffb091

Please sign in to comment.