bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error in php parsing


From: Shigio Yamaguchi
Subject: Re: Error in php parsing
Date: Sat, 04 Feb 2006 13:36:51 +0900

Hi,
I have fixed the bug, I believe.
Thank you for your bug report!

Index: gtags-parser/php.l
===================================================================
RCS file: /sources/global/global/gtags-parser/php.l,v
retrieving revision 1.8
diff -r1.8 php.l
3c3
<  * Copyright (c) 2003 Tama Communications Corporation
---
>  * Copyright (c) 2003, 2006 Tama Communications Corporation
68a69,70
> static char end_of_here_document[IDENTLEN+1];
> static int pre_here_document;
122c124
< %start        PHP STRING LITERAL
---
> %start        PHP STRING LITERAL HEREDOCUMENT
125c127,134
< \n                    ECHO;
---
> \n                    {
>                               ECHO;
>                               if (pre_here_document == 1) {
>                                       pre_here_document = 0;
>                                       debug_print("[BEGIN 
> HEREDOCUMENT:%s]\n", end_of_here_document);
>                                       BEGIN HEREDOCUMENT;
>                               }
>                       }
182a192,211
>  /* Here document */
> <PHP><<<{WORD}                {
>                               debug_print("<L:%s>", LEXTEXT);
>                               /* extract word and save */
>                               if (LEXLENG - 3 > IDENTLEN)
>                                       die("Too long name '%s'.", LEXTEXT + 3);
>                               strcpy(end_of_here_document, LEXTEXT + 3);
>                               /* begin here document from the next line */
>                               pre_here_document = 1;
>                       }
> <HEREDOCUMENT>^[ \t]*{WORD} {
>                               const char *keyword = strtrim((const char 
> *)LEXTEXT, TRIM_HEAD, NULL);
>                               ECHO;
>                               if (!strcmp(end_of_here_document, keyword)) {
>                                       debug_print("[END HEREDOCUMENT]");
>                                       end_of_here_document[0] = '\0';
>                                       BEGIN PHP;
>                               }
>                       }
> 
186c215
< <PHP,STRING>$\{{WORD}\}       {
---
> <PHP,STRING,HEREDOCUMENT>$\{{WORD}\} {
200c229
< <PHP,STRING>${WORD}   {
---
> <PHP,STRING,HEREDOCUMENT>${WORD} {
213a243,244
> <HEREDOCUMENT>.               ECHO;
> 
242c273
< <PHP>"<>"|"<<<"               ECHO;
---
> <PHP>"<>"             ECHO;
Index: htags/php.l
===================================================================
RCS file: /sources/global/global/htags/php.l,v
retrieving revision 1.17
diff -r1.17 php.l
3c3
<  * Copyright (c) 2002, 2004, 2005 Tama Communications Corporation
---
>  * Copyright (c) 2002, 2004, 2005, 2006 Tama Communications Corporation
54c54,55
< char end_of_here_document[IDENTLEN+1];
---
> static int pre_here_document;
> static char end_of_here_document[IDENTLEN+1];
103d103
<               put_string(LEXTEXT);
108c108,111
<               yy_push_state(HEREDOCUMENT);
---
>               put_string("<<<");
>               put_reserved_word(end_of_here_document);
>               /* begin here document from the next line */
>               pre_here_document = 1;
110,112c113,117
< <HEREDOCUMENT>^{WORD} {
<               ECHO;
<               if (!strcmp(end_of_here_document, LEXTEXT))
---
> <HEREDOCUMENT>^[ \t]*{WORD} {
>               const char *keyword = strtrim((const char *)LEXTEXT, TRIM_HEAD, 
> NULL);
>               put_reserved_word(LEXTEXT);
>               if (!strcmp(end_of_here_document, keyword)) {
>                       end_of_here_document[0] = '\0';
113a119
>               }
161,162c167,168
< <PHP,STRING>\${WORD}   |
< <PHP,STRING>\$\{{WORD}\} {
---
> <PHP,STRING,HEREDOCUMENT>\${WORD} |
> <PHP,STRING,HEREDOCUMENT>\$\{{WORD}\} {
212c218,224
< \n            DEFAULT_END_OF_LINE_ACTION
---
> \n            {
>                       DEFAULT_END_OF_LINE_ACTION
>                       if (pre_here_document == 1) {
>                               pre_here_document = 0;
>                               yy_push_state(HEREDOCUMENT);
>                       }
>               }
--
Shigio YAMAGUCHI <address@hidden> - Tama Communications Corporation
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]