SQL folding question

Discuss syntax highlighting or submit new syntax files.
Post Reply
akari
Posts: 10
Joined: 16 Aug 2013 09:07

SQL folding question

Post by akari » 02 May 2019 09:04

Hi,
I'm trying to add some logic to SQL syntax for oracle SQL.
I wish to fold the if else statement.

if
xx;
elsif
xx;
elsif
xx;
else
xx;
end if;

I try to write the fold syntax like:
1_Id=if
1_Begin=if
1_End=end if;
1_EndBefore=elsif
2_Id=elsif
2_Begin=elsif
2_End=elsif
2_EndBefore=elsif

it only can fold those if to elsif and elsif to elsif:

I try to refer the php one.
1_EndBefore=} elseif|} else
but seem like is not working.

by the way, i notice php syntax cant fold else statement, if the else statement the same line with the close bracket.
Attachments
result2.png
PHP else Syntax
result2.png (3.81 KiB) Viewed 146 times
result1.png
Oracle SQL
result1.png (4.36 KiB) Viewed 146 times
result2.png
PHP syntax
result2.png (3.81 KiB) Viewed 147 times
result2.png
result2.png (3.81 KiB) Viewed 147 times
result2.png
result2
result2.png (3.81 KiB) Viewed 148 times

User avatar
Rickard Johansson
Site Admin
Posts: 5736
Joined: 19 Jul 2006 14:29

Re: SQL folding question

Post by Rickard Johansson » 03 May 2019 13:19

Does this work better?

Code: Select all

1_Id=if
1_Begin=
1_End=end if
1_EndBefore=elseif|else
1_Section=
1_NoParentOfId=0
1_NotAlwaysEnded=0
1_ListItem=
2_Id=elseif
2_Begin=
2_End=end if
2_EndBefore=elseif|else
2_Section=
2_NoParentOfId=0
2_NotAlwaysEnded=0
2_ListItem=
3_Id=else
3_Begin=
3_End=end if
3_EndBefore=
3_Section=
3_NoParentOfId=0
3_NotAlwaysEnded=0
3_ListItem=

Post Reply