Skip to content

Commit

Permalink
Merge pull request #24 from rlaiola/whitespacefix
Browse files Browse the repository at this point in the history
Allow whitespaces in functions of value expressions
  • Loading branch information
rlaiola authored Apr 11, 2024
2 parents 27a6261 + 2c81544 commit bf90e55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/db/parser/parser_ra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { i18n } from 'calc2/i18n';
const pegParserRelalg = require('./grammar_ra.pegjs') as any;

export function parseRelalg(text: string, relationNames: string[] = []): relalgAst.rootRelalg {
// Remove any whitespace before '(' character
text = text.replace(/\s*\(/g, '(');

const ast = pegParserRelalg.parse(text, {
startRule: 'start',
relationNames: relationNames,
Expand Down
3 changes: 2 additions & 1 deletion src/db/relalg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ const pegParserSql = require('./parser/grammar_sql.pegjs') as any;
export function parseSQLSelect(text: string): sqlAst.rootSql {

return pegParserSql.parse(
text,
// Remove any whitespace before '(' character
text.replace(/\s*\(/g, '('),
{
startRule: 'start',
tracer: undefined,
Expand Down

0 comments on commit bf90e55

Please sign in to comment.