-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Marked pflua-expand as obsolete; replaced by shell script.
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |