Skip to content

Commit 3859fde

Browse files
h3n4lclaude
andcommitted
refactor(postgresql): remove non-standard builtin_function_name tokens
Align with PostgreSQL's official grammar and ANTLR community standard by removing built-in function name tokens from the lexer. These function names (exp, div, floor, mod, power, sqrt, log, etc.) are now properly treated as regular identifiers, matching PostgreSQL's behavior. Changes: - Remove ~475 built-in function tokens from PostgreSQLLexer.g4 (ABS, CBRT, CEIL, EXP, DIV, FLOOR, MOD, POWER, SQRT, etc.) - Remove builtin_function_name parser rule from PostgreSQLParser.g4 - Update parser rules: param_name, func_type, generictype, func_name - Add LOG to plsql_unreserved_keyword (was missing, caused test failures) - Add .vscode/ to .gitignore Benefits: - Matches PostgreSQL's official grammar behavior - Aligns with ANTLR grammars-v4 community standard - Simpler, more maintainable grammar - Function names can naturally be used as identifiers Test Results: - All target tests pass: exp, div, floor, mod, power, sqrt, log - No new regressions in full test suite 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent c6b602f commit 3859fde

10 files changed

+16630
-19020
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ go.work.sum
4747
**/*.class
4848

4949
# No binary files
50-
**/bin/**
50+
**/bin/**.vscode/

postgresql/PostgreSQLKeywords.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// Source: PostgreSQL REL_18_STABLE kwlist.h
66
// URL: https://raw.githubusercontent.com/postgres/postgres/REL_18_STABLE/src/include/parser/kwlist.h
7-
// Generated: 2025-11-13T15:59:19+08:00
7+
// Generated: 2025-11-13T16:51:25+08:00
88
//
99
// DO NOT EDIT MANUALLY - This file is generated by keyword-generator
1010
// To regenerate: cd postgresql && make generate-keywords

0 commit comments

Comments
 (0)