conditional-tag
Version:
Clean, easily readable conditional statements in template literals/strings for Node.js and browsers. Provides `if` / `elseif` / `else` and `switch` / `case` / `default` syntax options.
26 lines (19 loc) • 447 B
JavaScript
import { _always } from '#lib/syntax-always.js';
import makeDebug from 'debug';
const debug = makeDebug('condtag:always');
/**
* Parser class for the _always expression.
*
* @since 1.0
*/
export default class AlwaysSyntaxParser {
canHandle(expr) {
return (expr === _always);
}
handle(expr, status) {
status.beforeAlways = status.filterOut;
status.filterOut = false;
debug(`<always> found. %o`, status);
return false;
}
}