UNPKG

rawsql-ts

Version:

[beta]High-performance SQL parser and AST analyzer written in TypeScript. Provides fast parsing and advanced transformation capabilities.

21 lines 834 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.JoinOnClauseParser = void 0; const Clause_1 = require("../models/Clause"); const ValueParser_1 = require("./ValueParser"); class JoinOnClauseParser { static tryParse(lexemes, index) { let idx = index; if (idx < lexemes.length && lexemes[idx].value === 'on') { idx++; // Skip 'on' keyword // Parse the condition expression const condition = ValueParser_1.ValueParser.parseFromLexeme(lexemes, idx); idx = condition.newIndex; const joinOn = new Clause_1.JoinOnClause(condition.value); return { value: joinOn, newIndex: idx }; } return null; } } exports.JoinOnClauseParser = JoinOnClauseParser; //# sourceMappingURL=JoinOnClauseParser.js.map