Commit 586d85c
committed
Tokenizers/PHP: bug fix - empty block comment
This commit fixes an edge case tokenizer bug, where a - completely empty, not even whitespace - _block comment_, would be tokenized as a docblock.
Without this commit, the `/**/` code snippet was tokenized as:
```
8 | L07 | C 1 | CC 0 | ( 0) | T_DOC_COMMENT_OPEN_TAG | [ 4]: /**/
9 | L07 | C 5 | CC 0 | ( 0) | T_DOC_COMMENT_CLOSE_TAG | [ 0]:
```
With the fix applied, it will be tokenized as:
```
8 | L07 | C 1 | CC 0 | ( 0) | T_COMMENT | [ 4]: /**/
```1 parent 036907d commit 586d85c
File tree
3 files changed
+24
-1
lines changed- src/Tokenizers
- tests/Core/Tokenizer/Comment
3 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
789 | | - | |
| 789 | + | |
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
61 | 81 | | |
62 | 82 | | |
63 | 83 | | |
| |||
0 commit comments