Remove useless logic in parsers.
@@ -117,10 +117,6 @@ func (p *Parser) parseParameters() []ast.Expression {
func (p *Parser) parseClassStatement() *ast.ClassStatement {
stmt := &ast.ClassStatement{BaseNode: &ast.BaseNode{Token: p.curToken}}
- if !(p.fsm.Is(parsingFuncCall) || p.fsm.Is(parsingAssignment)) {
- stmt.MarkAsStmt()
- }
-
if !p.expectPeek(token.Constant) {
return nil
}
@@ -212,16 +208,6 @@ func (p *Parser) parseBlockStatement() *ast.BlockStatement {
p.nextToken()
}
- if len(bs.Statements) < 1 {
- return bs
- }
-
- stmt := bs.Statements[len(bs.Statements)-1]
-
- if expStmt, ok := stmt.(*ast.ExpressionStatement); ok {
- expStmt.Expression.IsExp()
- }
-
return bs
}
