summaryrefslogtreecommitdiffstats
path: root/ChangeLog
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-10-14 21:24:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-10-14 21:24:31 -0700
commit8807a16fe3115e19ce4d65f1c8beb476494ccaec (patch)
treef61b0adc3c66f76415553c4d114fe784f97c5e70 /ChangeLog
parent68e4d78cf9f153871d9a3c07c8ce3e43eb517c3b (diff)
downloadtxr-8807a16fe3115e19ce4d65f1c8beb476494ccaec.tar.gz
txr-8807a16fe3115e19ce4d65f1c8beb476494ccaec.tar.bz2
txr-8807a16fe3115e19ce4d65f1c8beb476494ccaec.zip
More type safety, with help from C++ compiler.
* parser.h (scanner_t): New typedef. Cleverly, we use yyguts_t as the basis for this, which pays off in a few places, getting rid of conversions. (parser_t): scanner member redeclared to scanner_t *. (yyerror, yyerr, yyerrof, end_of_regex, end_of_char): Declarations updated. * parser.l (yyerror, yyerrorf, num_esc): scanner argument becomes scanner_t * instead of void *. (yyscanner): Occurrences replaced by yyg: why should we refer to the type-unsafe void *yyscanner, when we know that in the middle of the yylex function we have the properly typed yyguts_t *yyg. (end_of_regex, end_of_char): Argument changes to scanner_t * and name strategically changes to yyg, eliminating the local variable and cast. * parser.y (sym_helper): scanner argument becomes scanner_t * instead of void *. (%parse-param}: void *scnr becomes scanner_t *scnr. (define-transform, yybadtoken): Use scanner_t * instead of void *. (parse): Since yylex_init takes a void **, we use it to initialize a local void *, and then assign it to the structure member.
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog27
1 files changed, 27 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index fb23e8e8..fd8d0bfb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,32 @@
2014-10-14 Kaz Kylheku <kaz@kylheku.com>
+ More type safety, with help from C++ compiler.
+
+ * parser.h (scanner_t): New typedef. Cleverly, we use
+ yyguts_t as the basis for this, which pays off in
+ a few places, getting rid of conversions.
+ (parser_t): scanner member redeclared to scanner_t *.
+ (yyerror, yyerr, yyerrof, end_of_regex, end_of_char):
+ Declarations updated.
+
+ * parser.l (yyerror, yyerrorf, num_esc): scanner argument becomes
+ scanner_t * instead of void *.
+ (yyscanner): Occurrences replaced by yyg: why should we
+ refer to the type-unsafe void *yyscanner, when we know that
+ in the middle of the yylex function we have the properly
+ typed yyguts_t *yyg.
+ (end_of_regex, end_of_char): Argument changes to scanner_t * and name
+ strategically changes to yyg, eliminating the local variable and cast.
+
+ * parser.y (sym_helper): scanner argument becomes
+ scanner_t * instead of void *.
+ (%parse-param}: void *scnr becomes scanner_t *scnr.
+ (define-transform, yybadtoken): Use scanner_t * instead of void *.
+ (parse): Since yylex_init takes a void **, we use it to initialize
+ a local void *, and then assign it to the structure member.
+
+2014-10-14 Kaz Kylheku <kaz@kylheku.com>
+
C++ upkeep.
TXR's support for compiling as C++ pays off: C++ compiler finds