decaffeinate-parser
Version:
A better AST for CoffeeScript, inspired by CoffeeScriptRedux.
19 lines (18 loc) • 658 B
JavaScript
;
exports.__esModule = true;
var isPlusTokenBetweenRanges_1 = require("./isPlusTokenBetweenRanges");
/**
* Determine if the operator is a fake + operator for string interpolation.
*/
function isImplicitPlusOp(op, context) {
if (op.operator !== '+' || !op.second) {
return false;
}
var firstRange = context.getRange(op.first);
var secondRange = context.getRange(op.second);
if (!firstRange || !secondRange) {
throw new Error('Expected valid location data on plus operation.');
}
return !isPlusTokenBetweenRanges_1["default"](firstRange, secondRange, context);
}
exports["default"] = isImplicitPlusOp;