Forced the exlamation mark as a postfix operator

This commit is contained in:
Celestino Amoroso 2024-12-26 08:57:14 +01:00
parent 4725145d1c
commit 0e55f83d56

View File

@ -441,6 +441,9 @@ func (parser *parser) parseGeneral(scanner *scanner, ctx parserContext, termSymb
tk.Sym = SymChangeSign
} else if tk.Sym == SymPlus {
tk.Sym = SymUnchangeSign
} else if tk.IsSymbol(SymExclamation) {
err = tk.Errorf("postfix opertor %q requires an operand on its left", tk)
break
}
firstToken = false
}