aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-10-02 02:02:58 +1000
committerGravatar axel <axel@liljencrantz.se>2006-10-02 02:02:58 +1000
commit15724d079801df9183d0d86cadfbb7dec5b2821b (patch)
treef971d85d58390e28fd4e0429badcca584381709b /parser.c
parent2839f5e567e21a15850c3adfa2cc3cd1d7372ea9 (diff)
First stab at multiline editing
darcs-hash:20061001160258-ac50b-1a760913e64b96e30ff321d7fbe4069ca161cdfe.gz
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/parser.c b/parser.c
index e62c2847..ba230869 100644
--- a/parser.c
+++ b/parser.c
@@ -2996,7 +2996,8 @@ int parser_test( const wchar_t * buff,
int previous_pos=current_tokenizer_pos;
static int block_pos[BLOCK_MAX_COUNT];
static int block_type[BLOCK_MAX_COUNT];
-
+ int res;
+
/*
Set to 1 if the current command is inside a pipeline
*/
@@ -3037,7 +3038,7 @@ int parser_test( const wchar_t * buff,
current_tokenizer = &tok;
for( tok_init( &tok, buff, 0 );
- tok_has_next( &tok );
+ ;
tok_next( &tok ) )
{
current_tokenizer_pos = tok_get_pos( &tok );
@@ -3666,6 +3667,8 @@ int parser_test( const wchar_t * buff,
}
+ if( !tok_has_next( &tok ) )
+ break;
}
@@ -3709,14 +3712,20 @@ int parser_test( const wchar_t * buff,
tok_destroy( &tok );
-
current_tokenizer=previous_tokenizer;
current_tokenizer_pos = previous_pos;
-
+
error_code=0;
-
+
halloc_free( context );
-
- return err | ((count!=0)<<1);
+
+ res = 0;
+ if( err )
+ res |= PARSER_TEST_ERROR;
+ if( count!= 0 )
+ res |= PARSER_TEST_INCOMPLETE;
+
+ return res;
+
}