-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added var tracking for #if statements
- Loading branch information
1 parent
b3181a8
commit 5f98714
Showing
3 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
test/project1/source/assign-all-paths-conditional-compilation.brs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
function assignPathsCC() as dynamic | ||
#if true | ||
a = 1 | ||
#else | ||
a = 2 | ||
#end if | ||
return a ' no error | ||
end function | ||
|
||
|
||
function assignPathsCC1() as dynamic | ||
#if true | ||
a = 1 | ||
#end if | ||
return a ' not really an error because #else block will never be run, but displays one anyway. Maybe fix this | ||
end function | ||
|
||
|
||
function assignPathsCC2() as dynamic | ||
#if SOME_VAR | ||
a = 1 | ||
#end if | ||
return a ' error | ||
end function | ||
|
||
|
||
function assignPathsCC3() as dynamic | ||
#if SOME_VAR | ||
a = 1 | ||
#else | ||
a = 2 | ||
#end if | ||
return a ' no error | ||
end function | ||
|
||
function assignPathsCC4() as dynamic | ||
#if SOME_VAR | ||
b = 1 | ||
#else | ||
a = 2 | ||
#end if | ||
return a ' error | ||
end function | ||
|
||
|
||
function assignPathsCC5() as dynamic | ||
#if SOME_VAR | ||
a = 1 | ||
#else if SOME_VAR2 | ||
a = 2 | ||
#else | ||
a = 3 | ||
#end if | ||
return a ' No error | ||
end function | ||
|
||
function assignPathsCC6() as dynamic | ||
#if SOME_VAR | ||
a = 1 | ||
#else if SOME_VAR2 | ||
a = 2 | ||
#else | ||
' missing assignment | ||
#end if | ||
return a ' error | ||
end function | ||
|
||
function assignPathsCC7() as dynamic | ||
#if SOME_VAR | ||
a = 1 | ||
#else if SOME_VAR2 | ||
' missing assignment | ||
#else | ||
a = 2 | ||
#end if | ||
return a ' error | ||
end function |