summaryrefslogtreecommitdiff
path: root/libsieve/sieve.l
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2002-11-12 16:27:47 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2002-11-12 16:27:47 +0000
commit2233fe22de4e6ff71d711b833cff595bd98b2b09 (patch)
tree16120b9787ed52f41dd868e26f70d88d988ed987 /libsieve/sieve.l
parent0ba30cb1092adadc9cfef3bb9217f13fe272f612 (diff)
downloadmailutils-2233fe22de4e6ff71d711b833cff595bd98b2b09.tar.gz
mailutils-2233fe22de4e6ff71d711b833cff595bd98b2b09.tar.bz2
Added basic code generation and debugging
Diffstat (limited to 'libsieve/sieve.l')
-rw-r--r--libsieve/sieve.l18
1 files changed, 13 insertions, 5 deletions
diff --git a/libsieve/sieve.l b/libsieve/sieve.l
index b9e18ee60..65bd2997d 100644
--- a/libsieve/sieve.l
+++ b/libsieve/sieve.l
@@ -282,8 +282,9 @@ int
pop_source ()
{
struct buffer_ctx *ctx;
-
- fclose (yyin);
+
+ if (yyin)
+ fclose (yyin);
#ifndef FLEX_SCANNER
lex_delete_buffer (current_buffer);
#endif
@@ -402,10 +403,17 @@ sieve_include ()
}
int
-sieve_open_source (const char *name)
+sieve_lex_begin (const char *name)
{
return push_source (name);
}
+
+void
+sieve_lex_finish ()
+{
+ while (pop_source () == 0)
+ ;
+}
int
number ()
@@ -434,7 +442,7 @@ number ()
int
string ()
{
- yylval.string = sieve_alloc (yyleng - 1);
+ yylval.string = sieve_palloc (&sieve_machine->memory_pool, yyleng - 1);
memcpy (yylval.string, yytext + 1, yyleng - 2);
yylval.string[yyleng - 2] = 0;
return STRING;
@@ -486,7 +494,7 @@ multiline_finish ()
}
/* Copy the contents */
- yylval.string = sieve_alloc (length + 1);
+ yylval.string = sieve_palloc (&sieve_machine->memory_pool, length + 1);
p = yylval.string;
for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
{

Return to:

Send suggestions and report system problems to the System administrator.