[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[7185] parsetexi region is element not just command id
From: |
gavinsmith0123 |
Subject: |
[7185] parsetexi region is element not just command id |
Date: |
Wed, 25 May 2016 19:40:43 +0000 (UTC) |
Revision: 7185
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7185
Author: gavin
Date: 2016-05-25 19:40:43 +0000 (Wed, 25 May 2016)
Log Message:
-----------
parsetexi region is element not just command id
Modified Paths:
--------------
trunk/tp/parsetexi/api.c
trunk/tp/parsetexi/context_stack.c
trunk/tp/parsetexi/context_stack.h
trunk/tp/parsetexi/handle_commands.c
trunk/tp/parsetexi/separator.c
trunk/tp/parsetexi/tree_types.h
Modified: trunk/tp/parsetexi/api.c
===================================================================
--- trunk/tp/parsetexi/api.c 2016-05-25 19:19:05 UTC (rev 7184)
+++ trunk/tp/parsetexi/api.c 2016-05-25 19:40:43 UTC (rev 7185)
@@ -707,8 +707,7 @@
STORE2("number", newSViv (j + 1));
if (e->region)
{
- STORE2("region",
- newSVpv (command_name(e->region), 0));
+ STORE2("region", newRV_inc ((SV *)e->region->hv));
}
if (e->content)
{
Modified: trunk/tp/parsetexi/context_stack.c
===================================================================
--- trunk/tp/parsetexi/context_stack.c 2016-05-25 19:19:05 UTC (rev 7184)
+++ trunk/tp/parsetexi/context_stack.c 2016-05-25 19:40:43 UTC (rev 7185)
@@ -69,7 +69,7 @@
/* the valid regions are 'titlepage', 'copying', and 'documentdescription' */
-static enum command_id *region_stack;
+static ELEMENT **region_stack;
static size_t region_top; /* One above last pushed region. */
static size_t region_space;
@@ -80,20 +80,20 @@
}
void
-push_region (enum command_id r)
+push_region (ELEMENT *e)
{
if (region_top >= region_space)
{
region_stack = realloc (region_stack,
- (region_space += 5) * sizeof (enum command_id));
+ (region_space += 5) * sizeof (*region_stack));
}
debug (">>>>>>>>>>>>>>>>>PUSHING REGION STACK AT %d", region_top);
- region_stack[region_top++] = r;
+ region_stack[region_top++] = e;
}
-enum command_id
+ELEMENT *
pop_region ()
{
if (region_top == 0)
@@ -104,10 +104,19 @@
}
enum command_id
-current_region (void)
+current_region_cmd (void)
{
if (region_top == 0)
return CM_NONE;
+ return region_stack[region_top - 1]->cmd;
+}
+
+ELEMENT *
+current_region (void)
+{
+ if (region_top == 0)
+ return 0;
+
return region_stack[region_top - 1];
}
Modified: trunk/tp/parsetexi/context_stack.h
===================================================================
--- trunk/tp/parsetexi/context_stack.h 2016-05-25 19:19:05 UTC (rev 7184)
+++ trunk/tp/parsetexi/context_stack.h 2016-05-25 19:40:43 UTC (rev 7185)
@@ -44,8 +44,9 @@
void reset_context_stack (void);
-void push_region (enum command_id r);
-enum command_id pop_region ();
-enum command_id current_region (void);
+void push_region (ELEMENT *r);
+ELEMENT *pop_region (void);
+ELEMENT *current_region (void);
+enum command_id current_region_cmd (void);
void reset_region_stack (void);
Modified: trunk/tp/parsetexi/handle_commands.c
===================================================================
--- trunk/tp/parsetexi/handle_commands.c 2016-05-25 19:19:05 UTC (rev
7184)
+++ trunk/tp/parsetexi/handle_commands.c 2016-05-25 19:40:43 UTC (rev
7185)
@@ -949,13 +949,13 @@
// 4775
if (command_data(cmd).flags & CF_region)
{
- if (current_region ())
+ if (current_region_cmd ())
{
line_error ("region %s inside region %s is not allowed",
command_name(cmd),
- command_name(current_region ()));
+ command_name(current_region_cmd ()));
}
- push_region (cmd);
+ push_region (block);
}
// 4784 menu commands
Modified: trunk/tp/parsetexi/separator.c
===================================================================
--- trunk/tp/parsetexi/separator.c 2016-05-25 19:19:05 UTC (rev 7184)
+++ trunk/tp/parsetexi/separator.c 2016-05-25 19:40:43 UTC (rev 7185)
@@ -301,7 +301,8 @@
if (1) // TODO check_node_label ()
{
register_label (current->parent, parsed_anchor);
- // TODO "regions stack"
+ if (current_region ())
+ add_extra_element (current, "region", current_region ());
}
}
else if (command_data(closed_command).flags & CF_ref) // 5062
Modified: trunk/tp/parsetexi/tree_types.h
===================================================================
--- trunk/tp/parsetexi/tree_types.h 2016-05-25 19:19:05 UTC (rev 7184)
+++ trunk/tp/parsetexi/tree_types.h 2016-05-25 19:40:43 UTC (rev 7185)
@@ -146,7 +146,7 @@
ELEMENT *command;
ELEMENT *node;
int number; /* Index of entry in containing index, 1-based. */
- enum command_id region;
+ ELEMENT *region;
} INDEX_ENTRY;
typedef struct INDEX {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [7185] parsetexi region is element not just command id,
gavinsmith0123 <=