Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd37b816

Browse files
committed
Adopt a more compact, less error-prone notation for tab completion code.
Replace tests like else if (pg_strcasecmp(prev4_wd, "CREATE") == 0 && pg_strcasecmp(prev3_wd, "TRIGGER") == 0 && (pg_strcasecmp(prev_wd, "BEFORE") == 0 || pg_strcasecmp(prev_wd, "AFTER") == 0))with new notation like this: else if (TailMatches4("CREATE", "TRIGGER", MatchAny, "BEFORE|AFTER"))In addition, provide some macros COMPLETE_WITH_LISTn() to reduce the amountof clutter needed to specify a small number of predetermined completionalternatives.This makes the code substantially more compact: tab-complete.c gets over athousand lines shorter in this patch, despite the addition of a couple ofhundred lines of infrastructure for the new notations. The new way ofspecifying match rules seems a whole lot more readable and lesserror-prone, too.There's a lot more that could be done now to make matching faster and morereliable; for example I suspect that most of the TailMatches() rules shouldnow be Matches() rules. That would allow them to be skipped after a singleinteger comparison if there aren't the right number of words on the line,and it would reduce the risk of unintended matches. But for now, (mostly)refrain from reworking any match rules in favor of just converting whatwe've got into the new notation.Thomas Munro, reviewed by Michael Paquier, some adjustments by me
1 parent529fd74 commitd37b816

File tree

1 file changed

+822
-1962
lines changed

1 file changed

+822
-1962
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp