glayzzle / php-parser

:herb: NodeJS PHP Parser - extract AST or tokens
https://php-parser.glayzzle.com/
BSD 3-Clause "New" or "Revised" License
534 stars 71 forks source link

attribute start and end loc are the same, and source is undefined #1125

Open abdul-alhasany opened 1 year ago

abdul-alhasany commented 1 year ago

Hi Attribute node is showing the same loc for both start and end. Source is also undefined. For example this code:

<?php
#[Deprecated(
reason: 'since Symfony 5.2, use setPublic() instead',
replacement: '%class%->setPublic(!%parameter0%)'
)]
class Tag implements \JsonSerializable
{
}

produces this AST:

{
  source: undefined,
  start: { line: 5, column: 1, offset: 124 },
  end: { line: 5, column: 1, offset: 124 }
}