half-arsed: 💩 half implement a proper parser engine class
This commit is contained in:
parent
38d0627394
commit
94b0288aa9
3 changed files with 24 additions and 17 deletions
|
@ -5,8 +5,3 @@ require_relative "comfpile/version"
|
||||||
require_relative 'comfpile/core.rb'
|
require_relative 'comfpile/core.rb'
|
||||||
|
|
||||||
require_relative 'comfpile/engines/filesource_engine.rb'
|
require_relative 'comfpile/engines/filesource_engine.rb'
|
||||||
|
|
||||||
module Comfpile
|
|
||||||
class Error < StandardError; end
|
|
||||||
# Your code goes here...
|
|
||||||
end
|
|
||||||
|
|
|
@ -11,7 +11,25 @@ module Comfpile
|
||||||
attr_reader :exit_state
|
attr_reader :exit_state
|
||||||
attr_reader :stage, :target
|
attr_reader :stage, :target
|
||||||
|
|
||||||
attr_reader :linked_artefacts
|
|
||||||
|
# @return [Array<Comfpile::Artefact>] List of all artefacts
|
||||||
|
# included in this artefact.
|
||||||
|
# Included artefacts are also required, but will additionally
|
||||||
|
# update this Artefact's age.
|
||||||
|
attr_reader :included_artefacts
|
||||||
|
# @return [Array<Comfpile::Artefact] List of all artefacts
|
||||||
|
# required to build this artefact.
|
||||||
|
# Required artefacts are needed to build this artefact, but
|
||||||
|
# do not modify the artefact's age.
|
||||||
|
attr_reader :required_artefacts
|
||||||
|
# @return [Array<Comfpile::Artefact>] List of all artefacts
|
||||||
|
# potentially referenced by this artefact.
|
||||||
|
# Referenced artefacts are those that are potentially used
|
||||||
|
# by this artefact through e.g. function calls, but are
|
||||||
|
# not directly needed to build this artefact. Example being
|
||||||
|
# how sourcecode of a library is eventually needed for e.g.
|
||||||
|
# linking steps, but the objects can be built separately.
|
||||||
|
attr_reader :referenced_artefacts
|
||||||
|
|
||||||
# ARTEFACT STATES
|
# ARTEFACT STATES
|
||||||
#
|
#
|
||||||
|
@ -39,8 +57,8 @@ module Comfpile
|
||||||
|
|
||||||
@parent_artefact = nil
|
@parent_artefact = nil
|
||||||
|
|
||||||
@required_artefacts = nil
|
@required_artefacts = []
|
||||||
@linked_artefacts = nil
|
@included_artefacts = []
|
||||||
|
|
||||||
@steps = []
|
@steps = []
|
||||||
@step_additions = nil
|
@step_additions = nil
|
||||||
|
@ -132,7 +150,7 @@ module Comfpile
|
||||||
elsif item[:artefact].succeeded?
|
elsif item[:artefact].succeeded?
|
||||||
@waitlist.pop
|
@waitlist.pop
|
||||||
else
|
else
|
||||||
skip! skip! "Failed artefact dependency: #{item[:artefact]}"
|
skip! "Failed artefact dependency: #{item[:artefact]}"
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,14 +1,8 @@
|
||||||
|
|
||||||
module Compfile
|
module Compfile
|
||||||
class ParserArtefact < Artefact
|
class ParserArtefact < Artefact
|
||||||
attr_reader :included_files
|
def initialize(*args, **opts)
|
||||||
attr_reader :required_files
|
super(*args, **opts)
|
||||||
|
|
||||||
def initialize(*args)
|
|
||||||
super(*args)
|
|
||||||
|
|
||||||
@included_files = []
|
|
||||||
@required_files = []
|
|
||||||
|
|
||||||
parent_artefact :sourcefile, @target
|
parent_artefact :sourcefile, @target
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue