From 652625fc81ef9f373c7f86e707e1f630d35881c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Laiola=20Guimar=C3=A3es?= Date: Thu, 11 Apr 2024 07:57:45 -0300 Subject: [PATCH 1/2] Update parser_ra.ts --- src/db/parser/parser_ra.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/db/parser/parser_ra.ts b/src/db/parser/parser_ra.ts index 318a260fe..f7775d07c 100644 --- a/src/db/parser/parser_ra.ts +++ b/src/db/parser/parser_ra.ts @@ -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, From 2c815445a4ed95c3854636481e2ebb161adf8ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Laiola=20Guimar=C3=A3es?= Date: Thu, 11 Apr 2024 08:36:48 -0300 Subject: [PATCH 2/2] Update relalg.ts --- src/db/relalg.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db/relalg.ts b/src/db/relalg.ts index 3ac5a684d..6f2cd8e6e 100644 --- a/src/db/relalg.ts +++ b/src/db/relalg.ts @@ -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,