Skip to content

Commit 39a4224

Browse files
authored
Merge pull request #11 from YoganshSharma/main
Adding support for multiple languages - Perl - Lua - Ruby - Haskell
2 parents 78bbe24 + 685a079 commit 39a4224

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

run

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,33 @@ run() {
197197
elif [[ ${FILE#*.} == go ]]; then
198198
if [[ $COMPILE == true ]]; then
199199
go build -o "${FILE%%.*}.out" "$FILE"
200-
if [[ $PERSISTENT != true ]]; then
201-
rm "${FILE%%.*}.out"
202-
fi
203200
else
204201
go run "$FILE"
205202
fi
203+
if [[ $PERSISTENT != true ]]; then
204+
rm "${FILE%%.*}.out"
205+
fi
206206

207+
elif [[ ${FILE#*.} == pl ]]; then
208+
perl "$FILE"
209+
210+
elif [[ ${FILE#*.} == lua ]]; then
211+
lua "$FILE"
212+
213+
elif [[ ${FILE#*.} == rb ]]; then
214+
ruby "$FILE"
215+
216+
elif [[ ${FILE#*.} == hs ]]; then
217+
if [[ $DEBUG == true ]]; then
218+
ghci "$FILE"
219+
fi
220+
if [[ $COMPILE == true ]]; then
221+
ghc --make "$FILE"
222+
else
223+
runghc "$FILE"
224+
fi
225+
226+
207227
else
208228
_ERROR_UFTC_
209229
_EXIT_
@@ -232,10 +252,14 @@ for arg in "$@"; do
232252
echo " ${yellow}>>${white} Bash-Script"
233253
echo " ${yellow}>>${white} Javascript ${cyan}[${white}with ${green}debug${white} support${cyan}]"
234254
echo " ${yellow}>>${white} Golang"
255+
echo " ${yellow}>>${white} Perl"
256+
echo " ${yellow}>>${white} Lua"
257+
echo " ${yellow}>>${white} Ruby"
258+
echo " ${yellow}>>${white} Haskell ${cyan}[${white}with ${green}debug${white} support${cyan}]"
235259
echo
236260
;;
237261

238-
*".c" | *".cpp" | *".py" | *".rs" | *".java" | *".sh" | *".js" | *".go")
262+
*".c" | *".cpp" | *".py" | *".rs" | *".java" | *".sh" | *".js" | *".go" | *".pl" | *".lua" | *".rb" | *".hs")
239263
FILE_LOCATION=$arg
240264
if [[ ! -f $FILE_LOCATION ]]; then
241265
_ERROR_UFTC_

0 commit comments

Comments
 (0)