Skip to content

Commit

Permalink
Fix #1480
Browse files Browse the repository at this point in the history
(cherry picked from commit 02fde4f)
  • Loading branch information
sjinks committed Dec 1, 2013
1 parent 33d12a7 commit 0099786
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions ext/annotations/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void phannot_remove_comment_separators(zval *return_value, char *comment, int le

if (open_parentheses == 0) {

if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) {
if (isalnum(ch) || '_' == ch || '\\' == ch) {
smart_str_appendc(&processed_str, ch);
continue;
}
Expand All @@ -188,15 +188,11 @@ void phannot_remove_comment_separators(zval *return_value, char *comment, int le

if (ch == '(') {
open_parentheses++;
} else {
if (ch == ')') {
open_parentheses--;
} else {
if (ch == '\n') {
(*start_lines)++;
start_mode = 1;
}
}
} else if (ch == ')') {
open_parentheses--;
} else if (ch == '\n') {
(*start_lines)++;
start_mode = 1;
}

if (open_parentheses > 0) {
Expand Down
2 changes: 1 addition & 1 deletion ext/annotations/scanner.re
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int phannot_get_token(phannot_scanner_state *s, phannot_scanner_token *token) {
return 0;
}
IDENTIFIER = [\\]?[a-zA-Z\\\_][a-zA-Z0-9\_\\]*;
IDENTIFIER = ('\x5C'?[a-zA-Z_]([a-zA-Z0-9_]*)('\x5C'[a-zA-Z_]([a-zA-Z0-9_]*))*);
IDENTIFIER {
token->opcode = PHANNOT_T_IDENTIFIER;
token->value = estrndup(start, YYCURSOR - start);
Expand Down

0 comments on commit 0099786

Please sign in to comment.