Skip to content

Commit

Permalink
Allow binary expression as unary expr arg; 4band example
Browse files Browse the repository at this point in the history
  • Loading branch information
steeelydan committed Oct 1, 2023
1 parent 742ed21 commit 7dfcc8f
Show file tree
Hide file tree
Showing 13 changed files with 1,060 additions and 11 deletions.
4 changes: 2 additions & 2 deletions compiler/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@js2eel/compiler",
"version": "0.9.0",
"version": "0.9.1",
"description": "Write REAPER JSFX/EEL2 plugins in JavaScript",
"engines": {
"node": ">=18.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { identifier } from '../identifier/identifier.js';

import { binaryExpression } from '../binaryExpression/binaryExpression.js';
import { ALLOWED_Unary_OPERATORS } from '../../constants.js';

import type { UnaryExpression } from 'estree';
Expand Down Expand Up @@ -30,6 +31,13 @@ export const unaryExpression = (expression: UnaryExpression, instance: Js2EelCom

break;
}
case 'BinaryExpression': {
unarySrc += unaryOperator;

unarySrc += binaryExpression(expression.argument, instance);

break;
}
default: {
instance.error(
'TypeError',
Expand Down
Loading

0 comments on commit 7dfcc8f

Please sign in to comment.