Use Data.define

This commit is contained in:
Sami Samhuri 2026-02-07 15:01:16 -08:00
parent beee5deca5
commit 9630125a95
No known key found for this signature in database
3 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ GEM
guard
rake
io-console (0.8.2)
json (2.18.0)
json (2.18.1)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
listen (3.10.0)

View file

@ -1,6 +1,6 @@
module Shell
class StringParser
Token = Struct.new(:type, :value, keyword_init: true)
Token = Data.define(:type, :value)
class Scanner
def initialize(line, index: 0)

View file

@ -22,7 +22,7 @@ module Shell
ARITHMETIC_IDENTIFIER_PATTERN = /[A-Za-z0-9_]/
ARITHMETIC_OPERATOR_PATTERN = %r{[+\-*/()%]}
BRACE_EXPANSION_PATTERN = /(.*?)\{([^{}]*)\}(.*)/
SplitWord = Struct.new(:text, :globbed, keyword_init: true)
SplitWord = Data.define(:text, :globbed)
CommandSubstitutionError = Class.new(StandardError)
# Splits the given line into multiple words, performing the following transformations: