mirror of
https://github.com/python/cpython.git
synced 2025-07-25 20:24:11 +00:00
Revise the markup related to the grammar productions to increase the
level of predictability. This is not really "good" markup, but is arguably better than we had before. This closes SF bug #523117.
This commit is contained in:
parent
7fe80a1085
commit
5381588073
7 changed files with 95 additions and 98 deletions
|
@ -807,6 +807,18 @@ sub do_cmd_production{
|
|||
. $_);
|
||||
}
|
||||
|
||||
sub do_cmd_productioncont{
|
||||
local($_) = @_;
|
||||
my $defn = next_argument();
|
||||
return ("<tr valign=\"baseline\">\n"
|
||||
. " <td> </td>\n"
|
||||
. " <td> </td>\n"
|
||||
. " <td><code>"
|
||||
. translate_commands($defn)
|
||||
. "</code></td></tr>"
|
||||
. $_);
|
||||
}
|
||||
|
||||
sub process_grammar_files{
|
||||
my $lang;
|
||||
my $filename;
|
||||
|
@ -847,6 +859,7 @@ sub process_grammar_files{
|
|||
|
||||
sub strip_grammar_markup{
|
||||
local($_) = @_;
|
||||
s/\\productioncont/ /g;
|
||||
s/\\production(<<\d+>>)(.+)\1/\n\2 ::= /g;
|
||||
s/\\token(<<\d+>>)(.+)\1/\2/g;
|
||||
s/\\e([^a-zA-Z])/\\\1/g;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue