/// <summary>
        /// Create a new <see cref="NumberConvertOptions"/> based on the provided flags
        /// </summary>
        public NumberConvertOptions(ParseNumericStringFlags parseFlags)
        {
            this.ParseFlags = parseFlags;

            this.ParseHex            = ParseFlags.HasFlag(ParseNumericStringFlags.HexString);
            this.ParseOctal          = ParseFlags.HasFlag(ParseNumericStringFlags.OctalString);
            this.ParseBinary         = ParseFlags.HasFlag(ParseNumericStringFlags.BinaryString);
            this.AllowDigitSeparator = ParseFlags.HasFlag(ParseNumericStringFlags.AllowDigitSeparator);
        }
Exemplo n.º 2
0
        protected void ParseTerminatorOrBody(Parser parser, ParseFlags flags)
        {
            // Check for an optional ';' in place of the body
            if (parser.TokenText == Terminator)
            {
                ParseTerminator(parser);

                // Check for compiler directives, storing them as postfix annotations on the parent
                Block.ParseCompilerDirectives(parser, this, AnnotationFlags.IsPostfix, false);
            }
            else
            {
                if (flags.HasFlag(ParseFlags.SkipMethodBodies))
                {
                    Block.SkipParsingBlock(parser, this, true);
                }
                else
                {
                    new Block(out _body, parser, this, true);  // Parse the body
                }
            }
        }