Esempio n. 1
0
 public ParsingScript(ParsingScript other)
 {
     m_data           = other.String;
     m_from           = other.Pointer;
     m_char2Line      = other.Char2Line;
     m_filename       = other.Filename;
     m_originalScript = other.OriginalScript;
     StackLevel       = other.StackLevel;
     CurrentClass     = other.CurrentClass;
     ClassInstance    = other.ClassInstance;
     ScriptOffset     = other.ScriptOffset;
     Debugger         = other.Debugger;
     InTryBlock       = other.InTryBlock;
 }
Esempio n. 2
0
        public static ParsingScript GetTempScript(string str, ParserFunction.StackLevel stackLevel, string name = "",
                                                  ParsingScript script = null, ParsingScript parentScript    = null,
                                                  int parentOffset     = 0, CSCSClass.ClassInstance instance = null)
        {
            ParsingScript tempScript = new ParsingScript(str);

            tempScript.ScriptOffset = parentOffset;
            if (parentScript != null)
            {
                tempScript.Char2Line      = parentScript.Char2Line;
                tempScript.Filename       = parentScript.Filename;
                tempScript.OriginalScript = parentScript.OriginalScript;
            }
            tempScript.ParentScript  = script;
            tempScript.InTryBlock    = script == null ? false : script.InTryBlock;
            tempScript.ClassInstance = instance;
            tempScript.StackLevel    = stackLevel;

            return(tempScript);
        }
Esempio n. 3
0
        public static string GetActualPropertyName(string propName, List <string> properties,
                                                   string baseName = "", Variable root = null)
        {
            string match = properties.FirstOrDefault(element => element.Equals(propName,
                                                                               StringComparison.OrdinalIgnoreCase));

            if (string.IsNullOrWhiteSpace(match))
            {
                match = "";
                if (root != null)
                {
                    string objName = !string.IsNullOrWhiteSpace(baseName) ? baseName + "." : "";
                    if (string.IsNullOrWhiteSpace(objName))
                    {
                        CSCSClass.ClassInstance obj = root.m_object as CSCSClass.ClassInstance;
                        objName = obj != null ? obj.InstanceName + "." : "";
                    }
                    match = Constants.GetRealName(objName + propName);
                    match = match.Substring(objName.Length);
                }
            }
            return(match);
        }