Save literal value of the parsed number to preserve it for the output
Extend jv_number to use decNumber for storing number literals. Any math operations on the numbers will truncate them to double precision. Comparisons when both numbers are literal numbers will compare them without truncation. Delay conversion of numbers to doubles until a math operation is performed, to preserve precision. A literal jv_number will only need conversion to double once, and will reuse the resultant double on subsequent conversions. Outputting literal jv_numbers preserves the original precision. Add strong pthread requirement to manage contexts/allocations for converting numbers between their decNumber, string, and double formats.
This commit is contained in:
1 parent
b6be13d5de
commit
cf4b48c7ba
21 files changed
+1374
-755
No files matched your search
+10
-6
@@ -1,8 +1,9 @@
|
||||
/* A Bison parser, made by GNU Bison 3.0.4. */
|
||||
/* A Bison parser, made by GNU Bison 3.3.2. */
|
||||
|
||||
/* Bison interface for Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -30,6 +31,9 @@
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
/* Undocumented macros, especially those whose name start with YY_,
|
||||
are private implementation details. Do not rely on them. */
|
||||
|
||||
#ifndef YY_YY_SRC_PARSER_H_INCLUDED
|
||||
# define YY_YY_SRC_PARSER_H_INCLUDED
|
||||
/* Debug traces. */
|
||||
@@ -40,7 +44,7 @@
|
||||
extern int yydebug;
|
||||
#endif
|
||||
/* "%code requires" blocks. */
|
||||
#line 11 "src/parser.y" /* yacc.c:1909 */
|
||||
#line 11 "src/parser.y" /* yacc.c:1927 */
|
||||
|
||||
#include "locfile.h"
|
||||
struct lexer_param;
|
||||
@@ -57,7 +61,7 @@ struct lexer_param;
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#line 61 "src/parser.h" /* yacc.c:1909 */
|
||||
#line 65 "src/parser.h" /* yacc.c:1927 */
|
||||
|
||||
/* Token type. */
|
||||
#ifndef YYTOKENTYPE
|
||||
@@ -163,12 +167,12 @@ struct lexer_param;
|
||||
|
||||
union YYSTYPE
|
||||
{
|
||||
#line 31 "src/parser.y" /* yacc.c:1909 */
|
||||
#line 31 "src/parser.y" /* yacc.c:1927 */
|
||||
|
||||
jv literal;
|
||||
block blk;
|
||||
|
||||
#line 172 "src/parser.h" /* yacc.c:1909 */
|
||||
#line 176 "src/parser.h" /* yacc.c:1927 */
|
||||
};
|
||||
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
|
||||
Reference in new issue
Block a user