Advertisement
lily09290110

compiler_test

May 21st, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 1.43 KB | None | 0 0
  1. var a0[5] int
  2. var a1[5] string
  3. var a2[5] bool
  4. var a6 string = "S6"
  5. var b0 int = 3
  6. var b1 real = 3.3
  7. var b2 string = "S3"
  8. const c0 = "test"
  9. const c1 = 1
  10. const c2 = c1
  11. const c3 = 2
  12. //c0=5 //to test the const assigment
  13. //a0[3]=c0 //test the type is error
  14. //a0[5]=1 //test outside the func can't use the statement
  15.  
  16. func int lala(){
  17.     var a4 real = (3+3.6+7.8)*2/4
  18.     //var a5 real = (3+3.6+7.8)*2/0  //test the mod zero
  19.     a0[3]=c2//test assigment
  20.     a1[3]=c0
  21.     b0=a0[5]
  22.     b1=3+3.3
  23.     b2=c0
  24. }
  25. func string lala2(a5 int,a4 int,a2 int){
  26.     a0[4]=c2//check can see the const
  27.     var a6 int = 5//redefine a6 to test m1=a6
  28.     //var a2 real =3.5 //this will error by a2 int(redefine)
  29.     //a2=a4
  30.     a6=a2// if you catch the goble a2 than it is error
  31. }
  32.  
  33. func void main(){
  34.     {
  35.         var a6 bool = !(false&true)//redefine a6 to test m1=a6
  36.         //var main bool = true
  37.         var a7 bool = !(c2>b0)
  38.         a6=a2[0]
  39.     }
  40.     var m1 string =c0//trace you can assigment the const Var
  41.     m1=a6// trace you can assces var a6 string = "S6"
  42.     a6=lala2((a0[1]+1)*2,a0[2]+c2,a0[3]+b0)//return the func
  43.     go lala()
  44.     //a6 = go lala() //no return
  45.     var test int = 4
  46.     //a0=0 //a0 is a array can't assigment a int
  47.     for(a0[3]=0;b0>2;b0=b0+1){
  48.         var test int = 5//test the for and scope
  49.         b0=c2//check the value or type is change by b0=a0[5]
  50.     }
  51.     print test
  52.     println test+3.5
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement