diff options
Diffstat (limited to 'src/meta1gram.y')
-rw-r--r-- | src/meta1gram.y | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/src/meta1gram.y b/src/meta1gram.y index 6256448..deaf382 100644 --- a/src/meta1gram.y +++ b/src/meta1gram.y | |||
@@ -2,3 +2,3 @@ | |||
2 | /* MeTA1 configuration parser for GNU Pies. | 2 | /* MeTA1 configuration parser for GNU Pies. |
3 | Copyright (C) 2008, 2009, 2010 Sergey Poznyakoff | 3 | Copyright (C) 2008, 2009, 2010, 2011 Sergey Poznyakoff |
4 | 4 | ||
@@ -22,4 +22,6 @@ | |||
22 | #include "pies.h" | 22 | #include "pies.h" |
23 | #include "grecs-locus.h" | ||
23 | #include "meta1lex.h" | 24 | #include "meta1lex.h" |
24 | 25 | #include "meta1gram.h" | |
26 | |||
25 | #define META1_QUEUE_DIR() \ | 27 | #define META1_QUEUE_DIR() \ |
@@ -53,3 +55,3 @@ meta1_stmt_create (enum meta1_stmt_type type, const char *ident) | |||
53 | p->ident = ident; | 55 | p->ident = ident; |
54 | p->locus = meta1_locus; | 56 | p->locus = meta1lloc; |
55 | return p; | 57 | return p; |
@@ -86,5 +88,8 @@ static void meta1_translate (struct meta1_stmt *); | |||
86 | 88 | ||
89 | %error-verbose | ||
90 | %locations | ||
91 | |||
87 | %union { | 92 | %union { |
88 | char *string; | 93 | char *string; |
89 | gl_list_t list; | 94 | struct grecs_list *list; |
90 | grecs_value_t *value; | 95 | grecs_value_t *value; |
@@ -170,9 +175,9 @@ string : META1_IDENT | |||
170 | { | 175 | { |
171 | const void *p; | 176 | struct grecs_list_entry *ep; |
172 | gl_list_iterator_t itr = gl_list_iterator ($1); | ||
173 | |||
174 | meta1_line_begin (); | 177 | meta1_line_begin (); |
175 | while (gl_list_iterator_next (&itr, &p, NULL)) | 178 | for (ep = $1->head; ep; ep = ep->next) |
176 | meta1_line_add (p, strlen (p)); | 179 | { |
177 | gl_list_iterator_free (&itr); | 180 | const char *p = ep->data; |
181 | meta1_line_add (p, strlen (p)); | ||
182 | } | ||
178 | $$ = meta1_line_finish (); | 183 | $$ = meta1_line_finish (); |
@@ -183,8 +188,4 @@ slist : META1_STRING | |||
183 | { | 188 | { |
184 | $$ = gl_list_create_empty (&gl_linked_list_implementation, | 189 | $$ = grecs_list_create (); |
185 | NULL, | 190 | grecs_list_append ($$, $1); |
186 | NULL, | ||
187 | NULL, | ||
188 | true); | ||
189 | gl_list_add_last ($$, $1); | ||
190 | } | 191 | } |
@@ -192,3 +193,3 @@ slist : META1_STRING | |||
192 | { | 193 | { |
193 | gl_list_add_last ($1, $2); | 194 | grecs_list_append ($1, $2); |
194 | $$ = $1; | 195 | $$ = $1; |
@@ -209,8 +210,4 @@ values : value | |||
209 | { | 210 | { |
210 | $$ = gl_list_create_empty (&gl_linked_list_implementation, | 211 | $$ = grecs_list_create (); |
211 | NULL, | 212 | grecs_list_append ($$, $1); |
212 | NULL, | ||
213 | NULL, | ||
214 | true); | ||
215 | gl_list_add_last ($$, $1); | ||
216 | } | 213 | } |
@@ -218,3 +215,3 @@ values : value | |||
218 | { | 215 | { |
219 | gl_list_add_last ($1, $3); | 216 | grecs_list_append ($1, $3); |
220 | $$ = $1; | 217 | $$ = $1; |
@@ -231,3 +228,3 @@ yyerror (char *s) | |||
231 | { | 228 | { |
232 | meta1_parse_error ("%s", s); | 229 | grecs_error (&yylloc, 0, "%s", s); |
233 | return 0; | 230 | return 0; |