xp-framework / compiler

Compiles future PHP to today's PHP.
19 stars 0 forks source link

Line number inconsistent after multi-line doc comments #136

Closed thekid closed 2 years ago

thekid commented 2 years ago
/**
 * Documentation
 *
 * @see  https://example.com/
 */
class T {

}

This ends up positioning the class token 5 lines under the end of the doc comment.

thekid commented 2 years ago

Fix is to position the line correctly after emitting the comment.

$result->out->write($comment->declaration);
$result->line+= substr_count($comment->declaration, "\n");  // <-- This!
thekid commented 2 years ago

Fix released in https://github.com/xp-framework/compiler/releases/tag/v8.3.0