Esempio n. 1
0
        public static P5Scalar SymbolicReferenceScalar(Runtime runtime, IP5ScalarBody any, bool create)
        {
            string name = any.AsString(runtime);
            var glob = SymbolicReference(runtime, name, create);

            if (glob == null)
                return null;
            if (glob.Scalar != null || !create)
                return glob.Scalar;

            return glob.Scalar = new P5Scalar(runtime);
        }
Esempio n. 2
0
        public static P5Hash SymbolicReferenceHash(Runtime runtime, IP5ScalarBody any, bool create)
        {
            string name = any.AsString(runtime);

            if (name.EndsWith("::"))
            {
                var pack = runtime.SymbolTable.GetPackage(runtime, name.Substring(0, name.Length - 2), create);

                return pack;
            }

            var glob = SymbolicReference(runtime, name, create);

            if (glob == null)
                return null;
            if (glob.Hash != null || !create)
                return glob.Hash;

            return glob.Hash = new P5Hash(runtime);
        }
Esempio n. 3
0
 public static P5Typeglob SymbolicReferenceGlob(Runtime runtime, IP5ScalarBody any, bool create)
 {
     string name = any.AsString(runtime);
     return SymbolicReference(runtime, name, create);
 }
Esempio n. 4
0
        public static P5Handle SymbolicReferenceHandle(Runtime runtime, IP5ScalarBody any, bool create)
        {
            string name = any.AsString(runtime);
            var glob = SymbolicReference(runtime, name, create);

            if (glob == null)
                return null;

            return glob.Handle;
        }
Esempio n. 5
0
        public static P5Code SymbolicReferenceCode(Runtime runtime, IP5ScalarBody any, bool create)
        {
            string name = any.AsString(runtime);
            var glob = SymbolicReference(runtime, name, create);

            if (glob == null)
                return null;
            if (glob.Code != null || !create)
                return glob.Code;

            return glob.Code = new P5Code(name, null);
        }