public LiteralExpression(LuaParser.NumberContext context, ScriptLoadingContext lcontext)
            : base(context, lcontext)
        {
            if (m_Value == null)
            {
                TryParse(context.FLOAT(), s => double.Parse(s, CultureInfo.InvariantCulture));
            }
            if (m_Value == null)
            {
                TryParse(context.HEX(), s => (double)ulong.Parse(RemoveHexHeader(s), NumberStyles.HexNumber, CultureInfo.InvariantCulture));
            }
            if (m_Value == null)
            {
                TryParse(context.INT(), s => double.Parse(s, CultureInfo.InvariantCulture));
            }
            if (m_Value == null)
            {
                TryParse(context.HEX_FLOAT(), s => ParseHexFloat(s));
            }

            if (m_Value == null)
            {
                throw new SyntaxErrorException("unknown number format near '{0}'", context.GetText());
            }
        }
示例#2
0
 public void ExitNumber([NotNull] LuaParser.NumberContext context)
 {
     throw new NotImplementedException();
 }
示例#3
0
 public virtual void ExitNumber([NotNull] LuaParser.NumberContext context)
 {
 }
示例#4
0
 public virtual Result VisitNumber([NotNull] LuaParser.NumberContext context)
 {
     return(VisitChildren(context));
 }
示例#5
0
 public void EnterNumber([NotNull] LuaParser.NumberContext context) => DefaultEnter(context);