﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3715	Au3Stripper is unable to parse some ternary expressions	anonymous	Jos	"Sorry if there is a ticket already to this issue but I didn't find it.
Tested on newest SciTE4AutoIt (and downloading Au3Stripper separately).

The docs say... and I quote: ""Do not complain if using Au3Stripper prevented the script from working correctly"" but this seriously has to be a joke, if not you may as well close this ticket.

Anyway...

As the title says Au3Stripper doesn't work on badly formatted ternary operations.

What do I mean by ""badly""? Not using spaces after the : operator.

See these examples:

----

Example 1 - No error (see *_stripped.au3)
{{{
#AutoIt3Wrapper_Run_Au3Stripper=y

Local $a = 1
Local $b = 2
Local $c = 3

MsgBox(0, 0, $a ? $b : $c)

}}}
Example 1 - Stripped Code:
{{{
Local $a = 1
Local $b = 2
Local $c = 3
MsgBox(0, 0, $a ? $b : $c)

}}}
No errors during compilation.

----

Example 2 - Error (see *_stripped.au3)
{{{
#AutoIt3Wrapper_Run_Au3Stripper=y

Local $a = 1
Local $b = 2
Local $c = 3

MsgBox(0, 0, $a ? $b :$c)

}}}
Example 2 Stripped Code:
{{{
Local $a = 1
Local $b = 2
MsgBox(0, 0, $a ? $b :$c)

}}}
Error thrown:
{{{
warning: $c: possibly used before declaration.
error: $c: undeclared global variable.
}}}

Note that the interpreter doesn't mind this style (talking about the unstripped version) at all, it parses it without any hickups.

However, if you declare and define your variables like this (leaving out the MsgBox line to keep it short)
{{{
Local $a = 1, $b = 2, $c = 3
}}}
or this
{{{
Local $a = 1, $b = 2
$c = 3
}}}
it works with the stripper, but not if you add the scope to it:
{{{
Local $a = 1, $b = 2
Local $c = 3
}}}

----

Also there is another error which removes the : completely, but you need to apply parameters (I don't know if these are the ones necessary or if it works with some of them (doesn't work for none))

Original
{{{
#AutoIt3Wrapper_Run_Au3Stripper=y
#Au3Stripper_Parameters=/sf /sv /rm

Local $a = 1, $b = 2, $c = 3

MsgBox(0, 0, $a ? $b: $c)

}}}
Stripped
{{{
Local $0 = 1, $1 = 2, $2 = 3
MsgBox(0, 0, $0 ? $3 $2)

}}}

----

Repeting the first error with parameters:

First error (bad referencing this time)
{{{
#AutoIt3Wrapper_Run_Au3Stripper=y
#Au3Stripper_Parameters=/sf /sv /rm

Local $a = 1, $b = 2, $c = 3

MsgBox(0, 0, $a ? $b :$c)
}}}

{{{
Local $0 = 1, $1 = 2, $2 = 3
MsgBox(0, 0, $0 ? $1 :$c)
}}}
However this time (if you don't have a space after the :  ) you can't solve it with not using a scope. It still references the original variable whose name was replaced by the stripper with $3."	Bug	closed		Other	3.3.14.5	None	Fixed	Au3Stripper, ternary expressions	
