[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Revert "* tp/Texinfo/XS/parsetexi/parser.c (set_r
From: |
Gavin D. Smith |
Subject: |
branch master updated: Revert "* tp/Texinfo/XS/parsetexi/parser.c (set_restricted, global_restricted):" |
Date: |
Mon, 27 Nov 2023 14:09:54 -0500 |
This is an automated email from the git hooks/post-receive script.
gavin pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new f6fdf30974 Revert "* tp/Texinfo/XS/parsetexi/parser.c (set_restricted,
global_restricted):"
f6fdf30974 is described below
commit f6fdf30974876d04bae3500047adbf9d08503ec4
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Mon Nov 27 19:09:45 2023 +0000
Revert "* tp/Texinfo/XS/parsetexi/parser.c (set_restricted,
global_restricted):"
This reverts commit 9f6736ec53bc8a1123233e5b80d8d60333a4068c.
---
ChangeLog | 19 ---
tp/Makefile.tres | 1 -
tp/Texinfo/XS/parsetexi/Parsetexi.pm | 9 --
tp/Texinfo/XS/parsetexi/Parsetexi.xs | 3 -
tp/Texinfo/XS/parsetexi/api.c | 6 -
tp/Texinfo/XS/parsetexi/api.h | 1 -
tp/Texinfo/XS/parsetexi/macro.c | 3 -
tp/Texinfo/XS/parsetexi/parser.c | 9 +-
tp/Texinfo/XS/parsetexi/parser.h | 2 -
tp/t/init/translate_txiinternalvalue_macro.init | 30 ----
tp/t/init_files_tests.t | 7 -
...acro_defined_txiinternalvalue_in_translation.pl | 155 ---------------------
12 files changed, 1 insertion(+), 244 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f171343eb7..f9b7939785 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,22 +1,3 @@
-2023-11-27 Gavin Smith <gavinsmith0123@gmail.com>
-
- * tp/Texinfo/XS/parsetexi/parser.c (set_restricted, global_restricted):
- New.
- * tp/Texinfo/XS/parsetexi/macro.c (new_macro): Do nothing if
- global_restricted is set.
-
- * tp/Texinfo/XS/parsetexi/Parsetexi.xs,
- * tp/Texinfo/XS/parsetexi/api.c (parser_set_restricted):
- New function. Call set_restricted.
-
- * tp/Texinfo/XS/parsetexi/Parsetexi.pm (simple_parser):
- Set 'restricted' flag.
- (parser): If 'restricted' flag is set, call parser_set_restricted.
-
- * tp/t/init_files_tests.t
- (macro_defined_txiinternalvalue_in_translation): Re-add test,
- to check what is done with this input and init file. From Patrice.
-
2023-11-27 Gavin Smith <gavinsmith0123@gmail.com>
* tp/Texinfo/ParserNonXS.pm (_new_macro),
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index d46f256d9c..6fb559e2e1 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -988,7 +988,6 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/init_files_tests/customize_translations/res_html \
t/results/init_files_tests/documentation_examples.pl \
t/results/init_files_tests/documentation_examples/res_html \
- t/results/init_files_tests/macro_defined_txiinternalvalue_in_translation.pl \
t/results/init_files_tests/modified_translation.pl \
t/results/init_files_tests/redefined_need.pl \
t/results/init_files_tests/sc_formatting_with_css.pl \
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
index 31fbd6875d..7e3d9fe23b 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
@@ -77,13 +77,6 @@ sub get_conf($$)
}
sub simple_parser {
- my $conf = shift;
-
- $new_conf = {'restricted' => 1};
- if ($conf) {
- %$new_conf = (%new_conf, %conf);
- }
-
goto &parser;
}
@@ -171,8 +164,6 @@ sub parser (;$$)
parser_set_locale_encoding ($utf8_bytes);
} elsif ($key eq 'accept_internalvalue' and $conf->{$key}) {
parser_set_accept_internalvalue(1);
- } elsif ($key eq 'restricted' and $conf->{'key'}) {
- parser_set_restricted(1);
} elsif ($key eq 'registrar' or $key eq 'COMMAND_LINE_ENCODING') {
# no action needed, only used in perl code
} else {
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.xs
b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
index 071b0f5380..dff91d6297 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.xs
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
@@ -153,6 +153,3 @@ parser_set_debug (int i)
void
parser_set_accept_internalvalue (int value)
-void
-parser_set_restricted (int value)
-
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 9e56790398..0e7c927c0d 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -267,9 +267,3 @@ parser_set_accept_internalvalue (int value)
{
set_accept_internalvalue (value);
}
-
-void
-parser_set_restricted (int value)
-{
- set_restricted(value);
-}
diff --git a/tp/Texinfo/XS/parsetexi/api.h b/tp/Texinfo/XS/parsetexi/api.h
index 7070cc02aa..8fabdbf08e 100644
--- a/tp/Texinfo/XS/parsetexi/api.h
+++ b/tp/Texinfo/XS/parsetexi/api.h
@@ -18,7 +18,6 @@ void parser_add_include_directory (char *filename);
void parser_add_expanded_format (char *format);
void parser_clear_expanded_formats (void);
void parser_set_accept_internalvalue (int value);
-void parser_set_restricted (int value);
void parser_set_DOC_ENCODING_FOR_INPUT_FILE_NAME (int i);
void parser_set_input_file_name_encoding (char *value);
void parser_set_locale_encoding (char *value);
diff --git a/tp/Texinfo/XS/parsetexi/macro.c b/tp/Texinfo/XS/parsetexi/macro.c
index c01e4bc248..5e2a4387ac 100644
--- a/tp/Texinfo/XS/parsetexi/macro.c
+++ b/tp/Texinfo/XS/parsetexi/macro.c
@@ -69,9 +69,6 @@ new_macro (char *name, ELEMENT *macro)
MACRO *m = 0;
size_t free_slot = 0;
- if (global_restricted)
- return;
-
/* Check for an existing definition first for us to overwrite. */
new = lookup_command (name);
if (new)
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index cdfd8559ee..b157937e58 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -312,7 +312,6 @@ char *global_clickstyle = 0;
char *global_documentlanguage = 0;
int global_documentlanguage_fixed = 0;
int global_accept_internalvalue = 0;
-int global_restricted = 0;
enum kbd_enum global_kbdinputstyle = kbd_distinct;
@@ -337,17 +336,11 @@ set_documentlanguage_override (char *value)
void
-set_accept_internalvalue (int value)
+set_accept_internalvalue(int value)
{
global_accept_internalvalue = value;
}
-void
-set_restricted (int value)
-{
- global_restricted = value;
-}
-
/* Record the information from a command of global effect. */
int
register_global_command (ELEMENT *current)
diff --git a/tp/Texinfo/XS/parsetexi/parser.h b/tp/Texinfo/XS/parsetexi/parser.h
index 568ea850f8..873305ed49 100644
--- a/tp/Texinfo/XS/parsetexi/parser.h
+++ b/tp/Texinfo/XS/parsetexi/parser.h
@@ -81,7 +81,6 @@ int parse_texi (ELEMENT *root_elt, ELEMENT *current_elt);
int parse_texi_document (void);
void set_documentlanguage_override (char *value);
void set_accept_internalvalue (int value);
-void set_restricted (int value);
void push_conditional_stack (enum command_id cond, SOURCE_MARK *source_mark);
CONDITIONAL_STACK_ITEM *pop_conditional_stack (void);
@@ -133,7 +132,6 @@ extern char *global_clickstyle;
extern char *global_documentlanguage;
extern int global_documentlanguage_fixed;
extern int global_accept_internalvalue;
-extern int global_restricted;
enum kbd_enum {kbd_none, kbd_code, kbd_example, kbd_distinct };
extern enum kbd_enum global_kbdinputstyle;
diff --git a/tp/t/init/translate_txiinternalvalue_macro.init
b/tp/t/init/translate_txiinternalvalue_macro.init
deleted file mode 100644
index 8269fd1a7f..0000000000
--- a/tp/t/init/translate_txiinternalvalue_macro.init
+++ /dev/null
@@ -1,30 +0,0 @@
-
-texinfo_register_command_formatting('sp', \&my_sp_formatting);
-
-sub my_sp_formatting($$$$$)
-{
- my $self = shift;
- my $cmdname = shift;
- my $command = shift;
- my $args = shift;
- my $content = shift;
-
- if (defined($command->{'extra'})
- and defined($command->{'extra'}->{'misc_args'})
- and defined($command->{'extra'}->{'misc_args'}->[0])) {
- my $sp_nr = $command->{'extra'}->{'misc_args'}->[0];
- my $translated_tree = $self->gdt('@macro txiinternalvalue
-user internalvalue
-@end macro
-{myarg} @TeX{}', {'myarg' => {'contents' => [{'text' => $sp_nr}]}});
- #print STDERR "T
".Texinfo::Common::debug_print_tree($translated_tree)."\n";
- $result = $self->convert_tree($translated_tree);
- return $result;
- }
-
- return &{$self->default_command_conversion($cmdname)}($self,
- $cmdname, $command, $args, $content);
-}
-
-
-1;
diff --git a/tp/t/init_files_tests.t b/tp/t/init_files_tests.t
index 3e4276abd5..0b1ae6e7e2 100644
--- a/tp/t/init_files_tests.t
+++ b/tp/t/init_files_tests.t
@@ -21,13 +21,6 @@ fr @error{}.
pt @error{}.
', {'init_files' => ['command_translation_modified.init']}],
-['macro_defined_txiinternalvalue_in_translation',
-'@sp 1
-
-@sp 2
-
-',{'init_files' => ['translate_txiinternalvalue_macro.init'],
-}],
);
my @file_tests = (
diff --git
a/tp/t/results/init_files_tests/macro_defined_txiinternalvalue_in_translation.pl
b/tp/t/results/init_files_tests/macro_defined_txiinternalvalue_in_translation.pl
deleted file mode 100644
index 8a984fe89a..0000000000
---
a/tp/t/results/init_files_tests/macro_defined_txiinternalvalue_in_translation.pl
+++ /dev/null
@@ -1,155 +0,0 @@
-use vars qw(%result_texis %result_texts %result_trees %result_errors
- %result_indices %result_sectioning %result_nodes %result_menus
- %result_floats %result_converted %result_converted_errors
- %result_elements %result_directions_text %result_indices_sort_strings);
-
-use utf8;
-
-$result_trees{'macro_defined_txiinternalvalue_in_translation'} = {
- 'contents' => [
- {
- 'contents' => [
- {
- 'args' => [
- {
- 'contents' => [
- {
- 'text' => '1'
- }
- ],
- 'info' => {
- 'spaces_after_argument' => {
- 'text' => '
-'
- }
- },
- 'type' => 'line_arg'
- }
- ],
- 'cmdname' => 'sp',
- 'extra' => {
- 'misc_args' => [
- '1'
- ]
- },
- 'info' => {
- 'spaces_before_argument' => {
- 'text' => ' '
- }
- },
- 'source_info' => {
- 'file_name' => '',
- 'line_nr' => 1,
- 'macro' => ''
- }
- },
- {
- 'text' => '
-',
- 'type' => 'empty_line'
- },
- {
- 'args' => [
- {
- 'contents' => [
- {
- 'text' => '2'
- }
- ],
- 'info' => {
- 'spaces_after_argument' => {
- 'text' => '
-'
- }
- },
- 'type' => 'line_arg'
- }
- ],
- 'cmdname' => 'sp',
- 'extra' => {
- 'misc_args' => [
- '2'
- ]
- },
- 'info' => {
- 'spaces_before_argument' => {
- 'text' => ' '
- }
- },
- 'source_info' => {
- 'file_name' => '',
- 'line_nr' => 3,
- 'macro' => ''
- }
- },
- {
- 'text' => '
-',
- 'type' => 'empty_line'
- }
- ],
- 'type' => 'before_node_section'
- }
- ],
- 'type' => 'document_root'
-};
-
-$result_texis{'macro_defined_txiinternalvalue_in_translation'} = '@sp 1
-
-@sp 2
-
-';
-
-
-$result_texts{'macro_defined_txiinternalvalue_in_translation'} = '
-
-
-
-
-';
-
-$result_errors{'macro_defined_txiinternalvalue_in_translation'} = [];
-
-
-$result_floats{'macro_defined_txiinternalvalue_in_translation'} = {};
-
-
-
-$result_converted{'html'}->{'macro_defined_txiinternalvalue_in_translation'} =
'<!DOCTYPE html>
-<html>
-<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Untitled Document</title>
-
-<meta name="description" content="Untitled Document">
-<meta name="keywords" content="Untitled Document">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="viewport" content="width=device-width,initial-scale=1">
-
-
-
-</head>
-
-<body lang="en">
-1 TeX
-2 TeX
-
-
-
-</body>
-</html>
-';
-
-$result_converted_errors{'html'}->{'macro_defined_txiinternalvalue_in_translation'}
= [
- {
- 'error_line' => 'warning: must specify a title with a title command or @top
-',
- 'text' => 'must specify a title with a title command or @top',
- 'type' => 'warning'
- }
-];
-
-
-1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Revert "* tp/Texinfo/XS/parsetexi/parser.c (set_restricted, global_restricted):",
Gavin D. Smith <=