Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
preLeftParsing example
$this
->lexer =
$lexer
;
}
public
function
parse
(
string
$str
)
: Result
{
$this
->lexer->
setInput
(
$str
)
;
if
(
$this
->lexer->
hasInvalidTokens
(
)
)
{
return
new
InvalidEmail
(
new
ExpectingATEXT
(
"Invalid tokens found"
)
,
$this
->lexer->current->value
)
;
}
$preParsingResult
=
$this
->
preLeftParsing
(
)
;
if
(
$preParsingResult
->
isInvalid
(
)
)
{
return
$preParsingResult
;
}
$localPartResult
=
$this
->
parseLeftFromAt
(
)
;
if
(
$localPartResult
->
isInvalid
(
)
)
{
return
$localPartResult
;
}
$domainPartResult
=
$this
->
parseRightFromAt
(
)
;