1. Phix : tip
- Posted by ChrisB (moderator) Feb 03, 2017
- 1332 views
- Last edited Feb 04, 2017
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()
2. Re: Phix : tip
- Posted by ghaberek (admin) Feb 03, 2017
- 1276 views
This makes my head hurt. Can't we just have ifdef PHIX instead?
-Greg
3. Re: Phix : tip
- Posted by petelomax Feb 03, 2017
- 1263 views
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
5. Re: Phix : tip
- Posted by ChrisB (moderator) Feb 04, 2017
- 1258 views
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
6. Re: Phix : tip
- Posted by petelomax Feb 04, 2017
- 1255 views
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