emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/sql-indent d3fe474a62 1/2: fix declare detection with l


From: ELPA Syncer
Subject: [elpa] externals/sql-indent d3fe474a62 1/2: fix declare detection with locals qualifier (#105)
Date: Thu, 28 Jul 2022 09:58:04 -0400 (EDT)

branch: externals/sql-indent
commit d3fe474a62221800b64f2ac053391a3615a91fde
Author: Jonas Jelten <jj@sft.lol>
Commit: GitHub <noreply@github.com>

    fix declare detection with locals qualifier (#105)
    
    this patch fixes declare statement detection when there's a
    `<<namespace>>` definition before it.
    
    ```sql
    create or replace function something_great() returns integer as $$
        <<locals>>
        declare
            group_id       grp.id%TYPE;
            transaction_id integer;
    begin
        select .....
    ```
    
    local variables in the function are then used with `locals.` as prefix,
    for example `locals.group_id`.
---
 sql-indent.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sql-indent.el b/sql-indent.el
index c8f8a72d98..1bf8fe265e 100644
--- a/sql-indent.el
+++ b/sql-indent.el
@@ -652,7 +652,7 @@ See also `sqlind-beginning-of-block'"
               (save-excursion
                 (sqlind-backward-syntactic-ws)
                 (skip-syntax-backward "_w") ; note that the $$ is symbol 
constituent!
-                (looking-at "\\(\\$\\$\\)\\|begin\\|then\\|else")))
+                (looking-at 
"\\(\\$\\$\\)\\|begin\\|then\\|else\\|\\(<<[a-z0-9_]+>>\\)")))
       (throw 'finished
         (if (null sqlind-end-stmt-stack)
             'declare-statement



reply via email to

[Prev in Thread] Current Thread [Next in Thread]