Method: N65::Inc.parse
- Defined in:
- lib/n65/directives/inc.rb
.parse(line) ⇒ Object
Try to parse an incbin directive
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/n65/directives/inc.rb', line 19 def self.parse(line) ## Do We have a system directory include? match_data = line.match(/^\.inc <([^>]+)>$/) unless match_data.nil? filename = File.join(SystemInclude, match_data[1]) return Inc.new(filename) end ## Do We have a project relative directory include? match_data = line.match(/^\.inc "([^"]+)"$/) unless match_data.nil? filename = File.join(Dir.pwd, match_data[1]) return Inc.new(filename) end ## Nope, not an inc directive nil end |