mirror of
https://github.com/samsonjs/csc360-a1-shell.git
synced 2026-03-25 08:45:52 +00:00
Use Data.define
This commit is contained in:
parent
beee5deca5
commit
9630125a95
3 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue