Skip to content

Commit 48262d0

Browse files
committed
cleanup gaps in nounset expressions
1 parent 58f9b23 commit 48262d0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

dist/bin/common

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ DecompilerMain=dotty.tools.dotc.decompiler.Main
201201
ReplMain=dotty.tools.repl.Main
202202
ScriptingMain=dotty.tools.scripting.Main
203203

204+
declare -a java_args
205+
declare -a scala_args
204206
declare -a residual_args
205207
declare -a script_args
206208

dist/bin/scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ while [[ $# -gt 0 ]]; do
9999
shift
100100
;;
101101
-d|-debug)
102-
DEBUG="$DEBUG_STR"
102+
DEBUG="${DEBUG_STR-}"
103103
shift ;;
104104
-version)
105105
# defer to scalac, then exit
@@ -155,13 +155,12 @@ while [[ $# -gt 0 ]]; do
155155
done
156156

157157
#[ -n "${dump_args}" ] && dumpArgs ; exit 2
158-
159158
if [ -z "${execute_mode-}" ]; then
160159
# no script was specified, set run or repl mode
161-
if [[ $options_indicator -ne 0 || ${#residual_args[@]} -ne 0 ]]; then
162-
setExecuteMode 'run'
163-
else
160+
if [[ $options_indicator -eq 0 && "${residual_args[@]-}" == "" ]]; then
164161
setExecuteMode 'repl'
162+
else
163+
setExecuteMode 'run'
165164
fi
166165
fi
167166

@@ -224,7 +223,7 @@ run)
224223
repl_cparg+="$PSEP$DOTTY_COMP$PSEP$TASTY_CORE$PSEP$DOTTY_INTF$PSEP$SCALA_ASM$PSEP$DOTTY_STAGING$PSEP$DOTTY_TASTY_INSPECTOR"
225224
fi
226225
# exec here would prevent onExit from being called, leaving terminal in unusable state
227-
eval "\"$JAVACMD\"" "$DEBUG" "-classpath \"$repl_cparg\"" "${java_args[@]}" "${residual_args[@]}"
226+
eval "\"$JAVACMD\"" "${DEBUG-}" "-classpath \"$repl_cparg\"" "${java_args[@]}" "${residual_args[@]}"
228227
scala_exit_status=$?
229228
;;
230229

0 commit comments

Comments
 (0)