summaryrefslogtreecommitdiffstats
path: root/src/parser.h
diff options
context:
space:
mode:
authorLeonid S. Usov <leonid@practi.net>2018-10-19 21:57:41 +0300
committerWilliam Langford <wlangfor@gmail.com>2019-10-22 14:11:04 -0400
commitcf4b48c7ba30cb30e116b523cff036ea481459f6 (patch)
treeb6d5a0ed3286e77d7d1fb84e8bec3c33686dd96e /src/parser.h
parentb6be13d5de6dd7d8aad5fd871eb6b0b30fc7d7f6 (diff)
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.
Diffstat (limited to 'src/parser.h')
-rw-r--r--src/parser.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/parser.h b/src/parser.h
index b15c53aa..4d14e954 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -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;