[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[8275] parsetexi update
From: |
gavinsmith0123 |
Subject: |
[8275] parsetexi update |
Date: |
Sat, 13 Oct 2018 05:04:57 -0400 (EDT) |
Revision: 8275
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8275
Author: gavin
Date: 2018-10-13 05:04:57 -0400 (Sat, 13 Oct 2018)
Log Message:
-----------
parsetexi update
Modified Paths:
--------------
trunk/tp/Texinfo/XS/parsetexi/Parsetexi.pm
trunk/tp/Texinfo/XS/parsetexi/convert.c
Modified: trunk/tp/Texinfo/XS/parsetexi/Parsetexi.pm
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/Parsetexi.pm 2018-10-13 08:53:22 UTC (rev
8274)
+++ trunk/tp/Texinfo/XS/parsetexi/Parsetexi.pm 2018-10-13 09:04:57 UTC (rev
8275)
@@ -75,7 +75,6 @@
# case
'CPP_LINE_DIRECTIVES' => 1, # handle cpp like synchronization lines
'MAX_MACRO_CALL_NESTING' => 100000, # max number of nested macro calls
- 'GLOBAL_COMMANDS' => [], # list of commands registered
# This is not used directly, but passed to Convert::Text through
# Texinfo::Common::_convert_text_options
'ENABLE_ENCODING' => 1, # output accented and special characters
@@ -250,30 +249,12 @@
use File::Basename; # for fileparse
-# Replacement for Texinfo::Parser::parse_texi_file (line 835)
-sub parse_texi_file ($$)
-{
- my $self = shift;
- my $file_name = shift;
- my $tree_stream;
+# Handle 'IGNORE_BEFORE_SETFILENAME' conf value.
+# Put everything before @setfilename in a special type. This allows
+# ignoring everything before @setfilename.
+sub _maybe_ignore_before_setfilename {
+ my ($self, $text_root) = @_;
-
- parse_file ($file_name);
- my $TREE = build_texinfo_tree ();
- get_parser_info ($self);
- _complete_node_menus ($self, $TREE);
-
- # line 899
- my $text_root;
- if ($TREE->{'type'} eq 'text_root') {
- $text_root = $TREE;
- } elsif ($TREE->{'contents'} and $TREE->{'contents'}->[0]
- and $TREE->{'contents'}->[0]->{'type'} eq 'text_root') {
- $text_root = $TREE->{'contents'}->[0];
- }
-
- # Put everything before @setfilename in a special type. This allows
- # ignoring everything before @setfilename.
if ($self->{'IGNORE_BEFORE_SETFILENAME'} and $text_root
and $self->{'extra'}->{'setfilename'}
and $self->{'extra'}->{'setfilename'}->{'parent'} eq $text_root) {
@@ -296,7 +277,31 @@
if (@{$before_setfilename->{'contents'}});
}
}
+}
+# Replacement for Texinfo::Parser::parse_texi_file (line 835)
+sub parse_texi_file ($$)
+{
+ my $self = shift;
+ my $file_name = shift;
+ my $tree_stream;
+
+ parse_file ($file_name);
+ my $TREE = build_texinfo_tree ();
+ get_parser_info ($self);
+ _complete_node_menus ($self, $TREE);
+
+ # line 899
+ my $text_root;
+ if ($TREE->{'type'} eq 'text_root') {
+ $text_root = $TREE;
+ } elsif ($TREE->{'contents'} and $TREE->{'contents'}->[0]
+ and $TREE->{'contents'}->[0]->{'type'} eq 'text_root') {
+ $text_root = $TREE->{'contents'}->[0];
+ }
+
+ _maybe_ignore_before_setfilename($self, $text_root);
+
############################################################
if (defined($self->{'info'}->{'input_encoding_name'})) {
Modified: trunk/tp/Texinfo/XS/parsetexi/convert.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/convert.c 2018-10-13 08:53:22 UTC (rev
8274)
+++ trunk/tp/Texinfo/XS/parsetexi/convert.c 2018-10-13 09:04:57 UTC (rev
8275)
@@ -1,4 +1,4 @@
-/* Copyright 2010, 2011, 2012, 2013, 2014, 2015, 2016
+/* Copyright 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
@@ -88,8 +88,6 @@
// TODO node
- // TODO "fix" arg
-
if (e->args.number > 0)
{
int braces, arg_nr, i;
@@ -141,8 +139,6 @@
ADD(e->text.text);
else
{
- // TODO "fix" argument
-
if (e->cmd
|| e->type == ET_def_line
|| e->type == ET_menu_entry
@@ -169,7 +165,7 @@
if (e->type == ET_bracketed)
ADD("}");
- // TODO: "fix" arg or raw block command
+ // TODO: raw block command
if (command_flags (e) & CF_block)
{
ADD("@end ");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [8275] parsetexi update,
gavinsmith0123 <=