Example #1
0
def p_assign_err(p):
    """
    void : expression ASSIGN
         | expression PLUS_EQUAL
         | expression MINUS_EQUAL
    """
    tell_error(p, 2, "The left-hand-side of :=/+=/-= must be a variable name, not an expression.")
    raise SyntaxError
Example #2
0
def p_expr_block_err(p):
    "block : '(' error ')'"
    tell_error(p, 0, "Block doesn't contain valid list of statements")
Example #3
0
def p_condition_err(p):
    "condition : '(' error ')'"
    tell_error(p, 0, "Condition should be a (single) expression.")
Example #4
0
def p_expr_err(p):
    "expression_list : expression error ','"
    tell_error(p, 0, "Error while parsing an expression.")
Example #5
0
def p_expr_string_err(p):
    "expression : error STRING"
    tell_error(p, 2, """Strings can't be used as expressions; they can only appear as part of $...="..." or $...+"...".""")