-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathexponentiation.js
More file actions
28 lines (26 loc) · 870 Bytes
/
exponentiation.js
File metadata and controls
28 lines (26 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { doc } from 'prettier';
import { createBinaryOperationPrinter } from './printers/create-binary-operation-printer.js';
import { createIndentIfNecessaryBuilder } from './printers/create-indent-if-necessary-builder.js';
import { multiplication } from './multiplication.js';
import { addition } from './addition.js';
import { shift } from './shift.js';
import { bit } from './bit.js';
import { inequality } from './inequality.js';
import { equality } from './equality.js';
import { logical } from './logical.js';
const { group } = doc.builders;
export const exponentiation = {
match: (op) => op === '**',
print: createBinaryOperationPrinter(
() => (document) => group(document), // always group
createIndentIfNecessaryBuilder([
multiplication,
addition,
shift,
bit,
inequality,
equality,
logical
])
)
};