summaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2015-09-08 09:42:42 +0000
committerkrasimir <krasimir@chalmers.se>2015-09-08 09:42:42 +0000
commitb5e7f08c8269e6c4b9a648d12b734fbec0c98116 (patch)
tree42aac0cda7e838f1d0189fa7bacecc585120c469 /src/runtime
parentea83efa79c7d35c8889e1849dc2a604d7aef99cb (diff)
bugfix in the parser
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/c/pgf/parser.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/runtime/c/pgf/parser.c b/src/runtime/c/pgf/parser.c
index d1afcecac..d308943dc 100644
--- a/src/runtime/c/pgf/parser.c
+++ b/src/runtime/c/pgf/parser.c
@@ -1025,6 +1025,16 @@ pgf_symbols_cmp(GuString* psent, PgfSymbols* syms, bool case_sensitive)
for (size_t i = 0; i < n_syms; i++) {
PgfSymbol sym = gu_seq_get(syms, PgfSymbol, i);
+ if (i > 0) {
+ if (!skip_space(psent))
+ return 1;
+
+ while (**psent != 0) {
+ if (!skip_space(psent))
+ break;
+ }
+ }
+
GuVariantInfo inf = gu_variant_open(sym);
switch (inf.tag) {
case PGF_SYMBOL_CAT:
@@ -1039,16 +1049,6 @@ pgf_symbols_cmp(GuString* psent, PgfSymbols* syms, bool case_sensitive)
if (**psent == 0)
return -1;
- if (i > 0) {
- if (!skip_space(psent))
- return 1;
-
- while (**psent != 0) {
- if (!skip_space(psent))
- break;
- }
- }
-
int cmp = cmp_string(psent, pks->token, case_sensitive);
if (cmp != 0)
return cmp;
@@ -2027,7 +2027,7 @@ pgf_parse_result_enum_next(GuEnum* self, void* to, GuPool* pool)
static GuString
pgf_parsing_last_token(PgfParsing* ps, GuPool* pool)
-{
+{
if (ps->before == NULL)
return "";