Post Reply 
problems in compilation of CAS programs
01-14-2017, 01:13 PM (This post was last modified: 02-06-2017 01:35 PM by compsystems.)
Post: #1
problems in compilation of CAS programs
Hello the following code has a syntax error

testCompiler file
PHP Code:
#cas
  
  
testCASCompiler():=
  
begin
    local expr1
;
    
expr1:=trig2exp(sin(x)); //
    
return expr1;
  
end;

  
// -> abc
  
return / 

  
testCASCompiler2():=
  
begin
    local expr1
;
    
expr1:=exp2trig(e^(2*x)); //
    
return expr1;
  
end;

#end 

instructions outside of the definitions testCASCompiler() & testCASCompiler2() are
Code:
  
  // -> abc
  return /

and the compiler tells me that there are no errors, but the functions testCASCompiler() & testCASCompiler2() does run (contradiction)
For future firmware versions: when compiling any statement between CAS functions definitions, should not be allowed. (Comments should only be allowed)

ERROR
PHP Code:
#cas
  
  
fnt1():=
  
begin
    local expr1
;
    ....
    return 
expr1;
  
end;

   -> 
abc
  
return /

  
fnt2():=
  
begin
    local expr2
;
    ....
    return 
expr2;
  
end;

#end

 
-> efg 

ok
PHP Code:
#cas
  
  
fnt1():=
  
begin
    local expr1
;
    ....
    return 
expr1;
  
end;

  
// -> abc
  //return /

  
fnt2():=
  
begin
    local expr2
;
    ....
    return 
expr2;
  
end;

#end

 //-> efg 


Now if you uncomment the line ( -> abc ) If an error is detected, but still runs testCASCompiler() & testCASCompiler2(), because it was previously stored in memory. In this case the compiled version testCASCompiler() & testCASCompiler2() must be deleted from memory If an error is found in the reedition
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
problems in compilation of CAS programs - compsystems - 01-14-2017 01:13 PM
RE: Compilation of CAS programs - parisse - 01-14-2017, 07:30 PM



User(s) browsing this thread: 1 Guest(s)