diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-12-03 15:46:26 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-12-03 15:46:26 +0100 |
commit | 13fae50e458acf9a1f9f1fcfae5c0d91eb1743ab (patch) | |
tree | d9b9dccba4099b2beafc3eb2bd337663a3b14ef8 | |
parent | mds-kbdc: make-tree: m simplification (diff) | |
download | mds-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.c | 20 |
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. */ |