10000 Fix and/or substitution problem (#6) by fcard · Pull Request #7 · coderofsalvation/powscript · GitHub
[go: up one dir, main page]

Skip to content

Fix and/or substitution problem (#6) #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lang/bash/.transpile
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ transpile_if(){
code="${1/if not/if \!}"
firstvar="${code/\! /}"
firstvar="$(echo "$firstvar" | awk '{ print $2 }')"
code="${code//and /&& }"
code="${code//or /|| }"
code="${code// and / && }"
code="${code// or / || }"
code="${code//> /-gt }"
code="${code//>= /-ge }"
code="${code//< /-lt }"
Expand Down
4 changes: 2 additions & 2 deletions powscript
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ transpile_if(){
code="${1/if not/if \!}"
firstvar="${code/\! /}"
firstvar="$(echo "$firstvar" | awk '{ print $2 }')"
code="${code//and /&& }"
code="${code//or /|| }"
code="${code// and / && }"
code="${code// or / || }"
code="${code//> /-gt }"
code="${code//>= /-ge }"
code="${code//< /-lt }"
Expand Down
2 changes: 1 addition & 1 deletion test/code-1.pow
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ decorate_string "foo"

usage()
echo "foo <number>"

switch $1
case [0-9]*
echo "arg 1 is a number"
Expand Down
5 changes: 5 additions & 0 deletions test/if.pow
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if -x $(command -v python)
echo "python exists"
else
echo "python doesn't exist"

2 changes: 1 addition & 1 deletion test/testapp.pow
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
usage(app)
echo "$app <number>"

switch $1
case [0-9]*
echo "arg 1 is a number"
Expand Down
0