Exemplo n.º 1
0
        // Token: 0x06000554 RID: 1364 RVA: 0x00010FC8 File Offset: 0x0000F1C8
        public AScannerError GetFloat(bool newLines = true)
        {
            this.parsedFloat = 0f;
            if (this.IsAtEndOfScript)
            {
                return(AScannerError.UnexpectedEOF);
            }
            if (!this.SkipWhitespace(newLines))
            {
                return(AScannerError.UnexpectedEOF);
            }
            StringBuilder stringBuilder = new StringBuilder();

            while (!this.IsAtEndOfScript)
            {
                char c = this.ReadChar();
                if (!AScanner.IsFloat(c))
                {
                    break;
                }
                stringBuilder.Append(c);
            }
            if (stringBuilder.Length == 0)
            {
                return(AScannerError.NothingWasThere);
            }
            this.StepBack(1);
            if (float.TryParse(stringBuilder.ToString(), NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint, NumberFormatInfo.InvariantInfo, out this.parsedFloat))
            {
                return(AScannerError.None);
            }
            return(AScannerError.IncorrectNumberFormat);
        }
Exemplo n.º 2
0
 // Token: 0x06000578 RID: 1400 RVA: 0x0001167C File Offset: 0x0000F87C
 protected static bool IsFloat(string str)
 {
     return(str != null && str.Length != 0 && AScanner.IsFloat(str[0]));
 }