Example #1
0
        internal object GetObjectValue(PipFragment arg)
        {
            if (arg.FragmentType == PipFragmentType.StringLiteral)
            {
                return(arg.GetStringIdValue().ToString(Context.StringTable));
            }

            if (arg.FragmentType == PipFragmentType.NestedFragment)
            {
                return(arg.GetNestedFragmentValue());
            }

            return(GetPathValue(arg));
        }
Example #2
0
        private void VerifyNested1(PipFragment fragment)
        {
            PipData nestedData = fragment.GetNestedFragmentValue();

            XAssert.AreEqual(NumStandardBlockFragments + 1, nestedData.FragmentCount);
            using (var nestedEnumerator = nestedData.GetEnumerator())
            {
                var localEnumerator = nestedEnumerator;

                VerifyStandardBlock(ref localEnumerator);

                AssertMoveNext(ref localEnumerator, out fragment, PipFragmentType.StringLiteral);
                XAssert.AreEqual(UniqueEntry1, m_pathTable.StringTable.GetString(fragment.GetStringIdValue()));

                XAssert.IsFalse(localEnumerator.MoveNext());
            }
        }
Example #3
0
        private IExpression Generate(PipFragment fragment)
        {
            switch (fragment.FragmentType)
            {
            case PipFragmentType.Invalid:
                return(Identifier.CreateUndefined());

            case PipFragmentType.StringLiteral:
                return(Generate(fragment.GetStringIdValue()));

            case PipFragmentType.AbsolutePath:
                return(Generate(fragment.GetPathValue()));

            case PipFragmentType.NestedFragment:
                return(Generate(fragment.GetNestedFragmentValue()));

            default:
                throw Contract.AssertFailure($"Unexpected PipFragmentType from PipFragment.FragmentType: {fragment.FragmentType}");
            }
        }
Example #4
0
 private ObjectInfo PipFragmentInfo(object context, PipFragment pipFrag)
 {
     return(pipFrag.FragmentType == PipFragmentType.StringLiteral ? GetObjectInfo(context, pipFrag.GetStringIdValue()) :
            pipFrag.FragmentType == PipFragmentType.AbsolutePath ? GetObjectInfo(context, pipFrag.GetPathValue()) :
            pipFrag.FragmentType == PipFragmentType.NestedFragment ? GetObjectInfo(context, pipFrag.GetNestedFragmentValue()) :
            new ObjectInfo("{invalid}"));
 }