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
27b0e8c0
Commit
27b0e8c0
authored
23 years ago
by
Jan Wieck
Browse files
Options
Downloads
Patches
Plain Diff
Adding ELSIF support contributed by Klaus Reger.
Jan
parent
a9da3fed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pl/plpgsql/src/gram.y
+49
-2
49 additions, 2 deletions
src/pl/plpgsql/src/gram.y
src/pl/plpgsql/src/scan.l
+2
-1
2 additions, 1 deletion
src/pl/plpgsql/src/scan.l
with
51 additions
and
3 deletions
src/pl/plpgsql/src/gram.y
+
49
−
2
View file @
27b0e8c0
...
...
@@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.1
7
2001/0
4
/18 2
0:42:56 tgl
Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.1
8
2001/0
5
/18 2
1:16:59 wieck
Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
@@ -147,6 +147,7 @@ static PLpgSQL_expr *make_tupret_expr(PLpgSQL_row *row);
%token K_DIAGNOSTICS
%token K_DOTDOT
%token K_ELSE
%token K_ELSIF
%token K_END
%token K_EXCEPTION
%token K_EXECUTE
...
...
@@ -544,6 +545,7 @@ proc_stmts : proc_stmts proc_stmt
new->stmts[0] = (struct PLpgSQL_stmt *)$1;
$$ = new;
}
;
...
...
@@ -721,8 +723,53 @@ stmt_else :
memset(new, 0, sizeof(PLpgSQL_stmts));
$$ = new;
}
| K_ELSIF lno expr_until_then proc_sect stmt_else
{
/*
* Translate the structure: into:
*
* IF c1 THEN IF c1 THEN
* ... ...
* ELSIF c2 THEN ELSE
* IF c2 THEN
* ... ...
* ELSE ELSE
* ... ...
* END IF END IF
* END IF
*
*/
PLpgSQL_stmts *new;
PLpgSQL_stmt_if *new_if;
/* first create a new if-statement */
new_if = malloc(sizeof(PLpgSQL_stmt_if));
memset(new_if, 0, sizeof(PLpgSQL_stmt_if));
new_if->cmd_type = PLPGSQL_STMT_IF;
new_if->lineno = $2;
new_if->cond = $3;
new_if->true_body = $4;
new_if->false_body = $5;
/* this is a 'container' for the if-statement */
new = malloc(sizeof(PLpgSQL_stmts));
memset(new, 0, sizeof(PLpgSQL_stmts));
new->stmts_alloc = 64;
new->stmts_used = 1;
new->stmts = malloc(sizeof(PLpgSQL_stmt *) * new->stmts_alloc);
new->stmts[0] = (struct PLpgSQL_stmt *)new_if;
$$ = new;
}
| K_ELSE proc_sect
{ $$ = $2; }
{
$$ = $2;
}
;
stmt_loop : opt_label K_LOOP lno loop_body
...
...
This diff is collapsed.
Click to expand it.
src/pl/plpgsql/src/scan.l
+
2
−
1
View file @
27b0e8c0
...
...
@@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.1
0
2001/0
4
/18 2
0:42:56 tgl
Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.1
1
2001/0
5
/18 2
1:16:59 wieck
Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
@@ -99,6 +99,7 @@ declare { return K_DECLARE; }
default { return K_DEFAULT; }
diagnostics { return K_DIAGNOSTICS; }
else { return K_ELSE; }
elsif { return K_ELSIF; }
end { return K_END; }
exception { return K_EXCEPTION; }
execute { return K_EXECUTE; }
...
...
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