/// <summary> /// A simple construtor that initializes the object with the given values. /// </summary> /// <param name="p_msfFunctions">The object that implements the script functions.</param> /// <param name="p_strScript">The script to execute.</param> public ModScriptInterpreter(ModScriptFunctionProxy p_msfFunctions, string p_strScript) { m_strScript = p_strScript; Regex rgxAllowRunOnLines = new Regex(@"^\s*AllowRunOnLines\s*$", RegexOptions.Multiline); if (rgxAllowRunOnLines.IsMatch(m_strScript)) { m_strScript = rgxAllowRunOnLines.Replace(m_strScript, ""); Regex rgxContinuedLines = new Regex(@"\\\s*\n", RegexOptions.Multiline); m_strScript = rgxContinuedLines.Replace(m_strScript, ""); } m_sicContext = CreateInterpreterContext(p_msfFunctions); }
/// <summary> /// A simple construtor that initializes the object with the given values. /// </summary> /// <param name="p_msfFunctions">The object that implements the script functions.</param> /// <param name="p_strScript">The script to execute.</param> public ModScriptInterpreter(ModScriptFunctionProxy p_msfFunctions, string p_strScript) { m_strScript = p_strScript; Regex rgxAllowRunOnLines = new Regex(@"^\s*AllowRunOnLines\s*$", RegexOptions.Multiline); if (rgxAllowRunOnLines.IsMatch(m_strScript)) { m_strScript = rgxAllowRunOnLines.Replace(m_strScript, ""); Regex rgxContinuedLines = new Regex(@"\\\s*\n", RegexOptions.Multiline); m_strScript = rgxContinuedLines.Replace(m_strScript, ""); } m_sicContext = CreateInterpreterContext(p_msfFunctions); }