Skip to content

Commit

Permalink
#230 add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Jul 30, 2021
1 parent 08cee81 commit d238bb9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Ravi Programming Language
:target: https://travis-ci.org/dibyendumajumdar/ravi

Ravi is a dialect of `Lua <http://www.lua.org/>`_ with limited optional static typing and
features `MIR <https://github.com/vnmakarov/mir>`_ powered JIT compilers.
features a JIT compiler powered by `MIR <https://github.com/vnmakarov/mir>`_ as well as experimental support for AOT compilation to native code.
The name Ravi comes from the Sanskrit word for the Sun.
Interestingly a precursor to Lua was `Sol <http://www.lua.org/history.html>`_ which had support for
static types; Sol means the Sun in Portugese.
Expand Down Expand Up @@ -38,6 +38,7 @@ Features
* Compact JIT backend `MIR <https://github.com/vnmakarov/mir>`_.
* A `distribution with batteries <https://github.com/dibyendumajumdar/Suravi>`_.
* A `Visual Studio Code debugger extension <https://marketplace.visualstudio.com/items?itemName=ravilang.ravi-debug>`_ - interpreted mode debugger.
* A new compiler framework for `JIT and AOT compilation <https://the-ravi-programming-language.readthedocs.io/en/latest/ravi-compiler.html>`_.
* `AOT Compilation to shared library <https://github.com/dibyendumajumdar/ravi/tree/master/aot-examples>`_.

Documentation
Expand Down
18 changes: 18 additions & 0 deletions tests/language/ravi_tests1.ravi
Original file line number Diff line number Diff line change
Expand Up @@ -2284,6 +2284,24 @@ do
end
print 'Test 105 OK'

do
local function x()
return 1,2.5, nil, 'hi', {}, table.intarray(2), table.numarray(2),nil
end
local function y()
local a:integer,b:number,c:string,d:string,e:table,f:integer[],g:number[],h:UserType = x()
end
check(y, 'GETUPVAL', 'CALL', 'TOINT', 'TOFLT', 'TOSTRING',
'TOSTRING', 'TOTAB', 'TOIARRAY', 'TOFARRAY', 'TOTYPE', 'RETURN')
ravi.dumplua(y)
y()
compile(x)
compile(y)
y()
end
print 'Test 106 OK'


for k,v in pairs(opcodes_coverage)
do
print(k, v)
Expand Down

0 comments on commit d238bb9

Please sign in to comment.