[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] symbols: improve symbol aliasing
From: |
Akim Demaille |
Subject: |
Re: [PATCH 1/2] symbols: improve symbol aliasing |
Date: |
Tue, 30 Jul 2013 18:10:23 +0200 |
Le 30 juil. 2013 à 17:37, Valentin Tolmer <address@hidden> a écrit :
> diff --git a/src/parse-gram.y b/src/parse-gram.y
> index 1ec4b4d..e8f4aa0 100644
> --- a/src/parse-gram.y
> +++ b/src/parse-gram.y
> @@ -452,7 +452,7 @@ symbol_declaration:
> symbol_list *list;
> tag_seen = true;
> for (list = $3; list; list = list->next)
> - symbol_type_set (list->content.sym, $2, @2);
> + symbol_type_set (list->content.sym->content, $2, @2);
Don't you think that these guys should still work on symbols
as before, but process their content behind the scenes?
I think that these changes should be mostly internal, and
virtualy invisible from the call sites.
> symbol_list_free ($3);
> }
> ;
> @@ -464,8 +464,9 @@ precedence_declaration:
> ++current_prec;
> for (list = $3; list; list = list->next)
> {
> - symbol_type_set (list->content.sym, current_type, @2);
> - symbol_precedence_set (list->content.sym, current_prec, $1, @1);
> + symbol_type_set (list->content.sym->content, current_type, @2);
> + symbol_precedence_set (list->content.sym, current_prec,
> + $1, @1);
> }
> symbol_list_free ($3);
> current_type = NULL;
> @@ -501,7 +502,7 @@ symbol.prec:
> | symbol INT
> {
> $$ = $1;
> - symbol_user_token_number_set ($1, $2, @2);
> + symbol_user_token_number_set ($1->content, $2, @2);
> symbol_class_set ($1, token_sym, @1, false);
> }
> ;
> diff --git a/tests/input.at b/tests/input.at
> index eb73bf9..1548f14 100644
> --- a/tests/input.at
> +++ b/tests/input.at
> @@ -672,25 +672,25 @@ exp: foo;
> ]])
>
> AT_BISON_CHECK([-fcaret input.y], [1], [],
> -[[input.y:8.7-11: error: %type redeclaration for foo
> +[[input.y:8.7-11: error: %type redeclaration for "foo"
> %type <baz> "foo"
> ^^^^^
> input.y:3.7-11: previous declaration
> %type <bar> foo
> ^^^^^
> -input.y:10.13-17: error: %destructor redeclaration for foo
> - %destructor {baz} "foo"
> - ^^^^^
> -input.y:5.13-17: previous declaration
> - %destructor {bar} foo
> - ^^^^^
> -input.y:9.10-14: error: %printer redeclaration for foo
> +input.y:9.10-14: error: %printer redeclaration for "foo"
> %printer {baz} "foo"
> ^^^^^
> input.y:4.10-14: previous declaration
> %printer {bar} foo
> ^^^^^
> -input.y:11.1-5: error: %left redeclaration for foo
> +input.y:10.13-17: error: %destructor redeclaration for "foo"
> + %destructor {baz} "foo"
> + ^^^^^
> +input.y:5.13-17: previous declaration
> + %destructor {bar} foo
> + ^^^^^
> +input.y:11.1-5: error: %left redeclaration for "foo"
> %left "foo"
> ^^^^^
> input.y:6.1-5: previous declaration
Order change only, ok. Which shows how poor we are in the order
of error messages :(