github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/lang/runmode/runmode.go (about)

     1  package runmode
     2  
     3  //go:generate stringer -type=RunMode
     4  
     5  // RunMode is the type for defining the murex interpreters run mode
     6  type RunMode int
     7  
     8  // These are the different supported run modes
     9  const (
    10  	Default RunMode = iota
    11  
    12  	Normal
    13  
    14  	BlockUnsafe
    15  	FunctionUnsafe
    16  	ModuleUnsafe
    17  
    18  	BlockTry
    19  	BlockTryPipe
    20  	BlockTryErr
    21  	BlockTryPipeErr
    22  
    23  	FunctionTry
    24  	FunctionTryPipe
    25  	FunctionTryErr
    26  	FunctionTryPipeErr
    27  
    28  	ModuleTry
    29  	ModuleTryPipe
    30  	ModuleTryErr
    31  	ModuleTryPipeErr
    32  )
    33  
    34  // IsStrict checks if RunMode is a Try or TryPipe block
    35  func (i RunMode) IsStrict() bool {
    36  	if i > ModuleUnsafe {
    37  		return true
    38  	}
    39  
    40  	return false
    41  }