summaryrefslogtreecommitdiffstats
path: root/parse.cxx
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-06-10 16:54:29 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-06-10 16:56:37 -0400
commitd57671d335d788aa3a738f7f284bfee30151c86c (patch)
treec5bafe2246fdb50a60b00a453abf936db2a92012 /parse.cxx
parent3f847830da8905e8d8d2a9f939c8c8274fc0f19b (diff)
downloadsystemtap-steved-d57671d335d788aa3a738f7f284bfee30151c86c.tar.gz
systemtap-steved-d57671d335d788aa3a738f7f284bfee30151c86c.tar.xz
systemtap-steved-d57671d335d788aa3a738f7f284bfee30151c86c.zip
PR6470: new argv[] tapset, docs, test cases
Diffstat (limited to 'parse.cxx')
-rw-r--r--parse.cxx22
1 files changed, 9 insertions, 13 deletions
diff --git a/parse.cxx b/parse.cxx
index f3cb7a86..59f3cb8a 100644
--- a/parse.cxx
+++ b/parse.cxx
@@ -350,7 +350,7 @@ parser::scan_pp (bool wildcard)
catch (const parse_error &e)
{
if (result) throw e; // propagate errors if THEN branch taken
- m = 0;
+ continue;
}
if (m && m->type == tok_operator && m->content == "%(") // nested %(
@@ -361,13 +361,11 @@ parser::scan_pp (bool wildcard)
if (nesting && m && m->type == tok_operator && m->content == "%)") // nested %)
nesting --;
- if (result && !m)
- throw parse_error ("unexpected end-of-file");
- if (result && m)
+ if (!m)
+ throw parse_error ("incomplete conditional - missing '%:' or '%)'", t);
+ if (result)
my_enqueued_pp.push_back (m);
- if (!result && !m)
- // do nothing; probably a parse error in an unkept THEN token
- if (!result && m)
+ if (!result)
delete m; // do nothing, just dispose of unkept THEN token
continue;
@@ -386,7 +384,7 @@ parser::scan_pp (bool wildcard)
catch (const parse_error& e)
{
if (!result) throw e; // propagate errors if ELSE branch taken
- m = 0;
+ continue;
}
if (m && m->type == tok_operator && m->content == "%(") // nested %(
@@ -396,13 +394,11 @@ parser::scan_pp (bool wildcard)
if (nesting && m && m->type == tok_operator && m->content == "%)") // nested %)
nesting --;
- if (!result && !m)
+ if (!m)
throw parse_error ("incomplete conditional - missing %)", t);
- if (!result && m)
+ if (!result)
my_enqueued_pp.push_back (m);
- if (result && !m)
- // do nothing; probably a parse error in an unkept ELSE token
- if (result && m)
+ if (result)
delete m; // do nothing, just dispose of unkept ELSE token
continue;