|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sat Apr 14, 2007 4:20 am
[1.27] Nested statements error |
This bug applies to #IF and #loopDB at the very least.
This works.
Code: |
#if (1=1)
{
#if (1=1)
{
#if (1=1) {#say Test}
}
} |
This does not work.
Code: |
#if (1=1)
{
#if (1=1)
{
#if (1=1)
{
#say Test
}
}
} |
Edit: The forum is eating tabs. I am using tabs for the indent depths. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Apr 14, 2007 4:26 am |
Try using the new Reformat Script command. You need to put the { at the end of the statements like this:
Code: |
#if (1=1) {
#if (1=1) {
#if (1=1) {#say Test}
}
} |
That's the correct multiline syntax. I'll see if I can make the other syntax work better in the future. You might try converting your indentation to just spaces so that I can really see exactly what you are trying to do. Your indentation in your second case is pretty erratic. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Apr 14, 2007 4:32 am |
Also, how were you getting tabs embedded in the first place? Are you using an external editor? The script editor in CMUD should be converting the tab key into spaces. The CMUD parser isn't set up to handle actual tab characters if you are pasting them in.
|
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sat Apr 14, 2007 4:36 am |
Hmm, I went back and did this with spaces and it worked properly.
Code: |
#if (1=1)
{
#if (1=1)
{
#if (1=1)
{
#say Test
}
}
} |
But the new editor does not appear to like using spaces for the indentation. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sat Apr 14, 2007 4:41 am |
Never mind. I just need to pay EXTRA attention to where I grab the leading {
I was leaving a space after the closing ) of the #if (1=1)
I THOUGHT it was a tab because of the way it acted when I pasted it in.
Edit AGAIN! and again. They are tabs. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Last edited by Arminas on Sat Apr 14, 2007 5:03 am; edited 1 time in total |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sat Apr 14, 2007 4:51 am |
It does not happen every time. I'm working on a way to reproduce this.
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sat Apr 14, 2007 5:01 am |
Ok, If you hit tab four times in the settings editor you get a tab. That must be how I was introducing them. The tabs must be the cause of the errors I was getting.
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Apr 18, 2007 1:09 am |
I've fixed v1.28 so that pressing the Tab key won't enter any tab characters. Pasting text with tab characters might still cause a problem and there doesn't appear to be any way to force the Scintilla editor not to accept pasted tabs. But at least pressing the Tab key will no longer insert tab characters.
|
|
|
|
|
|