@@ -2281,22 +2281,35 @@ class FLYGenerator extends AbstractGenerator {
22812281 return " Double"
22822282 } else if (exp instanceof VariableLiteral ) {
22832283 val variable = exp. variable
2284- if (variable. typeobject. equals(" dat" )) {
2285- return " Table"
2286- } else if (variable. typeobject. equals(" channel" )) {
2287- return " Channel"
2288- } else if (variable. typeobject. equals(" var" )) {
2289- if (variable. right instanceof DeclarationObject ) {
2290-
2291- } else if (variable. right instanceof NameObjectDef ) {
2292- return " HashMap"
2293- } else if (variable. right instanceof ArithmeticExpression ) {
2294- return valuateArithmeticExpression(variable. right as ArithmeticExpression , scope)
2295- }else {
2296- return typeSystem. get(scope). get(variable. name) // if it's a parameter of a FunctionDefinition
2284+ if (variable. typeobject. equals(" var" )) {
2285+ if (variable. right instanceof DeclarationObject ) {
2286+ var type = (variable. right as DeclarationObject ). features. get(0 ). value_s
2287+ switch (type) {
2288+ case " DataFrame" : {
2289+ return " Table"
2290+ }
2291+ case " channel" : {
2292+ return " channel"
2293+ }
2294+ case " random" : {
2295+ return " Random"
2296+ }
2297+ case " File" : {
2298+ return " File"
2299+ }
2300+ default: {
2301+ return " variable"
2302+ }
22972303 }
2304+ } else if (variable. right instanceof NameObjectDef ) {
2305+ return " HashMap"
2306+ } else if (variable. right instanceof ArithmeticExpression ) {
2307+ return valuateArithmeticExpression(variable. right as ArithmeticExpression , scope)
2308+ }else {
2309+ return typeSystem. get(scope). get(variable. name) // if it's a parameter of a FunctionDefinition
22982310 }
2299- return " variable"
2311+ }
2312+ return " variable"
23002313 } else if (exp instanceof NameObject ) {
23012314 return typeSystem. get(scope). get(exp. name. name + " ." + exp. value)
23022315 } else if (exp instanceof IndexObject ) {
@@ -2378,7 +2391,18 @@ class FLYGenerator extends AbstractGenerator {
23782391 return " Long"
23792392 }else if (exp instanceof VariableFunction ) {
23802393 if (exp. target. typeobject. equals(" var" )) {
2381- if (exp. feature. equals(" split" )) {
2394+ if (exp. target. right instanceof DeclarationObject ){
2395+ var type = (exp. target. right as DeclarationObject ). features. get(0 ). value_s
2396+ if (type. equals(" random" )){
2397+ if (exp. feature. equals(" nextBoolean" )) {
2398+ return " Boolean"
2399+ } else if (exp. feature. equals(" nextDouble" )) {
2400+ return " Double"
2401+ } else if (exp. feature. equals(" nextInt" )) {
2402+ return " Integer"
2403+ }
2404+ }
2405+ } else if (exp. feature. equals(" split" )) {
23822406 return " HashMap"
23832407 } else if (exp. feature. contains(" indexOf" ) || exp. feature. equals(" length" )) {
23842408 return " Integer"
@@ -2390,14 +2414,6 @@ class FLYGenerator extends AbstractGenerator {
23902414 }else {
23912415 return " Boolean"
23922416 }
2393- } else if (exp. target. typeobject. equals(" random" )) {
2394- if (exp. feature. equals(" nextBoolean" )) {
2395- return " Boolean"
2396- } else if (exp. feature. equals(" nextDouble" )) {
2397- return " Double"
2398- } else if (exp. feature. equals(" nextInt" )) {
2399- return " Integer"
2400- }
24012417 }
24022418 } else {
24032419 return " Object"
0 commit comments