Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ module.exports = grammar({
const operators = [
[prec, PREC.DEFINED, 'defined?'],
[prec.right, PREC.NOT, 'not'],
[prec.right, PREC.UNARY_MINUS, choice(alias($._unary_minus, '-'), '+')],
[prec.right, PREC.UNARY_MINUS, choice(alias($._unary_minus, '-'), alias($._binary_minus, '-'), '+')],
[prec.right, PREC.COMPLEMENT, choice('!', '~')]
];
return choice(...operators.map(([fn, precedence, operator]) => fn(precedence, seq(
Expand Down
9 changes: 9 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -5930,6 +5930,15 @@
"named": false,
"value": "-"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_binary_minus"
},
"named": false,
"value": "-"
},
{
"type": "STRING",
"value": "+"
Expand Down
Loading