Wiki
Show
Ignore:
Timestamp:
03/12/10 09:25:11 (2 years ago)
Author:
Chuck.Esterbrook
Message:

An above error about numeric types indicates that you may want to set the default numeric type with "@number [expectedType]" in a source file or "cobra -number:[expectedType]" at the command line.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Source/Phases/Phase.cobra

    r2188 r2315  
    1 class Phase is abstract 
     1class Phase implements IComparable<of Phase> is abstract 
    22    """ 
    33    A phase of the compiler. 
     
    2222        return .compiler.options 
    2323 
     24    get order as int 
     25        """ 
     26        Subclasses can override to change their order with respect to other phases. 
     27        Consecutive phases in the initial list of phases are kept in sequence with a "stable sort". 
     28        Default is 100. 
     29        """ 
     30        return 100 
     31 
     32    pro stableOrder from var as int 
     33        """ 
     34        Used to implement a "stable sort". 
     35        """ 
     36 
     37    get willRunWithErrors as bool 
     38        """ 
     39        Returns true if the phase will run correctly even if previously run phases produced errors. 
     40        Typically, phases will not want to run with errors because the AST nodes will in an 
     41        incomplete state that the phase cannot rely on. Hence, the default is false. 
     42        However, subclasses may override to return true if appropriate. 
     43        """ 
     44        return false 
     45 
    2446    get verbosity as int 
    2547        return .compiler.verbosity 
    2648 
     49    def compareTo(other as Phase) as int 
     50        diff = .order - other.order 
     51        if diff == 0, diff = .stableOrder - other.stableOrder 
     52        return diff 
     53         
    2754    var _didSucceed as bool 
    2855