Method: N65::EnterScope.parse

Defined in:
lib/n65/directives/enter_scope.rb

.parse(line) ⇒ Object

Try to parse an incbin directive



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/n65/directives/enter_scope.rb', line 12

def self.parse(line)
  ##  Anonymous scope
  match_data = line.match(/^\.scope$/)
  unless match_data.nil?
    return EnterScope.new
  end

  ##  Named scope
  match_data = line.match(/^\.scope\s+([a-zA-Z][a-zA-Z0-9_]+)$/)
  return nil if match_data.nil?
  EnterScope.new(match_data[1])
end