Warning, /frameworks/syntax-highlighting/autotests/input/brightscript.brs is written in an unsupported language. File is not indexed.

0001 
0002 #i am macro
0003 
0004 library "a"
0005 
0006 function myfunc ( foo as Integer , bar as Float = 3.5 ) as Void
0007 end function
0008 
0009 sub mysub ( foo as Integer , bar as Float = 3.5 ) as Void
0010 end sub
0011 
0012 ' my comment
0013 
0014 Function MyCamelCaseFunction()
0015     lvalue = rvalue
0016 a=5
0017 a=5!
0018 a=5#
0019 a=5%
0020 a=5&
0021 
0022 a$=5
0023 a!=5
0024 a#=5
0025 a%=5
0026 a&=5
0027 
0028 a=a$
0029 a=a!
0030 a=a#
0031 a=a%
0032 a=a&
0033 
0034 foo()
0035 a.foo()
0036 a=a.foo()
0037 
0038 eval=5
0039 eval()
0040 a.eval()
0041 
0042 a=eval
0043 a=eval()
0044 a=a.eval()
0045 
0046 sleep=5
0047 sleep()
0048 a.sleep()
0049 
0050 a=sleep
0051 a=sleep()
0052 a=a.sleep()
0053 
0054 if a=b c=d
0055 if a foo()
0056 if a then foo()
0057 
0058 if a
0059 end if
0060 
0061 if a then
0062 end if
0063 
0064 if a
0065 else if
0066 else
0067 end if
0068 
0069 if a
0070 elseif
0071 endif
0072 
0073 for each a in b
0074 end for
0075 
0076 for a=1 to 10 step 2
0077 endFor
0078 
0079 for each a in b
0080 next
0081 
0082 while a
0083 end while
0084 
0085 while a
0086 endWhile
0087 
0088 a [ "a" , 1, foo() ] = 1
0089 a.foo()[1]=1
0090 
0091 a = {
0092     a : 1
0093     b : "2"
0094     c : function() : end function
0095 }
0096 
0097 b.foo("string",1,{a:b},1.5,[1,2,3])
0098 a = b.foo("string",1,{a:b},1.5,[1,2,3])
0099 
0100 unnamed_function = function ( a as Integer ) as Float
0101 
0102 a = +-b
0103 a = &h42abcdef
0104 c = var@attr
0105 end function
0106 
0107 unnamed_sub = sub ( a as Integer ) as Void
0108 end sub
0109 endFunction
0110 
0111 sub exceptions()
0112         try=1
0113         try()
0114         try.foo
0115         try foo
0116 
0117         catch=1
0118         catch()
0119         catch.foo
0120         catch foo
0121 
0122         try
0123         catch foo
0124         end try
0125 
0126         try ' comment
0127         endtry
0128 
0129         throw {a: "abc"}
0130 end sub
0131 
0132 sub inline_lambda()
0133         a(a, "string")(a, "string")
0134 
0135         a = sub()
0136         end sub(a, "string", [a, foo("string")])
0137 
0138         b = function()
0139         end function(a, "string")
0140 
0141         c = sub()
0142         end sub
0143 end sub