aboutsummaryrefslogtreecommitdiff
path: root/src/tree.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-01-03 13:31:53 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2012-01-03 13:31:53 +0200
commitb74252278ec81bea7b4a295d1cd49134ef03ee7c (patch)
treefd672a02036d721c30df79c67e3e78944c3867df /src/tree.c
parent1d9ad0a97161772e423160d13209676778d6fca1 (diff)
downloadgrecs-b74252278ec81bea7b4a295d1cd49134ef03ee7c.tar.gz
grecs-b74252278ec81bea7b4a295d1cd49134ef03ee7c.tar.bz2
Implement "inactive" statements.
* README.submodule: Minor change. * src/format.c (grecs_print_simple_statement): Mark inactive statements as such. (grecs_print_statement_array): Fix type comparison. Return immediately if given a NULL argument. * src/grecs.h (GRECS_INAC): New flag. * src/tree.c (find_keyword): Avoid coredump if cursect->kwd is NULL. (reduceproc): Skip inactive statements.
Diffstat (limited to 'src/tree.c')
-rw-r--r--src/tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tree.c b/src/tree.c
index 0aee836..785b81b 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -271,7 +271,7 @@ find_keyword(struct grecs_keyword *cursect, const char *ident)
{
struct grecs_keyword *kwp;
- if (cursect && cursect != &fake) {
+ if (cursect && cursect->kwd && cursect != &fake) {
for (kwp = cursect->kwd; kwp->ident; kwp++)
if (strcmp(kwp->ident, ident) == 0)
return kwp;
@@ -1070,6 +1070,8 @@ reduceproc(enum grecs_tree_recurse_op op, struct grecs_node *node, void *data)
node->ident);
return grecs_tree_recurse_skip;
}
+ if (kwp->type & GRECS_INAC)
+ return grecs_tree_recurse_skip;
if (op == grecs_tree_recurse_pre) {
grecs_list_push(clos->sections, clos->cursect);
clos->cursect = kwp;

Return to:

Send suggestions and report system problems to the System administrator.