Commit bc6c17bd authored by John Spikowski's avatar John Spikowski

OXSC181215.zip

parent c9f7153b
......@@ -21,10 +21,20 @@ itr 10:17 18/11/2018 Fix multiply unsigned by number (oper w1="mul ")
itr 16:07 16/11/2018 Rework rtl321 and rtl641 cats. expose char count. (catbufprp badcatl3 joinsi)
04:27 15/12/2018 Fix Empty macro problem (replacewdt)
22:58 14/12/2018 Appe() uses copy() instead of mid()
18:37 14/12/2018 Fix "=" bug subsas (f=a)
18:35 14/12/2018 Support accum setting with += -= assignments (cpa>2)
04:19 14/12/2018 Revoke class-operators, retain macro-operators(findop)
19:09 13/12/2018 Work on nested scopes for epilog code
00:05 13/12/2018 Merge mcword into replacewdt
14:40 12/12/2018 Remove wword uword parsing (destructors 20)
02:43 12/12/2018 Refactor macso etc. (mac to mrc)
12:00 11/12/2018 Implement bycopy
23:14 10/12/2018 Fix Macro ops handling funcs in expressions (hlex owa)
11:43 10/12/2018 Change expression order (expr.inc hlex hiex)
10:49 10/12/2018 Support "save" operation for register-based accumulators ("save")
01:18 10/12/2018 Revokevoke support for primitive down-converting load
01:18 10/12/2018 Revoke support for primitive down-converting load
10:57 09/12/2018 Refactor typa1 htyp (typx typh)
10:31 09/12/2018 Fix macromember name search (pars.bas rmk)
02:48 08/12/2018 Suppress del / destructor nullify call
......
......@@ -923,10 +923,7 @@ function Assemble(string*s) as string
case 46
'
i=swd
wr=wword(s,i)
'if i-swd=1
' wr="."+aword(s,i)
'endif
wr=aword(s,i)
lbw=wr
co=wr
wr=""
......
This diff is collapsed.
......@@ -301,8 +301,8 @@ function regid(string*wr, int*l) as int
string s
l=0 : a=lookupm(wr) : rexi=0
if a
if macio(a,0)=-10
s=macso(a,1)
if mrcio(a,0)=-10
s=mrcso(a,1)
b=valchahex(s,3)
e=valchahex(s,1)
if b=9
......@@ -331,8 +331,8 @@ function sregid(string*w, int*ds) as int
string s
ds=0 : rg=-1 : rexi=0 : a=lookupm(w)
if a=0 then goto xsreg
if macio(a,0)<>-10 then goto xsreg
s=macso(a,1)
if mrcio(a,0)<>-10 then goto xsreg
s=mrcso(a,1)
b=valchahex(s,3) : if b>4 then rg=valchahex(s,2) : ds=b+124
xsreg:
function=rg
......@@ -354,15 +354,15 @@ end function
function addtablesection(int k,a,ao) as string
===============================================
string w1
w1=macso(k,1)
w1=mrcso(k,1)
if cpuw=4
function="'ADD TABLE SECTION:"+cr+_
"lea edx,"+memreg(regss,ao)+cr+"lea edi,"+w1+cr+"mov ecx,"+str(macio(a,4))+cr+_
"lea edx,"+memreg(regss,ao)+cr+"lea edi,"+w1+cr+"mov ecx,"+str(mrcio(a,4))+cr+_
"("+cr+"mov eax,[edi]"+cr+"mov [edx],eax"+cr+"add edi,4"+cr+"add edx,4"+cr+_
"dec ecx"+cr+"ja repeat"+cr+")"+cr
else
function="'ADD TABLE SECTION:"+cr+_
"lea rdx,"+memreg(regss,ao)+cr+"lea rdi,"+w1+cr+"mov rcx,"+str(macio(a,4))+cr+_
"lea rdx,"+memreg(regss,ao)+cr+"lea rdi,"+w1+cr+"mov rcx,"+str(mrcio(a,4))+cr+_
"("+cr+"mov rax,[rdi]"+cr+"mov [rdx],rax"+cr+"add rdi,8"+cr+"add rdx,8"+cr+_
"dec rcx"+cr+"ja repeat"+cr+")"+cr
endif
......
......@@ -251,7 +251,7 @@ function returns() as string
'
int a=reto
int b=ccp 'CALLING CONVENTION
macio(mqf,1)=a 'LENGTH OF PARAMS
mrcio(mqf,1)=a 'LENGTH OF PARAMS
'
'APPLIES TO STDCALL AND PASCAL ONLY
'
......@@ -467,9 +467,9 @@ sub noprototype(string*wd,*w1)
if wpfx=""
wd=leaedi(wg) : w1=qedi : typg=cpuw
else 'wpfx
if (wg=pedi)and(macio(mp,3)=1) 'simple indirection level 1
if (wg=pedi)and(mrcio(mp,3)=1) 'simple indirection level 1
wd=""
w1=macso(mp,1)
w1=mrcso(mp,1)
else
if wg<>pedi 'array offsets etc
wd+=leaedi(wg)
......@@ -486,11 +486,11 @@ end sub
sub newcleanvar(string *wn,*wr,int p)
=====================================
wn=newtmpvar(typename(p))
wr=macso(me-1,1) 'vector
wr=mrcso(me-1,1) 'vector
if p<typh
exit sub
endif
int n=macio(me-1,1) 'size
int n=mrcio(me-1,1) 'size
int mo
'string dstr
'PREP CLEANUP
......@@ -670,8 +670,8 @@ function preparecall(string*wp,*w4,*wm, int cc) as string
'
'METHOD CALL
'
d=macio(mq,2) 'INTERNAL FUNCTION TABLE INDEX
v=macio(mq,3) 'VIRTUAL MODALITY
d=mrcio(mq,2) 'INTERNAL FUNCTION TABLE INDEX
v=mrcio(mq,3) 'VIRTUAL MODALITY
'
if v>1 'VIRTUAL / PURE CLASS
d=0 ' MUST USE EXTERNAL TABLE
......@@ -709,7 +709,7 @@ function preparecall(string*wp,*w4,*wm, int cc) as string
'COMPOSE THE CALL INCLUDING 'THIS' IN THE ECX REGISTER
'
if asc(pls)=48
pls=","+macso(macio(mp,0)-typh,0)+"."+wm 'FWD REF REQUIRES NAMED CLASS.PROCEDURE
pls=","+mrcso(mrcio(mp,0)-typh,0)+"."+wm 'FWD REF REQUIRES NAMED CLASS.PROCEDURE
endif
'
w5=pls+" "+w5+" "+hex(nsi)+" "+hex(nsp)
......@@ -769,7 +769,7 @@ function retvalue() as string
if (lcl=0)or(ccp=17) then exit function
b=lookupm("returnvar")
if b=0 then exit function 'SUB
w2=macso(b,1)
w2=mrcso(b,1)
if w2=qeax then exit function
'
'ENCODE FOR RETURNING DIFFERENT TYPES
......@@ -1057,11 +1057,11 @@ function compatsig(string*p1,*p2, int pb) as int
if findop(n,a,"constructor",w1)
'deferred object creation
paj(pa)=n
if a
'if a
mpfx+=w1+"(#obj#,("+pex(pa)+")"+cr
else
mpfx+="#obj#.constructor("+pex(pa)+")"+cr
endif
'else
' mpfx+="#obj#.constructor("+pex(pa)+")"+cr
'endif
pas(pa)="lea "+qeax+cm+"#obj#"+cr
pav(pa)=callcnvi(c,qeax,e)
k=2
......
......@@ -6,7 +6,7 @@
'cmp compact,0 : jnz fwd _end_proc
int a=1, c=0
string w1,w2
w2=macso(f,1)
w2=mrcso(f,1)
do 'expand macro recursively
a=instr(a,w2,"%")
if a=0 then exit do
......@@ -14,7 +14,7 @@
w1=tword(w2,a)
c=lookupm(w1)
if c
w2=left(w2,swd-2)+macso(c,1)+mid(w2,a)
w2=left(w2,swd-2)+mrcso(c,1)+mid(w2,a)
else
ert=1003 : ers="unidentified macro in deff: %" + w1
exit do
......@@ -139,19 +139,19 @@
opcall: 'subroutine
===================
if b=0
'DUAL COMPATIBILITY CALL
wt+="mov "+wrsp+",rsp"+cr+
"sub rsp,32"+cr+
"lea rdx,"+waco+cr+"mov [rsp+"+str(cpuw)+"],rdx"+cr+
"lea rcx,"+wr+cr+"mov [rsp],rcx"+cr+
"call "+w2+cr+
"mov rsp,"+wrsp+cr
else
'if b=0
' 'DUAL COMPATIBILITY CALL
' wt+="mov "+wrsp+",rsp"+cr+
' "sub rsp,32"+cr+
' "lea rdx,"+waco+cr+"mov [rsp+"+str(cpuw)+"],rdx"+cr+
' "lea rcx,"+wr+cr+"mov [rsp],rcx"+cr+
' "call "+w2+cr+
' "mov rsp,"+wrsp+cr
'else
'MACRO OP
hlex+=w2+"("+owa+cm+wacc+")"+cr
rps=1
endif
'endif
skiplspace(s,i)
ret
......@@ -182,33 +182,21 @@
'
converterh: 'subroutine
=======================
m=typc
newcleanvar(owa,wr,m) 'new owa and wr
if findop(m,a,"constructor",w2)
if a
m=typc
newcleanvar(owa,wr,m) 'new owa and wr
'if a
hlex+=w2+"("+owa+cm+w4")"+cr
else
hlex+=owa+".constructor("+w4+")"+cr
endif
'else
' hlex+=owa+".constructor("+w4+")"+cr
'endif
w1=""
rps=1
endif
rps=1
w1=""
typ=typc
typa=typc
ret
'
'saveregacc: 'subroutine
=======================
'
'if findop(typ,b,"save",w2)
' if b
' 'macro only
' hlex+=w2+"("+owa+cm+wacc+")"+cr
' rps=1
' endif
'endif
'ret
======
begin:
......@@ -218,6 +206,13 @@
tya1=typx
if nst=0
'
if typx>=typh
if cpa>2
opsh=identops(op)
wacc=osg
waco=wsg
endif
endif
if op=-1
w2=mid(s,i,1)
i++
......@@ -415,7 +410,7 @@
'if findop(typ,b,"primitive",w1) 'w1 dummy
' if b 'MACRO
' w2=newtmpvar(w3)
' hlex+=macso(typ-typh,0)+"_op.prim("+
' hlex+=mrcso(typ-typh,0)+"_op.prim("+
' owa+cm+w2+")"
' w2+=" "
' rps=1
......@@ -956,7 +951,7 @@
'
'PI and any other FPU consts
if (m=0)and(b<>lbr)
wt+=macso(mp,1)+cr
wt+=mrcso(mp,1)+cr
if op>1
wt+=operi(op,typ,chr(127)) 'NORMAL MATH OP
endif
......@@ -1122,7 +1117,7 @@
if elsize
nstu.j=elsize 'ELEMENT SIZE
else
nstu.j=macio(c,1) 'VAR SIZE
nstu.j=mrcio(c,1) 'VAR SIZE
endif
'
if ixnt>0
......@@ -1294,7 +1289,7 @@
'
'READ THE MEMBER ATTRIBUTES
'
ow=macso(nstu.c,0)+"."+w1 'VAR NAME EXCLUDING ARRAY SPEC
ow=mrcso(nstu.c,0)+"."+w1 'VAR NAME EXCLUDING ARRAY SPEC
'SUPPORTING DIRECT & INDIRECT MEMBERS
a=-1
mp=nstu.c
......@@ -1522,7 +1517,7 @@
w1=""
w2=""
b=typc
w3=macso(nstu.g,1)
w3=mrcso(nstu.g,1)
'
if isfloat(typa) then typa=0x68
if isfloat(typc) then typc=0x68
......@@ -1554,13 +1549,13 @@
b=cpuw
endif
endif
w3=macso(-nstu.g,1)
w3=mrcso(-nstu.g,1)
epfx+=wt+laz
if typx<typh
epfx+=lazt+operi(2,b,w3)
wt=lazt+operi(1,b,w3)
else
b=macio(-nstu.g,5)
b=mrcio(-nstu.g,5)
epfx+=lazt+operi(1,b,w3)
endif
w3=""
......@@ -1769,7 +1764,7 @@
w1+=wpfx+operi(a,typa,wr)
'ASSIGNMENT PROCEDURE FOR DYNAMIC STRINGS
if (typa>=0xe0)and(typa<0x100)
w2=mid(macso(mp,1),3,3)
w2=mid(mrcso(mp,1),3,3)
if w2="bp-" then a=asstrla else a=asstrga 'LOCAL GC / GLOBAL GC
w1+=rtlo(a)+cr
endif
......@@ -1836,14 +1831,14 @@
'
elseif typx=typc
'
asgi=macio(typx-typh,1) 'MAIN STRIDE
asgi=mrcio(typx-typh,1) 'MAIN STRIDE
asgo=asgj
'
else 'ASSIGNING TO HIGHER TYPES
'
'TRAVERSE ELEMENTS OF TYPE OR CLASS
b=0 'LOOP ITERATION FLAG
asgi=macio(typx-typh,1) 'MAIN STRIDE
asgi=mrcio(typx-typh,1) 'MAIN STRIDE
'
'nextmember
do
......@@ -1890,7 +1885,7 @@
endif
'
if b 'ALREADY TRIED TO LOCATE ONCE
ers="Element not located "+macso(typx-typh,0)
ers="Element not located "+mrcso(typx-typh,0)
ert=202
goto endexpr
endif
......@@ -1912,7 +1907,7 @@
endif
'COPY HIGHER MEMBER
rps=32
a=macio(typc-typh,1)
a=mrcio(typc-typh,1)
hlex+="copy @"+osg+"+"+str(asgo)+cm+"@"+owa+cm+str(a)+cr 'EXPRESSION TO BE REPROCESSED
if typx<typh
asgi=a 'STRIDE USING ARRAY OFFSET ASGJ
......@@ -2602,7 +2597,6 @@
'
'RETURNING HIGHER ACCUM ADDRESS
if uex>=4096
'gosub saveregacc
accg=wacc
wg=waco
else
......@@ -2712,7 +2706,7 @@ function precalc(string*s, int*i,ty, string*w1) as string
skiplspace(s,i)
op=0 : epfx=""
w1+=w3
return macso(a,0)
return mrcso(a,0)
end function
......@@ -2802,8 +2796,10 @@ function subsas(string*s, int*i, string*ur,*v, int igb) as int
endif
if a
replas(u,a,wr) 'REPLACE PARAM WITH EXPRESSION
f=a
else
i=b : exit function 'FAIL
i=b
exit function 'FAIL
endif
skiplspace(s,i)
if ascn=44
......@@ -2837,10 +2833,10 @@ function subsas(string*s, int*i, string*ur,*v, int igb) as int
if vf=8
m=mp : oo=1
else 'vf>8
m=macio(mp,0)-typh : oo=-1
m=mrcio(mp,0)-typh : oo=-1
endif
'
dvl=macso(m,1)
dvl=mrcso(m,1)
do
dvm=""
'
......@@ -2923,13 +2919,13 @@ function subsas(string*s, int*i, string*ur,*v, int igb) as int
stk=stkb
wp=ow
if asc(ow)=lbr
wp=macso(mp,0)
wp=mrcso(mp,0)
endif
w5=wpfx
stkb=0
rgst=regst
'
ct=macio(mp,0)
ct=mrcio(mp,0)
if ct>=typh
if varf=8 then ct=-5 'FUNCTION TABLES
endif
......@@ -2944,7 +2940,7 @@ function subsas(string*s, int*i, string*ur,*v, int igb) as int
'
if ct=-4
'UNPROTOTYPED CALLS
nextproc(macso(mp,1),1,w4,lb)
nextproc(mrcso(mp,1),1,w4,lb)
cc=cco
if lb>0
w4=addlproc(lb,w4) 'GET VECTOR (OR CREATE IT)
......@@ -3016,7 +3012,7 @@ function subsas(string*s, int*i, string*ur,*v, int igb) as int
if isa(ta)
m=lookupm(w1)
if mp
if macio(m,0)=-18
if mrcio(m,0)=-18
i=nwd
wr=macres(m,s,i) 'LOW LEVEL MACRO ONLY
inserts(s,wr,i) : skiplspace(s,i)
......@@ -3130,7 +3126,7 @@ function subsas(string*s, int*i, string*ur,*v, int igb) as int
d=ascn
if b>=0x80 then b=cpuw 'STRINGS AND HIGHER TYPES
w2=newtmpvar(typename(b))
wg=macso(me-1,1)
wg=mrcso(me-1,1)
epfx+=wd+operi(2,b,wg)
wd=operi(1,b,wg)
opg=1024
......@@ -3332,7 +3328,7 @@ function subsas(string*s, int*i, string*ur,*v, int igb) as int
'
if vp=8
if instr(wp,".")=0
ws=macso(mqp,1) : uk or= 8 'REQUIRE PARAM MATCH FOR FUNCTIONS
ws=mrcso(mqp,1) : uk or= 8 'REQUIRE PARAM MATCH FOR FUNCTIONS
endif
endif
'
......@@ -3598,7 +3594,7 @@ function subsas(string*s, int*i, string*ur,*v, int igb) as int
w4=NewTmpName()
vars(typename(typ)+"*"+w4)
inserts(s,w4,i)
w2+=operi(2,cpuw,macso(me-1,1))+express(s,i,0)
w2+=operi(2,cpuw,mrcso(me-1,1))+express(s,i,0)
endif
'
return w1+paramcode+w3+w2
......
......@@ -135,10 +135,10 @@
'
% maxit=99999 'size of entity array
% smaco=12 'elements in maco(0..7) macs(0..3)
%= omacs=smaco-4 //offset to maco string pointers (entity strings)
% smrco=12 'elements in mrco(0..7) mrcs(0..3)
%= omrcs=smrco-4 //offset to mrco string pointers (entity strings)
macro macio(x,y) maco[(x)*smaco+y]
macro mrcio(x,y) mrco[(x)*smrco+y]
'STATIC STRINGS
......@@ -151,6 +151,9 @@
strini xf[sizli] 'file name
strini bkw[sizli] '
strini nsn[sizli] 'namespace
'
strini epgs[99] 'global expressions to resolve before epilogs
int epgi[99] 'global epilog index
'for reco.inc
'static string wa1,wa2
......@@ -185,9 +188,9 @@
strini opn[999]
strini ops[999] ' Assembly code data
'-------------------------------------------------------------------
int maco[maxit*smaco-1] ' buffer for all definitions
hashref mach[maxit] ' hashes
int macb[2047] 'hash base links
int mrco[maxit*smrco-1] ' buffer for all definitions
hashref mrch[maxit] ' hashes
int mrcb[2047] 'hash base links
========================================================
'
'
......@@ -297,7 +300,7 @@
'===================================
' fq include file index
' me macro list end boundary
' me record list end boundary
' mp entity index
' mq linked entity index
' mc,md sem codes
......@@ -342,7 +345,7 @@
' tye type of element
' mtyp metatype
' phr conditional lhv rhv
' cpa comparator flag
' cpa assignment operators += /= etc.
' leni length of last insertion
' inpi forward insertion point
' clon clone flag (getas)
......@@ -369,10 +372,6 @@
' wpfx pointer/array code to insert before vars (assembler)
' epfx pre expressions to resolve before main expression
' mpfx pre method to resolve before main expression
' epls local expressions to resolve before procedure epilog
' epgs global expressions to resolve before program epilog
' epli local epilog index
' epgi global epilog index
' epif local epilog procedure flag
' wths 'with' assignment prefix
' asg assignment string to append / post append to expression
......@@ -575,7 +574,7 @@
int nobr,ebdi,nmac,nstod,cboolf,convs,plistend,clistend,dlistend,plp,plq
int compact,tranpass,preproc,asxp,elct,elsz,ctal,cpoint
int nsi,nsp,nsq,rps,tyd,independent,cnsl,eord,noco
int omo,ert,epif,epli,epgi,nobj,ndstr,coret
int omo,ert,epif,nobj,ndstr,coret
sys qv
......@@ -583,7 +582,7 @@
sys psysfuns,pt
string t,wu,wu1,wu2,ou,ow,owk,owa,regs,regsl,regss,regst,cpua,pw,sig,sigu,sigv,sog,opns,opnsl
string wpfx,epfx,mpfx,epls,epgs,wths,asg,asgs,wg,lbw,ipath,lpath,libr,ary,sps,dvl,dvm
string wpfx,epfx,mpfx,wths,asg,asgs,wg,lbw,ipath,lpath,libr,ary,sps,dvl,dvm
string qeax,qecx,qedx,qebx,qesp,qebp,qesi,qedi,peax,pecx,pesp,pedi,pesi,ledi,medi
string pusheax,popeax,spw1,spw2,pexn,cexn,cbuf
string oxypath, hostdll,dats,lnkc,lnkd,defbuf,lnmks,wbse,osg,psg,wsg,accg
......@@ -660,10 +659,6 @@ sub GlobalClear()
jn=0
tmpi=0
epfx=""
epls=""
epgs=""
epli=0
epgi=0
plp=1
plq=0
vwb=0
......
......@@ -798,7 +798,7 @@ function PrepExec() as string
int a,b,c,d,k
string w1,w2,w3,w4,wm,wd
string prol,epil,asms,hdrs,ddat,udat,imps,exps,ress
string prol,epils,asms,hdrs,ddat,udat,imps,exps,ress
' ################
......@@ -924,7 +924,7 @@ push 4096 : call [rbx+8] : mov [rbx+680],rax 'BUFFER FOR LIB HANDLES 680
'EPILOG
'====== '
epil="
epils="
._end_
mov rsp,rbp : pop rbp
ret
......@@ -973,7 +973,7 @@ mov rcx,4096 : call [rbx+8] : mov [rbx+680],rax 'BUFFER FOR LIB HANDLES 680
'EPILOG
'====== '
epil="
epils="
._end_
mov rsp,rbp : pop rbp
ret
......@@ -986,7 +986,7 @@ jmp _end_
endif 'cpuw 4/8 : mode 32/64 bit
=================================
asms=prol+t+epil
asms=prol+t+epils
roundupc(dati,4)
apdat("")
......@@ -1008,7 +1008,7 @@ exit function 'JIT MODE
njit:
=====
asms=prol+t+epil
asms=prol+t+epils
'
'
'==========================
......
......@@ -296,7 +296,7 @@ freelibs 19 call [ebx+2448]
right 20 right(s,i) {mid(s,-(i))}
guidptr 20 guidptr(s) {byval guidval(guid{},s)}
destructors 20 (a,n){
destructors 20 destructors(a,n){
typeof a p at @a
int i
do {
......@@ -473,8 +473,7 @@ this 14 50
#dim 14 57
#assign 14 58
#insert 14 59
#localend 14 60
#globalend 14 61
#ending 14 60
deff 14 62
'operations 14 63
......
......@@ -693,8 +693,9 @@ sub appe(string*s, int*k, string*wt)
if ls<k+le
s+=nuls(le+4096)
end if
'copy strptr(s)+k,strptr(wt),le
mid(s,k+1)=wt : k+=le
copy strptr(s)+k,strptr(wt),le
'mid(s,k+1)=wt
k+=le
end sub
......
......@@ -212,7 +212,7 @@ next
end function
function iword(string*s, int*i) as string
function bword(string*s, int*i) as string
=========================================
byte bb at strptr(s)-1
skipspace(s,i)
......@@ -241,53 +241,6 @@ function iword(string*s, int*i) as string
end function
function uword(string*s, int*i) as string
=========================================
byte bb at strptr(s)-1
skipspace(s,i)
swd=i
ascw=bb[i]
do
ascn=bb[i]
select ascn
case 0 to 32 : exit do
case 39 : exit do '''
case 59 : exit do ';'
case 44 : exit do ','
case 40 : exit do '('
case 41 : exit do ')'
case 123 : exit do '{'
case 125 : exit do '}'
case 34,96 : i=instr(i+1,s,chr(ascn))
if i=0
i=len(s)
end if
end select
i++
loop
lenw=i-swd
'if lenw=0
' if ascn>32
' lenw=1 : i++ 'exit symbol
' end if
'end if
skiplspace(s,i)
if lenw>0
function=mid(s,swd,lenw)
end if
end function
function wword(string*s, int*i) as string
=========================================
string wr
wr=uword(s,i)
clcase(wr)
ascw=asc(wr)
function=wr
end function
sub FixCrLF(string*s)
=====================
string d
......@@ -820,47 +773,13 @@ end function
function mcword(string*s, int*i, int mo) as string
==================================================
int a,l,le=len(s)
skipspace(s,i)
ascw=ascn
swd=i
dtf=0
if isq(ascw)
skipquote(s,i) : goto nmcword
end if
do
a=asc(s,i)
select a
case 48 to 57 : i++ : continue do
case 65 to 90 : i++ : continue do
case 97 to 122 : i++ : continue do
case 127 to 248 : i++ : continue do
case 46
if dtf=0
dtf=i-swd+1
end if
i++ : continue do
case 95 : i++ : continue do
end select
if i=swd
i++ 'SYMBOL
end if
exit do
loop
nmcword:
lenw=i-swd
l=lenw
if (mo<>0)and(dtf<>0)
l=dtf-1 'CLIP WORD
end if
return mid(s,swd,l)
end function
sub replacewdt(string*s,*w,*r, int mo)
======================================
if not s then exit sub
if not w then exit sub
'
'DOTTED WORDS
int a,b,i,lw,lr,sb
string bu,wr,w1
......@@ -868,19 +787,45 @@ sub replacewdt(string*s,*w,*r, int mo)
i=1
sb=1
do
wr=mcword(s,i,mo) : lw=lenw
if ascw=0
wr=""
dtf=0
skipspace(s,i)
swd=i
if isq(ascw)
skipquote(s,i) : goto nmcword
endif
do
a=asc(s,i)
select a
case 48 to 57 : i++ : continue do
case 65 to 90 : i++ : continue do
case 97 to 122 : i++ : continue do
case 127 to 248 : i++ : continue do
case 95 : i++ : continue do
case 46 : dtf=1
if mo=0 then i++ : continue do
end select
if i=swd
if a>0 then i++ 'SYMBOL
endif
exit do
end if
loop
nmcword:
lenw=i-swd
if lenw
wr=mid(s,swd,lenw)
else
exit do
endif
if wr=w
if (mo<>0)and(dtf<>0)
lw=dtf-1
w1="##"
else
w1=""
end if
appe(bu,b,mid(s,sb,swd-sb)+r+w1) : sb=swd+lw
end if
endif
appe(bu,b,mid(s,sb,swd-sb)+r+w1)
sb=swd+lenw
endif
loop
appe(bu,b,mid(s,sb,len(s)+1-sb) ) 'append remainder
s=left(bu,b)
......
......@@ -432,7 +432,7 @@ do ' main loop
if ise(ascn)
nsi=0
else
wd=wword(s,i)
wd=tword(s,i)
for a=nse to 1 step-1 'CHECK FOR PREV NAMESPACE MATCH
if wd=nsn(a)
nsi=a : a=-1 : exit for
......@@ -499,7 +499,7 @@ do ' main loop
'
c=0
if a=46
i++ : ke=wword(s,i)
i++ : ke=tword(s,i)
'
'CHECK FOR EXPLICIT NAMESPACE ::
a=instr(ke,"::")
......@@ -727,7 +727,7 @@ do ' main loop
if m>32
i++
endif
ke=wword(s,i)
ke=tword(s,i)
nsp=0
'
'CHECK FOR EXPLICIT NAMESPACE ::
......