1. Phix : tip

Self explanatory, I hope

--Test commenting differences between Phix and Eu 
--Ignored by Phix, included by Eu 
--/* 
include std/console.e 
--*/ 
 
integer WITH_PHIX = 0, WITH_EU = 0 
object VOID 
 
 
--Block comments  
/*  
puts(1, "Neither Eu nor Phix execute this\n")  
*/  
 
--/*  
puts(1, "Eu prints this, Phix does not\n")  
--*/  
 
--/**/puts(1, "Phix prints this, Eu does not\n")   
 
--/**/ puts(1, "Runs with Phix\n")  --/*     
       puts(1, "Runs with Eu\n")    --*/ 
     
     
--/**/  WITH_PHIX = 1 WITH_EU = 0   --/* 
        WITH_PHIX = 0 WITH_EU = 1   --*/ 
         
if WITH_PHIX then 
    puts(1, "Running under Phix\n") 
end if 
if WITH_EU then 
    puts(1, "Running under Eu\n") 
end if   
 
VOID = wait_key() 
 
new topic     » topic index » view message » categorize

2. Re: Phix : tip

This makes my head hurt. Can't we just have ifdef PHIX instead?

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: Phix : tip

Slightly clearer

--Block comments 
/* 
puts(1, "Neither Eu nor Phix execute this\n") 
*/ 
 
--/* 
puts(1, "Eu prints this, Phix does not\n") 
--*/ 
 
--/**/puts(1, "Phix prints this, Eu does not\n") 

Greg: I agree it ain't pretty, but not very many lines are affected and apart from the includes you can almost always avoid it. It is just a dirty hack to "leave working Eu code alone"
I've got no problem with adding ifdef PHIX if that's what's wanted.

Pete

new topic     » goto parent     » topic index » view message » categorize

4. Re: Phix : tip

Added. Cheers.

new topic     » goto parent     » topic index » view message » categorize

5. Re: Phix : tip

ghaberek said...

This makes my head hurt. Can't we just have ifdef PHIX instead?

-Greg

Hi Gregg, the problem here isn't Phix, it's Eu. Add it to 4.05, then 4.1, then have a discussion etc etc. I actually think this is quite elegant, Phix has sorted the Eu incompatabilities out by itself.

Cheers

Chris

new topic     » goto parent     » topic index » view message » categorize

6. Re: Phix : tip

Added.
In pttree.e, line 1220, after

global constant T_movd          = 5100  tt_stringF("movd",T_movd) 

add

global constant T_PHIX          = 5116  tt_stringF("PHIX",T_PHIX) 

(Watch out for messages such as "PHIX should be 5124(not 5116)")

In ptok.e, line 2448, after

elsif ttidx=T_BITS64 then 
    thisflag = X64 

add

elsif ttidx=T_PHIX then 
    thisflag = 1 

Compile phix (p -cp), or you can just run p p test.

test code:

ifdef PHIX then 
    puts(1,"this is Phix\n") 
elsedef 
    puts(1,"this is Eu\n") 
end ifdef 

(works fine on eui 4.0.0)

I've also added this tip to the phix docs, thanks

Pete

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu