Skip to content

Commit

Permalink
Fix #1376 - pending test
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed Apr 25, 2018
1 parent 8b90cd0 commit bc26584
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ WollokLauncherOptions_DISABLE_COLORS_REPL = Disables ANSI colors for the console
WollokLauncherOptions_SEVERAL_FILES = Allows to run several files alltogether
WollokLauncherOptions_SERVER_PORT = Server port for tests
WollokLauncherOptions_REQUEST_PORT = Request ports
WollokLauncherOptions_EVENT_PORT = Events ports
WollokLauncherOptions_EVENTS_PORT = Events ports
WollokLauncherOptions_SPECIFIC_FOLDER = Define a specific folder
WollokLauncherOptions_NUMBER_DECIMALS = Number of decimals to use in the printing and rounding
WollokLauncherOptions_DECIMAL_PRINTING_STRATEGY = Strategy to use when printing a number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ WollokLauncherOptions_DISABLE_COLORS_REPL = Deshabilita colores para la consola
WollokLauncherOptions_SEVERAL_FILES = Permite correr varios archivos a la vez
WollokLauncherOptions_SERVER_PORT = Puerto del server para correr los tests
WollokLauncherOptions_REQUEST_PORT = Puerto para hacer pedidos
WollokLauncherOptions_EVENT_PORT = Puerto para escuchar eventos
WollokLauncherOptions_EVENTS_PORT = Puerto para escuchar eventos
WollokLauncherOptions_SPECIFIC_FOLDER = Definir una carpeta espec\u00EDfica
WollokLauncherOptions_NUMBER_DECIMALS = Cantidad de decimales a usar para imprimir y redondear un n\u00FAmero
WollokLauncherOptions_DECIMAL_PRINTING_STRATEGY = Criterio a usar para imprimir un n\u00FAmero
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PROBLEM_LAUNCHING_WOLLOK = Problem launching wollok

ADD_LAUNCH_PLUGIN_DEPENDENCY = Please add dependency to plugin:

WollokMainTab_PROGRAM = &Program:
WollokMainTab_PROGRAM_FILE = &Program:
WollokMainTab_BROWSE = &Browse...
WollokMainTab_BROWSE_PROGRAM_TITLE = Wollok Program
WollokMainTab_BROWSE_PROGRAM_DESCRIPTION = Select Wollok Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

ADD_LAUNCH_PLUGIN_DEPENDENCY = Por favor agregue la dependencia al plugin:

WollokMainTab_PROGRAM = &Programa:
WollokMainTab_PROGRAM_FILE = &Programa:
WollokMainTab_BROWSE = &Buscar...
WollokMainTab_BROWSE_PROGRAM_TITLE = Programa Wollok
WollokMainTab_BROWSE_PROGRAM_DESCRIPTION = Seleccione el programa Wollok
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,13 @@ class WollokInterpreterEvaluator implements XInterpreterEvaluator<WollokObject>

def dispatch WollokObject evaluate(WVariableReference it) {
if (ref instanceof WNamedObject)
ref.eval
else
interpreter.currentContext.resolve(ref.name)
return ref.eval

val variableName = ref.name
if (variableName === null) {
throw new UnresolvableReference(Messages.LINKING_COULD_NOT_RESOLVE_REFERENCE.trim + " " + astNode.text.trim)
}
interpreter.currentContext.resolve(variableName)
}

def dispatch WollokObject evaluate(WIfExpression it) {
Expand Down Expand Up @@ -447,8 +451,13 @@ class WollokInterpreterEvaluator implements XInterpreterEvaluator<WollokObject>
*/
def performOpAndUpdateRef(WExpression reference, String operator, ()=>WollokObject rightPart) {
validateNullOperand(reference.eval, operator)
val variableName = (reference as WVariableReference).ref.name
if (variableName === null) {
throw new UnresolvableReference(Messages.LINKING_COULD_NOT_RESOLVE_REFERENCE.trim + " " + reference.astNode.text)
}
val newValue = operator.asBinaryOperation.apply(reference.eval, rightPart).javaToWollok
interpreter.currentContext.setReference((reference as WVariableReference).ref.name, newValue)

interpreter.currentContext.setReference(variableName, newValue)
WollokDSK.getVoid(interpreter as WollokInterpreter, reference)
}

Expand Down

0 comments on commit bc26584

Please sign in to comment.