parseManager/parsetest2.txt
2017-07-25 13:01:43 -04:00

60 lines
1009 B
Plaintext

-- 감사합니다
ENTRY START
[START]{
a=10>1 -- bit shift
b=10<1
"test: $a$ $b$"
testfunc("hello",(5!),15@1)
}
[@:construct]{ -- get % out of 100
ret=l/(r/100)
return(ret)
}
[>:construct]{ -- get % out of 100
ret=rshift(l,r)
return(ret)
}
[<:construct]{ -- get % out of 100
ret=lshift(l,r)
return(ret)
}
[~:construct]{ -- negate variable
if r~=NONE then GOTO(sub)|GOTO(neg)
::sub::
ret=l-r
return(ret)
GOTO(end)
::neg::
ret=0-r
return(ret)
::end::
}
-- You dont have too many symbols left to use though. For now a symbol is only 1 char long so you are limited
[fact:function(n)]{
count=1
stop=n
::loop:: -- for loop kinda, can become a stateloop as well
n=n*count
count=count+1
if count==stop then GOTO(end)|GOTO(loop)
::end::
ret=n
}
[neg:function(n)]{
ret=n*(0-1)
}
--Bind the fact function to the symbol '!'
[!:construct]{
env=fact(l)
ret=ret<-env
return(ret)
}
[NOVAR]{
::go::
"I AM HERE!!!"
NOVAR="TEST"
JUMP(START)
}
[TEST]{
"We are now here"
}