Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
e7f47ed5
Commit
e7f47ed5
authored
23 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Pgindent fixes for Tom, mostly indenting problems.
parent
66e9ee79
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tools/pgindent/pgindent
+43
-0
43 additions, 0 deletions
src/tools/pgindent/pgindent
with
43 additions
and
0 deletions
src/tools/pgindent/pgindent
+
43
−
0
View file @
e7f47ed5
...
...
@@ -33,6 +33,11 @@ do
sed
's;\([} ]\)else[ ]*\(/\*.*\)$;\1else\
\2;g'
|
detab
-t4
-qc
|
# work around bug where function that defines no local variables misindents
# switch() case lines and line after #else
sed
's,^{$,{\
int pgindent_func_no_var_fix;\
,g'
|
# protect backslashes in DATA()
sed
's;^DATA(.*$;/*&*/;'
>
/tmp/
$$
a
...
...
@@ -1309,7 +1314,21 @@ do
# workaround indent bug
sed
's;^static[ ][ ]*;static ;g'
|
sed
's;^}[ ][ ]*/\*;} /*;'
|
# pull in #endif comments
sed
's;^#endif[ ][ ]*/\*;#endif /*;'
|
# add space after comments that start on tab stops
sed
's,;\(/\*.*\*/\)$,; \1,'
|
# work around #else indenting next line if #ifdef defines variables at top
# work around case misindenting function has no variables defined
awk
'
{
if ($0 ~ "^[ ]*int[ ]*pgindent_func_no_var_fix;")
{
if (getline && $0 != "")
print $0;
}
else print $0;
}'
|
detab
-t8
-qc
|
entab
-t4
-qc
|
# move trailing * in function return type
...
...
@@ -1373,6 +1392,30 @@ do
if (skips <= 2)
print line2;
}'
|
# remove blank line before #endif
awk
'
{
line2 = $0;
if (skips > 0)
skips--;
if (line1 ~ "^$" &&
line2 ~ "^#endif")
{
print line2;
line1 = "";
line2 = "";
skips = 2;
}
else
if (skips == 0 && NR >= 2)
print line1;
line1 = line2;
line2 = "";
}
END {
if (skips <= 1)
print line1;
}'
|
# Move prototype names to the same line as return type. Useful for ctags.
# Indent should do this, but it does not. It formats prototypes just
# like real functions.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment