Re: EXACT meaning of 2 error messages

new topic     » goto parent     » topic index » view thread      » older message » newer message
eddo said...

OK - sorry for the delay - From what I understand, Euphoria is giving me a "type is expected here" error because it thinks its within the parameter list of a function declaration. Why it thought this, I have no idea, but it must have thought so, or it couldn't have been expecting a type. Right? Maybe if I move the declaration to a new spot in the source, I won't get the invalid error reported? Euphoria is also seeing my "sequence" declaration as a variable which it thinks I must make an assignment to because there's nothing else I could do to a variable at that location, but WHY is it seeing "sequence" as a variable? I would think that I must have some gross error in syntax or spelling before it. I must! But everything looks perfect. I'm telling you my thinking so you know how I'm attempting to "code around" the problem. I remember someone mentioning "rogue sequence sequence's as being something that could mess up Euphoria in making it think "screwy" so it could produce invalid error reports. But the code looks perfect! Is my thinking about what is going on in Euphoria's interpreter sort-of correct? When Euphoria gives the "expected assignment" error, why is it seeing the reserved word "sequence" as a variable? How could this happen? What could I try to try to make the problem go away?

Hi

sometimes only the Parser goes mad blink and sometimes the comma is far away from your code ....

enum alpha,beta,gamma,   -- remove the comma and it works !!!! 
sequence typo1 
 
function typo(sequence anything) 
	return anything 
end function 
 

C:\develop\HiEdit\typo.exw:4 
<0076>:: expected to see an assignment after 'typo1', such as =, +=, -=, *=, /= 
or &= 
function typo(sequence anything) 
        ^ 
 
 
Press Enter 

or this one

enum alpha,beta,gamma   
sequence typo1,		-- remove the comma and it works !!!! 
 
function typo(sequence anything) 
	return anything 
end function 

C:\develop\HiEdit\typo.exw:4 
<0025>:: found ... function ... but was expecting an identifier name 
function typo(sequence anything) 
        ^ 
 
 
Press Enter 

(and such errors also appear with other programming languages)
Example:

like this

program Hello; 
var 
integer : typo; // should look like typo : integer; 
begin 
  writeln ('Hello, world.'); 
end. 
C:\develop\HiEdit>fpc typo.pas 
Free Pascal Compiler version 2.6.4 [2014/03/06] for i386 
Copyright (c) 1993-2014 by Florian Klaempfl and others 
Target OS: Win32 for i386 
Compiling typo.pas 
typo.pas(4,15) Error: Identifier not found "typo" 
typo.pas(4,15) Error: Error in type definition 
typo.pas(7,4) Fatal: There were 2 errors compiling module, stopping 
Fatal: Compilation aborted 
Error: C:\FPC\2.6.4\bin\i386-Win32\ppc386.exe returned an error exitcode (normal 
 if you did not specify a source file to be compiled) 
 
C:\develop\HiEdit> 

Andreas

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu