SQL folding question

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

SQL folding question

Post by akari »

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
PHP else Syntax
PHP else Syntax
result2.png (3.81 KiB) Viewed 9986 times
Oracle SQL
Oracle SQL
result1.png (4.36 KiB) Viewed 9986 times
PHP syntax
PHP syntax
result2.png (3.81 KiB) Viewed 9987 times
result2.png
result2.png (3.81 KiB) Viewed 9987 times
result2
result2
result2.png (3.81 KiB) Viewed 9988 times
User avatar
Rickard Johansson
Site Admin
Posts: 6575
Joined: 19 Jul 2006 14:29

Re: SQL folding question

Post by Rickard Johansson »

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=
akari
Posts: 24
Joined: 16 Aug 2013 09:07

Re: SQL folding question

Post by akari »

sorry that time I was busy and forget this case,
After I test still the same.
result
result
result.png (4.01 KiB) Viewed 9455 times
It is correct I put under the last line in the syx file?
sql syx file
sql syx file
syx file.png (37.53 KiB) Viewed 9455 times
User avatar
Rickard Johansson
Site Admin
Posts: 6575
Joined: 19 Jul 2006 14:29

Re: SQL folding question

Post by Rickard Johansson »

Try this instead:

Code: Select all

[Fold]
1_Id=if
1_Begin=
1_End=end if
1_EndBefore=\in|elsif|else
1_Section=
1_NoParentOfId=0
1_NotAlwaysEnded=0
1_ListItem=
2_Id=elsif
2_Begin=
2_End=end if
2_EndBefore=\in|elsif|else
2_Section=
2_NoParentOfId=0
2_NotAlwaysEnded=0
2_ListItem=
3_Id=else
3_Begin=
3_End=end if
3_EndBefore=\in
3_Section=
3_NoParentOfId=0
3_NotAlwaysEnded=0
3_ListItem=
Post Reply