Syntax error: ... unexpected

Maple's parser came to the point in your input where it has now put the cursor and discovered an error: the thing it indicates is "unexpected" can not occur here in a correct Maple statement. However, the actual error might well be much earlier in the statement.

The most common cause of this error is unbalanced parentheses. Each ( , { or [ needs a corresponding ) , } or ] respectively. If there is a ( with no matching ) after it, you get a syntax error at the end of your statement, or at a } or ] that has no match after the ( . If there is a ) with no matching ( before it, you get a syntax error at that ) . If your expression is so complicated and has so many parentheses that it's hard to spot the error, you might try building it up in several steps rather than all at once. This can also improve the readability and clarity of your work.

You can check your input line for syntax errors without attempting to execute it by clicking the check-mark button on the context bar.

Examples:

> [ f(a + b, c ];

Syntax error, `]` unexpected

> f(a + b));

Syntax error, `)` unexpected

See also: context bar

Maple Advisor Database R. Israel, 1997