From 5d276aaf06a18162749a6f0cdce90a359bb03c4e Mon Sep 17 00:00:00 2001 From: Alain Prouté Date: Thu, 22 Dec 2005 15:21:20 +0000 Subject: [PATCH] *** empty log message *** --- anubis_dev/compiler/src/grammar_tools.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/anubis_dev/compiler/src/grammar_tools.c b/anubis_dev/compiler/src/grammar_tools.c index 0044de5..881769a 100644 --- a/anubis_dev/compiler/src/grammar_tools.c +++ b/anubis_dev/compiler/src/grammar_tools.c @@ -66,19 +66,38 @@ Expr string_to_tag(Expr s) { char *text = string_content(s); - if (0) return nil; +#ifdef commme_c_etait_avant + #define item(name) else if (!strcmp(text,#name)) return new_tag(ind_##name); -#define sc_item(name,f) - tag_list -#undef item -#undef sc_item -#define item(name) #define sc_item(name,f) else if (!strcmp(text,#name)) return new_tag(ind_##name); tag_list #undef item #undef sc_item else internal_error("Unable to transform string into tag",s); return nil; + +#else + + int i; + char *tags_names_table[] = + { +#define item(name) #name, +#define sc_item(name,f) #name, + tag_list +#undef item +#undef sc_item + "dummy" + }; + + for (i = 0; i < ind_dummy; i++) + { + if (!strcmp(text,tags_names_table[i])) + return new_tag(i); + } + return nil; + +#endif + } -- libgit2 0.21.4