aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-03 15:46:26 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-03 15:46:26 +0100
commit13fae50e458acf9a1f9f1fcfae5c0d91eb1743ab (patch)
treed9b9dccba4099b2beafc3eb2bd337663a3b14ef8 /src/mds-kbdc
parentmds-kbdc: make-tree: m simplification (diff)
downloadmds-13fae50e458acf9a1f9f1fcfae5c0d91eb1743ab.tar.gz
mds-13fae50e458acf9a1f9f1fcfae5c0d91eb1743ab.tar.bz2
mds-13fae50e458acf9a1f9f1fcfae5c0d91eb1743ab.tar.xz
mds-kbdc: make-tree: m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-kbdc/make-tree.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mds-kbdc/make-tree.c b/src/mds-kbdc/make-tree.c
index 1a3f854..8f8a7ce 100644
--- a/src/mds-kbdc/make-tree.c
+++ b/src/mds-kbdc/make-tree.c
@@ -1002,14 +1002,6 @@ static int parse_line(void)
{
/* TODO make this function less complex */
- line = LINE;
- SKIP_SPACES(line);
- if (end = strchrnul(line, ' '), end == line)
- return 0;
- prev_end_char = *end, *end = '\0';
- original = line;
- too_few = 0;
-
redo:
if (in_array)
{
@@ -1334,7 +1326,17 @@ int parse_to_tree(const char* restrict filename, mds_kbdc_parsed_t* restrict res
/* Parse the file. */
for (line_i = 0, line_n = result->source_code->line_count; line_i < line_n; line_i++)
- parse_line();
+ {
+ line = LINE;
+ SKIP_SPACES(line);
+ if (end = strchrnul(line, ' '), end == line)
+ continue;
+ prev_end_char = *end, *end = '\0';
+ original = line;
+ too_few = 0;
+
+ parse_line();
+ }
/* Check parsing state. */