Skip to content

Commit

Permalink
Merge pull request #419 from koic/use_require_relative
Browse files Browse the repository at this point in the history
Use `require_relative` in the Lrama codebase
  • Loading branch information
ydah authored May 17, 2024
2 parents 95e0cc2 + edfed70 commit c3e37e8
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 67 deletions.
34 changes: 17 additions & 17 deletions lib/lrama.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
require "lrama/bitmap"
require "lrama/command"
require "lrama/context"
require "lrama/counterexamples"
require "lrama/digraph"
require "lrama/grammar"
require "lrama/lexer"
require "lrama/option_parser"
require "lrama/options"
require "lrama/output"
require "lrama/parser"
require "lrama/report"
require "lrama/state"
require "lrama/states"
require "lrama/states_reporter"
require "lrama/version"
require "lrama/warning"
require_relative "lrama/bitmap"
require_relative "lrama/command"
require_relative "lrama/context"
require_relative "lrama/counterexamples"
require_relative "lrama/digraph"
require_relative "lrama/grammar"
require_relative "lrama/lexer"
require_relative "lrama/option_parser"
require_relative "lrama/options"
require_relative "lrama/output"
require_relative "lrama/parser"
require_relative "lrama/report"
require_relative "lrama/state"
require_relative "lrama/states"
require_relative "lrama/states_reporter"
require_relative "lrama/version"
require_relative "lrama/warning"
2 changes: 1 addition & 1 deletion lib/lrama/context.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "lrama/report/duration"
require_relative "report/duration"

module Lrama
# This is passed to a template
Expand Down
16 changes: 8 additions & 8 deletions lib/lrama/counterexamples.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
require "set"

require "lrama/counterexamples/derivation"
require "lrama/counterexamples/example"
require "lrama/counterexamples/path"
require "lrama/counterexamples/production_path"
require "lrama/counterexamples/start_path"
require "lrama/counterexamples/state_item"
require "lrama/counterexamples/transition_path"
require "lrama/counterexamples/triple"
require_relative "counterexamples/derivation"
require_relative "counterexamples/example"
require_relative "counterexamples/path"
require_relative "counterexamples/production_path"
require_relative "counterexamples/start_path"
require_relative "counterexamples/state_item"
require_relative "counterexamples/transition_path"
require_relative "counterexamples/triple"

module Lrama
# See: https://www.cs.cornell.edu/andru/papers/cupex/cupex.pdf
Expand Down
36 changes: 18 additions & 18 deletions lib/lrama/grammar.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
require "forwardable"
require "lrama/grammar/auxiliary"
require "lrama/grammar/binding"
require "lrama/grammar/code"
require "lrama/grammar/counter"
require "lrama/grammar/destructor"
require "lrama/grammar/error_token"
require "lrama/grammar/parameterizing_rule"
require "lrama/grammar/percent_code"
require "lrama/grammar/precedence"
require "lrama/grammar/printer"
require "lrama/grammar/reference"
require "lrama/grammar/rule"
require "lrama/grammar/rule_builder"
require "lrama/grammar/symbol"
require "lrama/grammar/symbols"
require "lrama/grammar/type"
require "lrama/grammar/union"
require "lrama/lexer"
require_relative "grammar/auxiliary"
require_relative "grammar/binding"
require_relative "grammar/code"
require_relative "grammar/counter"
require_relative "grammar/destructor"
require_relative "grammar/error_token"
require_relative "grammar/parameterizing_rule"
require_relative "grammar/percent_code"
require_relative "grammar/precedence"
require_relative "grammar/printer"
require_relative "grammar/reference"
require_relative "grammar/rule"
require_relative "grammar/rule_builder"
require_relative "grammar/symbol"
require_relative "grammar/symbols"
require_relative "grammar/type"
require_relative "grammar/union"
require_relative "lexer"

module Lrama
# Grammar is the result of parsing an input grammar file
Expand Down
10 changes: 5 additions & 5 deletions lib/lrama/grammar/code.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require "forwardable"
require "lrama/grammar/code/destructor_code"
require "lrama/grammar/code/initial_action_code"
require "lrama/grammar/code/no_reference_code"
require "lrama/grammar/code/printer_code"
require "lrama/grammar/code/rule_action"
require_relative "code/destructor_code"
require_relative "code/initial_action_code"
require_relative "code/no_reference_code"
require_relative "code/printer_code"
require_relative "code/rule_action"

module Lrama
class Grammar
Expand Down
6 changes: 3 additions & 3 deletions lib/lrama/lexer.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require "strscan"

require "lrama/lexer/grammar_file"
require "lrama/lexer/location"
require "lrama/lexer/token"
require_relative "lexer/grammar_file"
require_relative "lexer/location"
require_relative "lexer/token"

module Lrama
class Lexer
Expand Down
10 changes: 5 additions & 5 deletions lib/lrama/lexer/token.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'lrama/lexer/token/char'
require 'lrama/lexer/token/ident'
require 'lrama/lexer/token/instantiate_rule'
require 'lrama/lexer/token/tag'
require 'lrama/lexer/token/user_code'
require_relative 'token/char'
require_relative 'token/ident'
require_relative 'token/instantiate_rule'
require_relative 'token/tag'
require_relative 'token/user_code'

module Lrama
class Lexer
Expand Down
2 changes: 1 addition & 1 deletion lib/lrama/output.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "erb"
require "forwardable"
require "lrama/report/duration"
require_relative "report/duration"

module Lrama
class Output
Expand Down
4 changes: 2 additions & 2 deletions lib/lrama/report.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require 'lrama/report/duration'
require 'lrama/report/profile'
require_relative 'report/duration'
require_relative 'report/profile'
10 changes: 5 additions & 5 deletions lib/lrama/state.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require "lrama/state/reduce"
require "lrama/state/reduce_reduce_conflict"
require "lrama/state/resolved_conflict"
require "lrama/state/shift"
require "lrama/state/shift_reduce_conflict"
require_relative "state/reduce"
require_relative "state/reduce_reduce_conflict"
require_relative "state/resolved_conflict"
require_relative "state/shift"
require_relative "state/shift_reduce_conflict"

module Lrama
class State
Expand Down
4 changes: 2 additions & 2 deletions lib/lrama/states.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "forwardable"
require "lrama/report/duration"
require "lrama/states/item"
require_relative "report/duration"
require_relative "states/item"

module Lrama
# States is passed to a template file
Expand Down

0 comments on commit c3e37e8

Please sign in to comment.