Skip to content

Commit

Permalink
Marked pflua-expand as obsolete; replaced by shell script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Katerina Barone-Adesi committed Jun 13, 2015
1 parent ba1c489 commit 8396735
Showing 1 changed file with 4 additions and 36 deletions.
40 changes: 4 additions & 36 deletions tools/pflua-expand
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
#!/usr/bin/env luajit
-- -*- lua -*-

package.path = package.path .. ";../src/?.lua"

local pf = require("pf")
local utils = require("pf.utils")

local function usage()
local content = [=[
Usage: pflua-expand [-O0] <pflang-expression>
Options:
-O0 Disable optimizations; optimizations are on by default.]=]
print(content);
os.exit()
end

-- Print help
if #arg == 0 then
usage()
end

local flags = utils.set(...)

-- Print help
if flags["--help"] or flags["-h"] then
usage()
end

local filter = arg[#arg]
local expanded = pf.expand.expand(pf.parse.parse(filter), "EN10MB")
if flags["-O0"] then
utils.pp(expanded)
else
utils.pp(pf.optimize.optimize(expanded))
end
#!/bin/bash
# This tool is obsolete and will be removed by the end of 2015.
# In the meanwhile, the following is provided for compatibility.
./pflua-compile --ast "$@"

0 comments on commit 8396735

Please sign in to comment.