]> vcs.slashdirt.org Git - sw/tic2json.git/commitdiff

vcs.slashdirt.org Git - sw/tic2json.git/commitdiff

git git / sw / tic2json.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 010f143)
parser: cleanup frame handling
2021年8月16日 10:13:50 +0000 (12:13 +0200)
2021年8月16日 10:46:33 +0000 (12:46 +0200)

diff --git a/tic2json.y b/tic2json.y
index 4f29ea52331da57cf1ffbab6f4b8255a1fa27669..a1ed94e665274b748bcd9d3de24430b7d17da129 100644 (file)
--- a/tic2json.y
+++ b/tic2json.y
@@ -154,6 +154,15 @@ void free_field(struct tic_field *field)
}
}
+void frame_sep(void)
+{
+ if (!framecount--) {
+ framecount = skipframes;
+ printf ("%c\n%c", framedelims[1], framedelims[0]);
+ }
+ fdelim=' ';
+}
+
%}
%union {
@@ -211,18 +220,11 @@ etiquette:
frames:
frame
| frames frame
- {
- if (!framecount--) {
- framecount = skipframes;
- printf ("%c\n%c", framedelims[1], framedelims[0]);
- }
- fdelim=' ';
- }
;
frame:
- TOK_STX datasets TOK_ETX
- | error TOK_ETX { pr_err("frame error\n"); yyerrok; }
+ TOK_STX datasets TOK_ETX { frame_sep(); }
+ | error TOK_ETX { frame_sep(); pr_err("frame error\n"); yyerrok; }
;
datasets:
tic2json TIC parser/converter
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /