Пример #1
0
            public static bool Parse(SeekableReader r, out Companion companion)
            {
                if (NearCompanion.Parse(r, out NearCompanion nc))
                {
                    companion = nc;
                    return(true);
                }
#if EXTENDED_SYSTEM_PARSING
                if (FarCompanion.Parse(r, out FarCompanion fc))
                {
                    companion = fc;
                    return(true);
                }
#endif
                companion = null;
                return(false);
            }
Пример #2
0
            public static bool Parse(TextReader r, out Companion companion)
            {
                NearCompanion nc;

                if (NearCompanion.Parse(r, out nc))
                {
                    companion = nc;
                    return(true);
                }
#if EXTENDED_SYSTEM_PARSING
                FarCompanion fc;
                if (FarCompanion.Parse(r, out fc))
                {
                    companion = fc;
                    return(true);
                }
#endif
                companion = null;
                return(false);
            }
Пример #3
0
            public static bool Parse(SeekableReader r, out FarCompanion far)
            {
                if (r.Peek() != '[')
                {
                    far = null;
                    return(false);
                }

                far = new FarCompanion();
                r.Read(); // '['

                if (!System.Parse(r, out far.Companion))
                {
                    throw new InvalidSystemException("Invalid far companion");
                }

                if (r.Read() != ']')
                {
                    throw new InvalidSystemException("Unclosed far companion");
                }

                return(true);
            }
Пример #4
0
            public static bool Parse( TextReader r, out FarCompanion far )
            {
                if( r.Peek() != '[' )
                {
                    far = null;
                    return false;
                }

                far = new FarCompanion();
                r.Read(); // '['

                if( !System.Parse(r, out far.Companion) )
                    throw new InvalidSystemException( "Invalid far companion" );

                if( r.Read() != ']' )
                    throw new InvalidSystemException( "Unclosed far companion" );

                return true;
            }