Commit cfbf29f7 authored by Marcos Viera's avatar Marcos Viera
Browse files

funciona con matefun 0.7

parent c3539512
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
// export const GHCI_URL = 'ws://35.198.60.74:9090/endpoint'; // export const GHCI_URL = 'ws://35.198.60.74:9090/endpoint';
// psico // psico
// export const SERVER = 'https://matefun.math.psico.edu.uy'; export const SERVER = 'https://matefun.math.psico.edu.uy';
// export const GHCI_URL = 'wss://matefun.math.psico.edu.uy/endpoint'; export const GHCI_URL = 'wss://matefun.math.psico.edu.uy/endpoint';
//diego docker //diego docker
export const SERVER = 'http://localhost:8080'; // export const SERVER = 'http://localhost:8080';
export const GHCI_URL = 'ws://localhost:8080/endpoint'; //export const GHCI_URL = 'ws://localhost:8080/endpoint';
\ No newline at end of file \ No newline at end of file
...@@ -27,6 +27,7 @@ export class GHCIService { ...@@ -27,6 +27,7 @@ export class GHCIService {
private waitingForWarning : boolean = false; private waitingForWarning : boolean = false;
private waitingForWarning2 : boolean = false; private waitingForWarning2 : boolean = false;
private warningText :string = ""; private warningText :string = "";
private errorText :string = "";
private lastError : number = -1; private lastError : number = -1;
private lastWarning :number = -1; private lastWarning :number = -1;
translateService: any; translateService: any;
...@@ -135,12 +136,17 @@ export class GHCIService { ...@@ -135,12 +136,17 @@ export class GHCIService {
var line = -1; var line = -1;
if(this.waitingForError){ if(this.waitingForError){
var line = this.lastError; var line = this.lastError;
var columna = this.errorText.split(`${this.translateService.get('i18n.codemirror.command.column').value}:`)[1].split("}")[0];
var ErrorTextToShow = JSON.parse(text).resultado.split("OUT")[1].trim();
var ErrorFinalText = `${this.translateService.get('i18n.codemirror.command.inColumn').value}` + columna + ": " + ErrorTextToShow;
if(this.codemirrorRef!==null){ if(this.codemirrorRef!==null){
var makeMarker = function() { var makeMarker = function() {
var marker = document.createElement("div"); var marker = document.createElement("div");
marker.id = "error_" + line.toString(); marker.id = "error_" + line.toString();
marker.style.width = "15px"; marker.style.width = "15px";
marker.title = JSON.parse(text).resultado.split("OUT")[1].trim(); marker.title = ErrorFinalText;
marker.style.height = "15px"; marker.style.height = "15px";
marker.style.marginLeft = "-5px"; marker.style.marginLeft = "-5px";
marker.style.cursor = "pointer"; marker.style.cursor = "pointer";
...@@ -154,11 +160,16 @@ export class GHCIService { ...@@ -154,11 +160,16 @@ export class GHCIService {
} }
}else { }else {
try{ try{
var lineTxt = `${this.translateService.get('i18n.codemirror.command.inLine').value}`; var m = JSON.parse(text);
var line = m.resultado
var line = Number(JSON.parse(text).resultado.split(lineTxt)[1].split(",")[0].trim())-1; .split(`${this.translateService.get('i18n.codemirror.command.outError').value}:`)[1]
.trim()
.split(`${this.translateService.get('i18n.codemirror.command.line').value}:`)[1]
.split(" ")[1]-1;
this.waitingForError = true; this.waitingForError = true;
this.lastError = line; this.lastError = line;
this.errorText = m.resultado.split(`${this.translateService.get('i18n.codemirror.command.outError').value}:`)[1].trim();
}catch(err){ }catch(err){
} }
......
...@@ -65,7 +65,8 @@ ...@@ -65,7 +65,8 @@
"column" : "column", "column" : "column",
"inColumn" : "In column", "inColumn" : "In column",
"line" : "line", "line" : "line",
"outWarning" : "OUTWarning" "outWarning" : "OUTWarning",
"outError" : "OUTError"
} }
}, },
"msg" : { "msg" : {
......
...@@ -62,16 +62,17 @@ ...@@ -62,16 +62,17 @@
"codemirror" : { "codemirror" : {
"command" : { "command" : {
"inLine" : "en linea", "inLine" : "en linea",
"column" : "column", "column" : "columna",
"inColumn" : "En columna", "inColumn" : "En columna",
"line" : "line", "line" : "linea",
"outWarning" : "OUTWarning" "outWarning" : "OUTAdvertencia",
"outError" : "OUTError"
} }
}, },
"msg" : { "msg" : {
"404" : { "404" : {
"title": "Página no encontrada", "title": "Página no encontrada",
"descrp": "Lo sentimos, esta páina no existe.", "descrp": "Lo sentimos, esta página no existe.",
"return": "Volver" "return": "Volver"
}, },
"codemirror" : { "codemirror" : {
......
<!doctype html><html><head><meta charset="utf-8"><title>Proyecto MateFun</title><base href="/"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" type="image/x-icon" href="favicon.ico"><!-- despues lo saco de aca --><!-- <link rel="stylesheet" type="text/css" href="node_modules/codemirror/addon/hint/show-hint.css"> --><script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" crossorigin="anonymous"></script><!-- <!doctype html><html><head><meta charset="utf-8"><title>Proyecto MateFun</title><base href="/"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" type="image/x-icon" href="favicon.ico"><!-- despues lo saco de aca --><!-- <link rel="stylesheet" type="text/css" href="node_modules/codemirror/addon/hint/show-hint.css"> --><script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" crossorigin="anonymous"></script><!--
<script src="https://wzrd.in/standalone/function-plot@1.18.1" crossorigin="anonymous"></script> <script src="https://wzrd.in/standalone/function-plot@1.18.1" crossorigin="anonymous"></script>
--><link href="styles.8e9b76ce39821b2f5328.bundle.css" rel="stylesheet"/></head><body><app-root><div class="loading"><div class="loading-bar"></div><div class="loading-bar"></div><div class="loading-bar"></div><div class="loading-bar"></div><div class="loading-bar"></div></div></app-root><script type="text/javascript" src="inline.5c62427195e11ca1e3fb.bundle.js"></script><script type="text/javascript" src="polyfills.d50ac7c762e2eb4097d9.bundle.js"></script><script type="text/javascript" src="scripts.d01654a9119059a68b2b.bundle.js"></script><script type="text/javascript" src="vendor.d3c1758890cc7548bc7b.bundle.js"></script><script type="text/javascript" src="main.94941e96a5bd65bdeb71.bundle.js"></script></body></html> --><link href="styles.8e9b76ce39821b2f5328.bundle.css" rel="stylesheet"/></head><body><app-root><div class="loading"><div class="loading-bar"></div><div class="loading-bar"></div><div class="loading-bar"></div><div class="loading-bar"></div><div class="loading-bar"></div></div></app-root><script type="text/javascript" src="inline.7b1a129376036326039f.bundle.js"></script><script type="text/javascript" src="polyfills.d50ac7c762e2eb4097d9.bundle.js"></script><script type="text/javascript" src="scripts.d01654a9119059a68b2b.bundle.js"></script><script type="text/javascript" src="vendor.d3c1758890cc7548bc7b.bundle.js"></script><script type="text/javascript" src="main.94941e96a5bd65bdeb71.bundle.js"></script></body></html>
\ No newline at end of file \ No newline at end of file
...@@ -7,17 +7,17 @@ msgstr "" ...@@ -7,17 +7,17 @@ msgstr ""
"PO-Revision-Date: 2009-01-13 06:05-0800\n" "PO-Revision-Date: 2009-01-13 06:05-0800\n"
"Last-Translator: Automatically generated\n" "Last-Translator: Automatically generated\n"
"Language-Team: none\n" "Language-Team: none\n"
"Language: en\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/MateFun/ReservedNames.hs:20 #: src/MateFun/ReservedNames.hs:20
msgid "3D Figure" msgid "3D Figure"
msgstr "3D Figure" msgstr "3D Figure"
#: src/MateFun.hs:359 #: src/MateFun.hs:360
msgid "3D Figures" msgid "3D Figures"
msgstr "3D Figures" msgstr "3D Figures"
...@@ -73,7 +73,7 @@ msgstr "Circular inclusion" ...@@ -73,7 +73,7 @@ msgstr "Circular inclusion"
msgid "Color" msgid "Color"
msgstr "Color" msgstr "Color"
#: src/MateFun.hs:360 #: src/MateFun.hs:361
msgid "Colors" msgid "Colors"
msgstr "Colors" msgstr "Colors"
...@@ -121,9 +121,9 @@ msgstr "Enables function usage warnings" ...@@ -121,9 +121,9 @@ msgstr "Enables function usage warnings"
msgid "Enables verbose mode" msgid "Enables verbose mode"
msgstr "Enables verbose mode" msgstr "Enables verbose mode"
#: src/MateFun.hs:322 #: src/MateFun/TypeCheck.hs:51
msgid "Error in line" msgid "Error"
msgstr "Error in line" msgstr "Error"
#: src/MateFun.hs:126 #: src/MateFun.hs:126
msgid "Error reading command to interpretate." msgid "Error reading command to interpretate."
...@@ -145,7 +145,7 @@ msgstr "FILE" ...@@ -145,7 +145,7 @@ msgstr "FILE"
msgid "Figure" msgid "Figure"
msgstr "Figure" msgstr "Figure"
#: src/MateFun.hs:358 #: src/MateFun.hs:359
msgid "Figures" msgid "Figures"
msgstr "Figures" msgstr "Figures"
...@@ -157,7 +157,7 @@ msgstr "Found" ...@@ -157,7 +157,7 @@ msgstr "Found"
msgid "Function" msgid "Function"
msgstr "Function" msgstr "Function"
#: src/MateFun.hs:373 #: src/MateFun.hs:374
msgid "Graph" msgid "Graph"
msgstr "Graph" msgstr "Graph"
...@@ -169,11 +169,16 @@ msgstr "Gray" ...@@ -169,11 +169,16 @@ msgstr "Gray"
msgid "Green" msgid "Green"
msgstr "Green" msgstr "Green"
#: src/MateFun.hs:356 #: src/MateFun.hs:357
msgid "Integer" msgid "Integer"
msgstr "Integer" msgstr "Integer"
#: src/MateFun.hs:340 #: src/MateFun/TypeCheck.hs:88
#, fuzzy
msgid "Interpreter"
msgstr "Interpreter Commands:"
#: src/MateFun.hs:341
msgid "Interpreter Commands:" msgid "Interpreter Commands:"
msgstr "Interpreter Commands:" msgstr "Interpreter Commands:"
...@@ -217,7 +222,7 @@ msgstr "PATH" ...@@ -217,7 +222,7 @@ msgstr "PATH"
msgid "Please report this error with code" msgid "Please report this error with code"
msgstr "Please report this error with code" msgstr "Please report this error with code"
#: src/MateFun.hs:357 #: src/MateFun.hs:358
msgid "Real" msgid "Real"
msgstr "Real" msgstr "Real"
...@@ -265,6 +270,10 @@ msgstr "Value" ...@@ -265,6 +270,10 @@ msgstr "Value"
msgid "Variable" msgid "Variable"
msgstr "Variable" msgstr "Variable"
#: src/MateFun/Warning.hs:23
msgid "Warning"
msgstr "Warning"
#: src/MateFun.hs:57 #: src/MateFun.hs:57
msgid "Web Mode" msgid "Web Mode"
msgstr "Web Mode" msgstr "Web Mode"
...@@ -313,7 +322,7 @@ msgstr "color" ...@@ -313,7 +322,7 @@ msgstr "color"
msgid "color3D" msgid "color3D"
msgstr "color3D" msgstr "color3D"
#: src/MateFun.hs:322 #: src/MateFun/TypeCheck.hs:90
msgid "column" msgid "column"
msgstr "column" msgstr "column"
...@@ -357,7 +366,7 @@ msgstr "exit" ...@@ -357,7 +366,7 @@ msgstr "exit"
msgid "expression" msgid "expression"
msgstr "expression" msgstr "expression"
#: src/MateFun.hs:175 src/MateFun/Parser.hs:217 #: src/MateFun.hs:175 src/MateFun/Parser.hs:217 src/MateFun/TypeCheck.hs:89
msgid "file" msgid "file"
msgstr "file" msgstr "file"
...@@ -413,7 +422,7 @@ msgstr "join" ...@@ -413,7 +422,7 @@ msgstr "join"
msgid "join3D" msgid "join3D"
msgstr "join3D" msgstr "join3D"
#: src/MateFun/ReservedNames.hs:34 #: src/MateFun/ReservedNames.hs:34 src/MateFun/TypeCheck.hs:89
msgid "line" msgid "line"
msgstr "line" msgstr "line"
...@@ -465,7 +474,7 @@ msgstr "plot a function R -> R" ...@@ -465,7 +474,7 @@ msgstr "plot a function R -> R"
msgid "poli" msgid "poli"
msgstr "poli" msgstr "poli"
#: src/MateFun.hs:360 #: src/MateFun.hs:361
msgid "predefined" msgid "predefined"
msgstr "predefined" msgstr "predefined"
...@@ -572,3 +581,6 @@ msgstr "vars" ...@@ -572,3 +581,6 @@ msgstr "vars"
#: src/MateFun/ReservedNames.hs:96 #: src/MateFun/ReservedNames.hs:96
msgid "was defined more than once. Defined in:" msgid "was defined more than once. Defined in:"
msgstr "was defined more than once. Defined in:" msgstr "was defined more than once. Defined in:"
#~ msgid "Error in line"
#~ msgstr "Error in line"
...@@ -7,17 +7,17 @@ msgstr "" ...@@ -7,17 +7,17 @@ msgstr ""
"PO-Revision-Date: 2009-01-13 06:05-0800\n" "PO-Revision-Date: 2009-01-13 06:05-0800\n"
"Last-Translator: Automatically generated\n" "Last-Translator: Automatically generated\n"
"Language-Team: none\n" "Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/MateFun/ReservedNames.hs:20 #: src/MateFun/ReservedNames.hs:20
msgid "3D Figure" msgid "3D Figure"
msgstr "Figura 3D" msgstr "Figura 3D"
#: src/MateFun.hs:359 #: src/MateFun.hs:360
msgid "3D Figures" msgid "3D Figures"
msgstr "Figuras 3D" msgstr "Figuras 3D"
...@@ -73,7 +73,7 @@ msgstr "Inclusion Circular" ...@@ -73,7 +73,7 @@ msgstr "Inclusion Circular"
msgid "Color" msgid "Color"
msgstr "Color" msgstr "Color"
#: src/MateFun.hs:360 #: src/MateFun.hs:361
msgid "Colors" msgid "Colors"
msgstr "Colors" msgstr "Colors"
...@@ -111,8 +111,7 @@ msgstr "Habilita las advertencias de uso de funciones aritmeticas" ...@@ -111,8 +111,7 @@ msgstr "Habilita las advertencias de uso de funciones aritmeticas"
#: src/MateFun.hs:59 #: src/MateFun.hs:59
msgid "Enables domain intersection check on functions to load" msgid "Enables domain intersection check on functions to load"
msgstr "" msgstr "Habilita chequeo de interseccion de dominios en las funciones a ser cargadas"
"Habilita chequeo de interseccion de dominios en las funciones a ser cargadas"
#: src/MateFun.hs:53 #: src/MateFun.hs:53
msgid "Enables function usage warnings" msgid "Enables function usage warnings"
...@@ -122,9 +121,9 @@ msgstr "Habilita las advertencias de uso de funciones" ...@@ -122,9 +121,9 @@ msgstr "Habilita las advertencias de uso de funciones"
msgid "Enables verbose mode" msgid "Enables verbose mode"
msgstr "Habilita modo verboso" msgstr "Habilita modo verboso"
#: src/MateFun.hs:322 #: src/MateFun/TypeCheck.hs:51
msgid "Error in line" msgid "Error"
msgstr "Error en linea" msgstr "Error"
#: src/MateFun.hs:126 #: src/MateFun.hs:126
msgid "Error reading command to interpretate." msgid "Error reading command to interpretate."
...@@ -146,7 +145,7 @@ msgstr "ARCHIVO" ...@@ -146,7 +145,7 @@ msgstr "ARCHIVO"
msgid "Figure" msgid "Figure"
msgstr "Figura" msgstr "Figura"
#: src/MateFun.hs:358 #: src/MateFun.hs:359
msgid "Figures" msgid "Figures"
msgstr "Figuras" msgstr "Figuras"
...@@ -158,7 +157,7 @@ msgstr "Se encontro" ...@@ -158,7 +157,7 @@ msgstr "Se encontro"
msgid "Function" msgid "Function"
msgstr "Funcion" msgstr "Funcion"
#: src/MateFun.hs:373 #: src/MateFun.hs:374
msgid "Graph" msgid "Graph"
msgstr "Grafica" msgstr "Grafica"
...@@ -170,11 +169,16 @@ msgstr "Gris" ...@@ -170,11 +169,16 @@ msgstr "Gris"
msgid "Green" msgid "Green"
msgstr "Verde" msgstr "Verde"
#: src/MateFun.hs:356 #: src/MateFun.hs:357
msgid "Integer" msgid "Integer"
msgstr "Enteros" msgstr "Enteros"
#: src/MateFun.hs:340 #: src/MateFun/TypeCheck.hs:88
#, fuzzy
msgid "Interpreter"
msgstr "Comandos del Interprete"
#: src/MateFun.hs:341
msgid "Interpreter Commands:" msgid "Interpreter Commands:"
msgstr "Comandos del Interprete" msgstr "Comandos del Interprete"
...@@ -218,7 +222,7 @@ msgstr "RUTA" ...@@ -218,7 +222,7 @@ msgstr "RUTA"
msgid "Please report this error with code" msgid "Please report this error with code"
msgstr "Por favor avisar de este error con codigo" msgstr "Por favor avisar de este error con codigo"
#: src/MateFun.hs:357 #: src/MateFun.hs:358
msgid "Real" msgid "Real"
msgstr "Reales" msgstr "Reales"
...@@ -266,6 +270,10 @@ msgstr "Valor" ...@@ -266,6 +270,10 @@ msgstr "Valor"
msgid "Variable" msgid "Variable"
msgstr "Variable" msgstr "Variable"
#: src/MateFun/Warning.hs:23
msgid "Warning"
msgstr "Advertencia"
#: src/MateFun.hs:57 #: src/MateFun.hs:57
msgid "Web Mode" msgid "Web Mode"
msgstr "Modo Web" msgstr "Modo Web"
...@@ -314,7 +322,7 @@ msgstr "color" ...@@ -314,7 +322,7 @@ msgstr "color"
msgid "color3D" msgid "color3D"
msgstr "color3D" msgstr "color3D"
#: src/MateFun.hs:322 #: src/MateFun/TypeCheck.hs:90
msgid "column" msgid "column"
msgstr "columna" msgstr "columna"
...@@ -358,7 +366,7 @@ msgstr "salir" ...@@ -358,7 +366,7 @@ msgstr "salir"
msgid "expression" msgid "expression"
msgstr "expresion" msgstr "expresion"
#: src/MateFun.hs:175 src/MateFun/Parser.hs:217 #: src/MateFun.hs:175 src/MateFun/Parser.hs:217 src/MateFun/TypeCheck.hs:89
msgid "file" msgid "file"
msgstr "archivo" msgstr "archivo"
...@@ -414,7 +422,7 @@ msgstr "juntar" ...@@ -414,7 +422,7 @@ msgstr "juntar"
msgid "join3D" msgid "join3D"
msgstr "juntar3D" msgstr "juntar3D"
#: src/MateFun/ReservedNames.hs:34 #: src/MateFun/ReservedNames.hs:34 src/MateFun/TypeCheck.hs:89
msgid "line" msgid "line"
msgstr "linea" msgstr "linea"
...@@ -466,7 +474,7 @@ msgstr "grafica una funcion de R -> R" ...@@ -466,7 +474,7 @@ msgstr "grafica una funcion de R -> R"
msgid "poli" msgid "poli"
msgstr "poli" msgstr "poli"
#: src/MateFun.hs:360 #: src/MateFun.hs:361
msgid "predefined" msgid "predefined"
msgstr "predefinidos" msgstr "predefinidos"
...@@ -573,3 +581,6 @@ msgstr "vars" ...@@ -573,3 +581,6 @@ msgstr "vars"
#: src/MateFun/ReservedNames.hs:96 #: src/MateFun/ReservedNames.hs:96
msgid "was defined more than once. Defined in:" msgid "was defined more than once. Defined in:"
msgstr "se definio mas de una vez. Definida en" msgstr "se definio mas de una vez. Definida en"
#~ msgid "Error in line"
#~ msgstr "Error en linea"
...@@ -17,7 +17,7 @@ msgstr "" ...@@ -17,7 +17,7 @@ msgstr ""
msgid "3D Figure" msgid "3D Figure"
msgstr "" msgstr ""
#: src/MateFun.hs:359 #: src/MateFun.hs:360
msgid "3D Figures" msgid "3D Figures"
msgstr "" msgstr ""
...@@ -74,7 +74,7 @@ msgstr "" ...@@ -74,7 +74,7 @@ msgstr ""
msgid "Color" msgid "Color"
msgstr "" msgstr ""
#: src/MateFun.hs:360 #: src/MateFun.hs:361
msgid "Colors" msgid "Colors"
msgstr "" msgstr ""
...@@ -122,8 +122,8 @@ msgstr "" ...@@ -122,8 +122,8 @@ msgstr ""
msgid "Enables verbose mode" msgid "Enables verbose mode"
msgstr "" msgstr ""
#: src/MateFun.hs:322 #: src/MateFun