C# Class csscript.DefaultPrecompiler

The interface that all CS-Script precompilers need to implement.

The following is an example of the precompiler for sanitizing the script containing hashbang string on Linux.

public class HashBangPrecompiler : IPrecompiler { public bool Compile(ref string code, PrecompilationContext context) { if (code.StartsWith("#!")) { code = "//" + code; //comment the Linux hashbang line to keep C# compiler happy return true; } return false; } } /// Compiles/modifies the specified code. ///

///

///
Afficher le fichier Open project: oleg-shilo/cs-script

Méthodes publiques

Méthode Description
Compile ( string &code, string scriptFile, bool IsPrimaryScript, Hashtable context ) : bool

Method Details

Compile() public static méthode

public static Compile ( string &code, string scriptFile, bool IsPrimaryScript, Hashtable context ) : bool
code string
scriptFile string
IsPrimaryScript bool
context System.Collections.Hashtable
Résultat bool