Merge remote-tracking branch 'origin/master' into v0.7.3
diff --git a/.gitignore b/.gitignore
index 1acd4c0..2978e2f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
*.rock
+*.tar.gz
.DS_Store
diff --git a/bin/metalua b/bin/metalua
index 3b8ab07..7ea1f3a 100644
--- a/bin/metalua
+++ b/bin/metalua
@@ -1,7 +1,7 @@
#!/usr/bin/env lua51
--*-lua-*----------------------------------------------------------------------
--
--- Copyright (c) 2006-2014 Fabien Fleutot and others.
+-- Copyright (c) 2006-2015 Fabien Fleutot and others.
--
-- All rights reserved.
--
@@ -27,7 +27,11 @@
-- @module metalua
-- Survive lack of checks
-if not pcall(require, 'checks') then function package.preload.checks() function checks() end end end
+local checksstatus, checks = pcall(require, 'checks')
+if not checksstatus then
+ checksstatus, checks = pcall(require, 'metalua.checks')
+ if not checksstatus then function package.preload.checks() function checks() end end end
+end
-- Main file for the metalua executable
require 'metalua.loader' -- load *.mlue files
diff --git a/metalua-0.7.3-2.rockspec b/metalua-0.7.3-2.rockspec
new file mode 100644
index 0000000..04f5d81
--- /dev/null
+++ b/metalua-0.7.3-2.rockspec
@@ -0,0 +1,32 @@
+--*-lua-*--
+package = 'metalua'
+version = '0.7.3-2'
+source = {
+ url = 'http://git.eclipse.org/c/ldt/org.eclipse.metalua.git/snapshot/org.eclipse.metalua-all-v0.7.3-2.tar.gz',
+}
+description = {
+ summary = 'Metalua: parser, compiler and command line interface.',
+ detailed = 'Just enabling metalua-compiler powers to command line.',
+ homepage = 'https://git.eclipse.org/c/ldt/org.eclipse.metalua.git',
+ license = 'EPL + MIT'
+}
+dependencies = {
+ 'lua ~> 5.1',
+ 'metalua-compiler == 0.7.3',
+ platforms = {
+ unix = {
+ 'alt-getopt ~> 0.7',
+ 'checks ~> 1.0',
+ 'readline ~> 1.3', -- Better REPL experience
+ }
+ }
+}
+build = {
+ type='builtin',
+ modules = { },
+ install = {
+ bin = {
+ metalua = 'bin/metalua'
+ }
+ }
+}
diff --git a/metalua-parser-0.7.3-2.rockspec b/metalua-parser-0.7.3-2.rockspec
index f89f26b..8d4ee23 100644
--- a/metalua-parser-0.7.3-2.rockspec
+++ b/metalua-parser-0.7.3-2.rockspec
@@ -1,38 +1,39 @@
--*-lua-*--
-package = "metalua-parser"
-version = "0.7.3-1"
+package = 'metalua-parser'
+version = '0.7.3-2'
source = {
- url = "http://git.eclipse.org/c/koneki/org.eclipse.koneki.metalua.git/snapshot/org.eclipse.koneki.metalua-v0.7.3.tar.gz"
+ url = 'http://git.eclipse.org/c/ldt/org.eclipse.metalua.git/snapshot/org.eclipse.metalua-parser-v0.7.3-2.tar.gz',
}
description = {
- summary = "Metalua's parser: converting Lua source strings and files into AST",
+ summary = [[Metalua's parser: converting Lua source strings and files into AST]],
detailed = [[
This is a subset of the full Metalua compiler. It defines and generates an AST
format for Lua programs, which offers a nice level of abstraction to reason about
and manipulate Lua programs.
]],
- homepage = "http://git.eclipse.org/c/koneki/org.eclipse.koneki.metalua.git",
- license = "EPL + MIT"
+ homepage = 'https://git.eclipse.org/c/ldt/org.eclipse.metalua.git',
+ license = 'EPL + MIT',
}
dependencies = {
- "lua >= 5.1"
+ 'lua >= 5.1',
}
build = {
- type="builtin",
+ type='builtin',
modules={
- ["metalua.grammar.generator"] = "metalua/grammar/generator.lua",
- ["metalua.grammar.lexer"] = "metalua/grammar/lexer.lua",
- ["metalua.compiler.parser"] = "metalua/compiler/parser.lua",
- ["metalua.compiler.parser.table"] = "metalua/compiler/parser/table.lua",
- ["metalua.compiler.parser.ext"] = "metalua/compiler/parser/ext.lua",
- ["metalua.compiler.parser.annot.generator"] = "metalua/compiler/parser/annot/generator.lua",
- ["metalua.compiler.parser.annot.grammar"] = "metalua/compiler/parser/annot/grammar.lua",
- ["metalua.compiler.parser.stat"] = "metalua/compiler/parser/stat.lua",
- ["metalua.compiler.parser.misc"] = "metalua/compiler/parser/misc.lua",
- ["metalua.compiler.parser.lexer"] = "metalua/compiler/parser/lexer.lua",
- ["metalua.compiler.parser.meta"] = "metalua/compiler/parser/meta.lua",
- ["metalua.compiler.parser.expr"] = "metalua/compiler/parser/expr.lua",
- ["metalua.compiler"] = "metalua/compiler.lua",
- ["metalua.pprint"] = "metalua/pprint.lua",
+ ['metalua.checks'] = 'checks.lua',
+ ['metalua.grammar.generator'] = 'metalua/grammar/generator.lua',
+ ['metalua.grammar.lexer'] = 'metalua/grammar/lexer.lua',
+ ['metalua.compiler.parser'] = 'metalua/compiler/parser.lua',
+ ['metalua.compiler.parser.table'] = 'metalua/compiler/parser/table.lua',
+ ['metalua.compiler.parser.ext'] = 'metalua/compiler/parser/ext.lua',
+ ['metalua.compiler.parser.annot.generator'] = 'metalua/compiler/parser/annot/generator.lua',
+ ['metalua.compiler.parser.annot.grammar'] = 'metalua/compiler/parser/annot/grammar.lua',
+ ['metalua.compiler.parser.stat'] = 'metalua/compiler/parser/stat.lua',
+ ['metalua.compiler.parser.misc'] = 'metalua/compiler/parser/misc.lua',
+ ['metalua.compiler.parser.lexer'] = 'metalua/compiler/parser/lexer.lua',
+ ['metalua.compiler.parser.meta'] = 'metalua/compiler/parser/meta.lua',
+ ['metalua.compiler.parser.expr'] = 'metalua/compiler/parser/expr.lua',
+ ['metalua.compiler'] = 'metalua/compiler.lua',
+ ['metalua.pprint'] = 'metalua/pprint.lua',
}
}
diff --git a/metalua/compiler.lua b/metalua/compiler.lua
index 9b0e56b..63f4114 100644
--- a/metalua/compiler.lua
+++ b/metalua/compiler.lua
@@ -1,5 +1,5 @@
---------------------------------------------------------------------------
--- Copyright (c) 2006-2013 Fabien Fleutot and others.
+-- Copyright (c) 2006-2015 Fabien Fleutot and others.
--
-- All rights reserved.
--
@@ -38,8 +38,10 @@
--
--------------------------------------------------------------------------------
-local checks = require 'checks'
-
+local checksstatus, checks = pcall(require, 'checks')
+if not checksstatus then
+ checks = require 'metalua.checks'
+end
local M = { }
--------------------------------------------------------------------------------
diff --git a/metalua/compiler/parser/annot/generator.lua b/metalua/compiler/parser/annot/generator.lua
index 3a805ad..29b1fe8 100644
--- a/metalua/compiler/parser/annot/generator.lua
+++ b/metalua/compiler/parser/annot/generator.lua
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------------
--- Copyright (c) 2006-2013 Fabien Fleutot and others.
+-- Copyright (c) 2006-2015 Fabien Fleutot and others.
--
-- All rights reserved.
--
@@ -17,7 +17,10 @@
--
--------------------------------------------------------------------------------
-local checks = require 'checks'
+local checksstatus, checks = pcall(require, 'checks')
+if not checksstatus then
+ checks = require 'metalua.checks'
+end
local gg = require 'metalua.grammar.generator'
local M = { }
diff --git a/metalua/extension/match.mlua b/metalua/extension/match.mlua
index f55ff41..a96c418 100644
--- a/metalua/extension/match.mlua
+++ b/metalua/extension/match.mlua
@@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
--- Copyright (c) 2006-2013 Fabien Fleutot and others.
+-- Copyright (c) 2006-2015 Fabien Fleutot and others.
--
-- All rights reserved.
--
@@ -78,7 +78,10 @@
-- TODO: cfg.ntmp isn't reset as often as it could. I'm not even sure
-- the corresponding locals are declared.
-local checks = require 'checks'
+local checksstatus, checks = pcall(require, 'checks')
+if not checksstatus then
+ checks = require 'metalua.checks'
+end
local gg = require 'metalua.grammar.generator'
local pp = require 'metalua.pprint'
diff --git a/metalua/grammar/generator.lua b/metalua/grammar/generator.lua
index 2680d8a..ecdb277 100644
--- a/metalua/grammar/generator.lua
+++ b/metalua/grammar/generator.lua
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------------
--- Copyright (c) 2006-2013 Fabien Fleutot and others.
+-- Copyright (c) 2006-2015 Fabien Fleutot and others.
--
-- All rights reserved.
--
@@ -46,7 +46,10 @@
local M = { }
-local checks = require 'checks'
+local checksstatus, checks = pcall(require, 'checks')
+if not checksstatus then
+ checks = require 'metalua.checks'
+end
local lexer = require 'metalua.grammar.lexer'
local pp = require 'metalua.pprint'
diff --git a/metalua/grammar/lexer.lua b/metalua/grammar/lexer.lua
index 0f96f8e..64eb081 100644
--- a/metalua/grammar/lexer.lua
+++ b/metalua/grammar/lexer.lua
@@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
--- Copyright (c) 2006-2013 Fabien Fleutot and others.
+-- Copyright (c) 2006-2015 Fabien Fleutot and others.
--
-- All rights reserved.
--
@@ -17,7 +17,10 @@
--
-------------------------------------------------------------------------------
-local checks = require 'checks'
+local checksstatus, checks = pcall(require, 'checks')
+if not checksstatus then
+ checks = require 'metalua.checks'
+end
local M = { }
diff --git a/metalua/loader.lua b/metalua/loader.lua
index e535fef..84489f7 100644
--- a/metalua/loader.lua
+++ b/metalua/loader.lua
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------------
--- Copyright (c) 2006-2013 Fabien Fleutot and others.
+-- Copyright (c) 2006-2015 Fabien Fleutot and others.
--
-- All rights reserved.
--
@@ -18,7 +18,10 @@
--------------------------------------------------------------------------------
local M = require "package" -- extend Lua's basic "package" module
-local checks = require 'checks'
+local checksstatus, checks = pcall(require, 'checks')
+if not checksstatus then
+ checks = require 'metalua.checks'
+end
M.metalua_extension_prefix = 'metalua.extension.'
diff --git a/metalua/repl.mlua b/metalua/repl.mlua
index 0c89bc0..18cf518 100644
--- a/metalua/repl.mlua
+++ b/metalua/repl.mlua
@@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
--- Copyright (c) 2006-2013 Fabien Fleutot and others.
+-- Copyright (c) 2006-2015 Fabien Fleutot and others.
--
-- All rights reserved.
--
@@ -57,7 +57,7 @@
function M.run()
pp.printf ("Metalua, interactive REPLoop.\n"..
- "(c) 2006-2013 <metalua@gmail.com>")
+ "(c) 2006-2015 <metalua@gmail.com>")
local lines = { }
while true do
local src, lx, ast, f, results, success