diff options
author | Demi Obenour <demiobenour@gmail.com> | 2016-09-27 10:54:16 -0400 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2016-10-05 19:25:56 -0400 |
commit | 9d3ddf572e3744e4cf5e9788b676f423fe69aee8 (patch) | |
tree | 1a9ae51e2be904714c0afdae5dbad00c81ccf300 /tests/pthread.l | |
parent | 735ffb6a653552831321acaa0e7d0a834a210a84 (diff) |
Fix M4 quoting of section 3.
This fixes M4 quoting of section 3 of the input file, including escape
sequences and character constants.
Tests were added to verify the behavior in section 3 with respect to
quoting. Both escaping of quotes and quoting of potential macro-start
characters are tested. Existing tests were also fixed to account for the new -- and now correct -- behavior. Many tests relied on the old behavior of expanding M4 macros
in section 3. They needed to be updated for the new behavior.
Diffstat (limited to 'tests/pthread.l')
-rw-r--r-- | tests/pthread.l | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/pthread.l b/tests/pthread.l index 7d0dc7f..3f449d2 100644 --- a/tests/pthread.l +++ b/tests/pthread.l @@ -78,14 +78,14 @@ static int process_text(char* s, yyscan_t scanner); <INITIAL,STATE_1,STATE_2>[[:space:]\r\n]+ { } %% -int yywrap( yyscan_t scanner) { +int testwrap( yyscan_t scanner) { (void)scanner; return 1; } static int process_text(char* s, yyscan_t scanner) { (void)scanner; - return (int)(*s) + (int) *(s + yyget_leng(scanner)-1); + return (int)(*s) + (int) *(s + testget_leng(scanner)-1); } int main(int ARGC, char *ARGV[]); @@ -136,19 +136,19 @@ static void * thread_func ( void* arg ) pthread_mutex_lock ( &file_locks[ next ] ); - yylex_init( &scanner ); + testlex_init( &scanner ); /*printf("Scanning file %s #%d\n",filenames[next],i); fflush(stdout); */ if((fp = fopen(filenames[next],"r"))==NULL) { perror("fopen"); return NULL; } - yyset_in(fp,scanner); + testset_in(fp,scanner); - while( yylex( scanner) != 0) + while( testlex( scanner) != 0) { } fclose(fp); - yylex_destroy(scanner); + testlex_destroy(scanner); pthread_mutex_unlock ( &file_locks[ next ] ); } return NULL; |