Skip to content

Commit

Permalink
ternary op select formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
ivojawer committed Nov 24, 2023
1 parent bfaa906 commit e02a5c8
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/printer/print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,18 +376,7 @@ const formatInheritance: FormatterWithContext<Singleton | Class> = (context: Pri
// SEND FORMATTERS

const formatSend: FormatterWithContext<Send> = context => node => {
let formatter: FormatterWithContext<Send>

if(isInfixOperator(node)) {
formatter = formatInfixSend
} else if(
isPrefixOperator(node)
) {
formatter = formatPrefixSend
} else {
formatter = formatDotSend
}

const formatter = isInfixOperator(node) ? formatInfixSend : isPrefixOperator(node) ? formatPrefixSend : formatDotSend
return formatter(context)(node)
}

Expand Down

0 comments on commit e02a5c8

Please sign in to comment.