Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
parseIfStatement example
$token
=
$this
->scanner->
getToken
(
)
;
if
(
!
$token
)
{
return
null;
}
$val
=
$token
->value;
if
(
$val
=== "{" &&
$statement
=
$this
->
parseBlock
(
)
)
{
return
$statement
;
}
elseif
(
$val
=== "var" &&
$statement
=
$this
->
parseVariableStatement
(
)
)
{
return
$statement
;
}
elseif
(
$val
=== ";" &&
$statement
=
$this
->
parseEmptyStatement
(
)
)
{
return
$statement
;
}
elseif
(
$val
=== "if" &&
$statement
=
$this
->
parseIfStatement
(
)
)
{
return
$statement
;
}
elseif
(
(
$val
=== "for" ||
$val
=== "while" ||
$val
=== "do" ||
$val
=== "switch"
)
&&
$statement
=
$this
->
parseBreakableStatement
(
)
)
{
return
$statement
;
}
elseif
(
$val
== "continue" &&
$statement
=
$this
->
parseContinueStatement
(
)
)
{
return
$statement
;
}
elseif
(
$val
=== "break" &&
$statement
=
$this
->
parseBreakStatement
(
)
)
{
return
$statement
;
}
elseif
(