You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case of parse errors the Parser::parse() will throw Exception or UnexpectedTokenException depending on error type.
However, this is not enough to create meaningful diagnostics about the problem. For example a CSS document such as this
@foo (something=another))
{
bar { zoo:1; }
}
will cause parse() to throw \Exception with a message Unopened { where the real problem is an extra closing parenthesis before first '{'.
In best case, there would be much more exception classes for each specific parse error, but I think even adding a simple public method to Parser.php would improve things a lot:
/** * @return int byte offset for current parser position * In case the parse() throws an exception, this method can be * used to approximate the error location. */publicfunctiongetPosition()
{
return $this->iCurrentPosition;
}
The text was updated successfully, but these errors were encountered:
In case of parse errors the Parser::parse() will throw
Exception
orUnexpectedTokenException
depending on error type.However, this is not enough to create meaningful diagnostics about the problem. For example a CSS document such as this
will cause
parse()
to throw\Exception
with a messageUnopened {
where the real problem is an extra closing parenthesis before first '{'.In best case, there would be much more exception classes for each specific parse error, but I think even adding a simple public method to Parser.php would improve things a lot:
The text was updated successfully, but these errors were encountered: