grain
grain copied to clipboard
feat(compiler): Allow custom infix operators
Closes #1319
I'll use what I wrote in the docs as my PR description 🤓
Grain also allows the definition of custom infix operators. Custom operators in Grain must be prefixed by one of the operators in the table below. Its precedence is defined by its prefix.
In addition to these prefixes, the parser accepts the characters
$&*/+-=><^|!?%:.
for use in the names of custom operators.
It should be noted that
/*
and//
are disallowed as operators as they denote comments.