aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parser.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-11-09 00:26:55 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-11-09 00:26:55 +0000
commit39bd3fd1db6f3aa3764d4a1bebcd71c4e9c00281 (patch)
treea4a2c77350e2fe224ce8ec4f1c60ba910c938e35 /src/backend/parser/parser.c
parentfb60af4127c006cb2e945fc1ee461264988ca753 (diff)
downloadpostgresql-39bd3fd1db6f3aa3764d4a1bebcd71c4e9c00281.tar.gz
postgresql-39bd3fd1db6f3aa3764d4a1bebcd71c4e9c00281.zip
Modernize plpgsql's handling of parse locations, making it look a lot more
like the core parser's code. In particular, track locations at the character rather than line level during parsing, allowing many more parse-time error conditions to be reported with precise error pointers rather than just "near line N". Also, exploit the fact that we no longer need to substitute $N for variable references by making extracted SQL queries and expressions be exact copies of subranges of the function text, rather than having random whitespace changes within them. This makes it possible to directly map parse error positions from the core parser onto positions in the function text, which lets us report them without the previous kluge of showing the intermediate internal-query form. (Later it might be good to do that for core parse-analysis errors too, but this patch is just touching plpgsql's lexer/parser, not what happens at runtime.) In passing, make plpgsql's lexer use palloc not malloc. These changes make plpgsql's parse-time error reports noticeably nicer (as illustrated by the regression test changes), and will also simplify the planned removal of plpgsql's separate lexer by reducing the impedance mismatch between what it does and what the core lexer does.
Diffstat (limited to 'src/backend/parser/parser.c')
0 files changed, 0 insertions, 0 deletions