skip doc comments

This commit is contained in:
vadim 2017-12-01 09:24:27 +02:00
parent dd84ed90a6
commit 453f967228
4 changed files with 28 additions and 15 deletions

View File

@ -8552,20 +8552,17 @@ yyrule124: // \?\?
}
yyrule125: // (#|[/][/]){NEW_LINE}
{
lval.token = string(l.TokenBytes(nil))
return T_COMMENT // TODO: handle ?>
// lval.token = string(l.TokenBytes(nil)); return T_COMMENT; // TODO: handle ?>
goto yystate0
}
yyrule126: // [/][*][^*]*[*]+([^*/][^*]*[*]+)*[/]
{
lval.token = string(l.TokenBytes(nil))
return T_COMMENT // TODO: handle ?>
// lval.token = string(l.TokenBytes(nil)); return T_COMMENT; // TODO: handle ?>
goto yystate0
}
yyrule127: // [/][*][*][^*]*[*]+([^*/][^*]*[*]+)*[/]
{
lval.token = string(l.TokenBytes(nil))
return T_DOC_COMMENT // TODO: handle ?>
// lval.token = string(l.TokenBytes(nil)); return T_DOC_COMMENT; // TODO: handle ?>
goto yystate0
}
yyrule128: // '[^']*(\\')*'

View File

@ -335,9 +335,9 @@ NEW_LINE (\r|\n|\r\n)
<PHP>\<\< lval.token = string(l.TokenBytes(nil)); return T_SL
<PHP>\>\> lval.token = string(l.TokenBytes(nil)); return T_SR
<PHP>\?\? lval.token = string(l.TokenBytes(nil)); return T_COALESCE
<PHP>(#|[/][/]){NEW_LINE} lval.token = string(l.TokenBytes(nil)); return T_COMMENT; // TODO: handle ?>
<PHP>[/][*][^*]*[*]+([^*/][^*]*[*]+)*[/] lval.token = string(l.TokenBytes(nil)); return T_COMMENT; // TODO: handle ?>
<PHP>[/][*][*][^*]*[*]+([^*/][^*]*[*]+)*[/] lval.token = string(l.TokenBytes(nil)); return T_DOC_COMMENT; // TODO: handle ?>
<PHP>(#|[/][/]){NEW_LINE} // lval.token = string(l.TokenBytes(nil)); return T_COMMENT; // TODO: handle ?>
<PHP>[/][*][^*]*[*]+([^*/][^*]*[*]+)*[/] // lval.token = string(l.TokenBytes(nil)); return T_COMMENT; // TODO: handle ?>
<PHP>[/][*][*][^*]*[*]+([^*/][^*]*[*]+)*[/] // lval.token = string(l.TokenBytes(nil)); return T_DOC_COMMENT; // TODO: handle ?>
<PHP>'[^']*(\\')*' lval.token = string(l.TokenBytes(nil)); return T_CONSTANT_ENCAPSED_STRING
<PHP>{OPERATORS} lval.token = string(l.TokenBytes(nil)); return rune2Class(rune(l.TokenBytes(nil)[0]))

View File

@ -369,10 +369,18 @@ const yyErrCode = 2
const yyInitialStackSize = 16
//line parser.y:1286
const src = `<?php
$a = static function($a) use ($b) {
const src = `
<?php
};
namespace Test;
/**
* Class foo
*/
class foo
{
}
`
func main() {

View File

@ -1285,10 +1285,18 @@ isset_variable:
%%
const src = `<?php
$a = static function($a) use ($b) {
const src = `
<?php
};
namespace Test;
/**
* Class foo
*/
class foo
{
}
`
func main() {