Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
e2fe8721
Commit
e2fe8721
authored
Sep 29, 2003
by
vva@eagle.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added fine error messages in scripts/fill_help_tables.sh
parent
a5cc38fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
10 deletions
+36
-10
scripts/fill_help_tables.sh
scripts/fill_help_tables.sh
+36
-10
No files found.
scripts/fill_help_tables.sh
View file @
e2fe8721
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
# @c example_for_help_topic <topic_name>
# @c example_for_help_topic <topic_name>
# @example
# @example
# ....
# ....
# @example
# @e
nd e
xample
#
#
#
#
# Original version by Victor Vagin <vva@mysql.com>
# Original version by Victor Vagin <vva@mysql.com>
...
@@ -44,13 +44,16 @@
...
@@ -44,13 +44,16 @@
use strict
;
use strict
;
use Getopt::Long
;
use Getopt::Long
;
my
$insert_portion_size
=
2
5
;
my
$insert_portion_size
=
1
5
;
my
$error_prefix
=
"
help parsing error
:"
;
my
$error_prefix
=
"
---- help parsing errors
:"
;
my
$path_to_lex_file
=
"../sql/lex.h"
;
my
$path_to_lex_file
=
"../sql/lex.h"
;
my
$verbose_option
=
0
;
my
$verbose_option
=
0
;
my
$help_option
=
0
;
my
$help_option
=
0
;
my
$cur_line
=
0
;
my
$count_errors
=
0
;
GetOptions
(
GetOptions
(
"help"
,
\$
help_option,
"help"
,
\$
help_option,
"verbose"
,
\$
verbose_option,
"verbose"
,
\$
verbose_option,
...
@@ -92,6 +95,17 @@ my %keywords;
...
@@ -92,6 +95,17 @@ my %keywords;
$categories
{
Contents
}
->
{
__parent_category__
}=
""
;
$categories
{
Contents
}
->
{
__parent_category__
}=
""
;
sub print_error
{
my
(
$text
)=
@_
;
if
(
$count_errors
==
0
)
{
print STDERR
"
$error_prefix
\n
"
;
}
print STDERR
"line
$cur_line
:
$text
"
;
$count_errors
++
;
}
sub add_topic_to_category
sub add_topic_to_category
{
{
my
(
$topic_name
)=
@_
;
my
(
$topic_name
)=
@_
;
...
@@ -104,7 +118,7 @@ sub add_topic_to_category
...
@@ -104,7 +118,7 @@ sub add_topic_to_category
my
$old_parent
=
$category
->
{
__parent_category__
}
;
my
$old_parent
=
$category
->
{
__parent_category__
}
;
if
(
$old_parent
ne
$current_parent_category
)
if
(
$old_parent
ne
$current_parent_category
)
{
{
print
STDERR
"
$error_prefix
wrong parent for
$current_category
\n
"
;
print
_error
"
wrong parent for
$current_category
\n
"
;
}
}
}
}
...
@@ -118,7 +132,7 @@ sub add_topic_to_category
...
@@ -118,7 +132,7 @@ sub add_topic_to_category
my
$old_category
=
$topics
{
$topic_name
}
->
{
category
}
;
my
$old_category
=
$topics
{
$topic_name
}
->
{
category
}
;
if
(
$old_category
ne
$category
)
if
(
$old_category
ne
$category
)
{
{
print
STDERR
"
$error_prefix
wrong category for
$topic_name
\n
"
;
print
_error
"
wrong category for
$topic_name
\n
"
;
}
}
}
}
...
@@ -133,7 +147,7 @@ sub add_example
...
@@ -133,7 +147,7 @@ sub add_example
if
(
exists
(
$topics
{
$topic_name
}
->
{
example
}))
if
(
exists
(
$topics
{
$topic_name
}
->
{
example
}))
{
{
print
STDERR
"
$error_prefix
double example for
$topic_name
\n
"
;
print
_error
"
double example for
$topic_name
\n
"
;
}
}
$topics
{
$topic_name
}
->
{
example
}=
$example
;
$topics
{
$topic_name
}
->
{
example
}=
$example
;
...
@@ -148,7 +162,7 @@ sub add_description
...
@@ -148,7 +162,7 @@ sub add_description
if
(
exists
(
$topics
{
$topic_name
}
->
{
description
}))
if
(
exists
(
$topics
{
$topic_name
}
->
{
description
}))
{
{
print
STDERR
"
$error_prefix
double description for
$topic_name
\n
"
;
print
_error
"
double description for
$topic_name
\n
"
;
}
}
$topics
{
$topic_name
}
->
{
description
}=
$description
;
$topics
{
$topic_name
}
->
{
description
}=
$description
;
add_topic_to_category
(
$topic_name
)
;
add_topic_to_category
(
$topic_name
)
;
...
@@ -164,7 +178,7 @@ sub add_keyword
...
@@ -164,7 +178,7 @@ sub add_keyword
push
(
@
{
$topics
{
$topic_name
}
->
{
keywords
}}
,
$keyword
)
;
push
(
@
{
$topics
{
$topic_name
}
->
{
keywords
}}
,
$keyword
)
;
if
(
exists
(
$keywords
{
$keyword
}
->
{
$topic_name
}))
if
(
exists
(
$keywords
{
$keyword
}
->
{
$topic_name
}))
{
{
print
STDERR
"
$error_prefix
double keyword
$keyword
for
$topic_name
\n
"
;
print
_error
"
double keyword
$keyword
for
$topic_name
\n
"
;
}
}
$keywords
{
$keyword
}
->
{
$topic_name
}=
$topics
{
$topic_name
}
;
$keywords
{
$keyword
}
->
{
$topic_name
}=
$topics
{
$topic_name
}
;
}
}
...
@@ -200,6 +214,8 @@ sub prepare_name
...
@@ -200,6 +214,8 @@ sub prepare_name
$a
=
~ s/
([
\+
-
=>
<
\/
%
*
!
<
>
\s
]
+
)
\(
((
\w
|
\s
)
+
)
\)
/
$1
/gxs
;
$a
=
~ s/
([
\+
-
=>
<
\/
%
*
!
<
>
\s
]
+
)
\(
((
\w
|
\s
)
+
)
\)
/
$1
/gxs
;
$a
=
~ s/
((
\w
|
\s
)
+
)
\(
(
.+
)
\)
/
$1
/gxs
;
$a
=
~ s/
((
\w
|
\s
)
+
)
\(
(
.+
)
\)
/
$1
/gxs
;
$a
=
~ s/
((
\s
)
+
)
$/
/g
;
return
$a
;
return
$a
;
}
}
...
@@ -278,12 +294,13 @@ sub parse_example
...
@@ -278,12 +294,13 @@ sub parse_example
while
(
<
>)
while
(
<
>)
{
{
$cur_line
++
;
last
if
(
$_
=
~/
\@
end example/
)
;
last
if
(
$_
=
~/
\@
end example/
)
;
$text
.
=
$_
;
$text
.
=
$_
;
}
}
$text
=
prepare_example
(
$text
)
;
$text
=
prepare_example
(
$text
)
;
$topic_name
=
prepare_name
(
$topic_name
)
;
add_example
(
$topic_name
,
$text
)
if
(
$topic_name
ne
""
)
;
add_example
(
$topic_name
,
$text
)
if
(
$topic_name
ne
""
)
;
}
}
...
@@ -319,11 +336,13 @@ sub parse_description
...
@@ -319,11 +336,13 @@ sub parse_description
while
(
<
>)
while
(
<
>)
{
{
$cur_line
++
;
last
if
(
$_
=
~/
\@
c end_description_for_help_topic/
)
;
last
if
(
$_
=
~/
\@
c end_description_for_help_topic/
)
;
$text
.
=
$_
;
$text
.
=
$_
;
}
}
$text
=
prepare_description
(
$text
)
;
$text
=
prepare_description
(
$text
)
;
$topic_name
=
prepare_name
(
$topic_name
)
;
add_description
(
$topic_name
,
$text
)
;
add_description
(
$topic_name
,
$text
)
;
}
}
...
@@ -354,6 +373,7 @@ while (<>)
...
@@ -354,6 +373,7 @@ while (<>)
parse_example
()
;
parse_example
()
;
parse_description
()
;
parse_description
()
;
parse_category
()
;
parse_category
()
;
$cur_line
++
;
}
}
# test results of parsing:
# test results of parsing:
...
@@ -542,3 +562,9 @@ if (scalar(@keywords_names))
...
@@ -542,3 +562,9 @@ if (scalar(@keywords_names))
}
}
printf
";
\n\n
"
;
printf
";
\n\n
"
;
}
}
if
(
$count_errors
)
{
print STDERR
"
$count_errors
errors !!!
\n
"
;
exit
1
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment