As documented at https://beancount.github.io/docs/beancount_language_syntax.html#transactions, Beancount supports basic arithmetic in postings, like
2014-10-05 * "Costco" "Shopping for birthday"
Liabilities:CreditCard:CapitalOne -45.00 USD
Assets:AccountsReceivable:John ((40.00/3) + 5) USD
Assets:AccountsReceivable:Michael 40.00/3 USD
Expenses:Shopping
However, the highlighter assigns a scope of invalid.illegal.unrecognized.beancount to these expressions.