-
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
Jul 6, 2015
1 parent
5e2c56b
commit ab17386
Showing
5 changed files
with
61 additions
and
49 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
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
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
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
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,5 @@ | ||
#!/usr/bin/env luajit | ||
-- -*- lua -*- | ||
#!/bin/bash | ||
echo "This tool is obsolete and will be removed by the end of 2015. | ||
In the meanwhile, the following is provided for compatibility." 1>&2 | ||
|
||
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 | ||
./pflua-compile --ast "$@" |