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ACtBz3B,EAAK0zC,eAAc,gCAClB,CAAE9mC,GAAIA,EAAIi2B,QAAS7iC,IAAM,2CACjC,qDAR+B,IAQ9B,SACyB/b,QAAQ+e,IAAIuwC,GAAW,OAA5CI,EAAe,EAAH,KACT7wD,EAAI,EAAC,YAAEA,EAAI6wD,EAAa9wD,QAAM,iBAGC,GAFhC+wD,EAAWD,EAAa7wD,GACxB+wD,EAAWD,EAAS/Q,QAAQpL,OAAO7f,MACnCk8B,EAAUF,EAAS/Q,QAAQ7Z,OACrBloB,OAASgzC,EAAQnB,UAAU9vD,OAAM,iBACuD,OAAlGo5C,OAAO8X,UAAUznC,GAAAA,WAA4B,gCAAiC,CAACsnC,EAAShnC,GAAK,KAAK,mBAC3F,GAAK,QAES,GAAnBinC,EAAShxD,QACXo5C,OAAO8X,UAAUznC,GAAAA,WAA4B,yBAA0B,CAACsnC,EAAShnC,GAAK,KAExFwmC,EAAcQ,EAAShnC,IAAI6qB,OAASoc,EAAS,UAXJ/wD,EAAC,uBAapB,OAAxBqwD,EAASC,GAAe,mBACjB,GAAI,2DAEJnvD,QAAQT,OAAO,EAAD,KAAO,0DAE/B,yBC1BD,IAAMwwD,GAAW,CACfC,YAAa,GACb3pB,UAAW,GACX4pB,UAAW,GACX7kC,SAAU,GACV2a,OAAQ,IAGJsR,GAAOD,GAAWC,KAClBhvB,GAAmBoP,I","sources":["webpack://vcat/webpack/universalModuleDefinition","webpack://vcat/./i18n/error.csv","webpack://vcat/./i18n/message.csv","webpack://vcat/./i18n/ui.csv","webpack://vcat/./node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack://vcat/./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack://vcat/./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","webpack://vcat/./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack://vcat/./node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack://vcat/./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://vcat/./node_modules/@babel/runtime/helpers/construct.js","webpack://vcat/./node_modules/@babel/runtime/helpers/createClass.js","webpack://vcat/./node_modules/@babel/runtime/helpers/defineProperty.js","webpack://vcat/./node_modules/@babel/runtime/helpers/get.js","webpack://vcat/./node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack://vcat/./node_modules/@babel/runtime/helpers/inherits.js","webpack://vcat/./node_modules/@babel/runtime/helpers/isNativeFunction.js","webpack://vcat/./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js","webpack://vcat/./node_modules/@babel/runtime/helpers/iterableToArray.js","webpack://vcat/./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack://vcat/./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack://vcat/./node_modules/@babel/runtime/helpers/nonIterableSpread.js","webpack://vcat/./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack://vcat/./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack://vcat/./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack://vcat/./node_modules/@babel/runtime/helpers/superPropBase.js","webpack://vcat/./node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js","webpack://vcat/./node_modules/@babel/runtime/helpers/toConsumableArray.js","webpack://vcat/./node_modules/@babel/runtime/helpers/typeof.js","webpack://vcat/./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack://vcat/./node_modules/@babel/runtime/helpers/wrapNativeSuper.js","webpack://vcat/./node_modules/@babel/runtime/regenerator/index.js","webpack://vcat/./node_modules/decimal.js/decimal.js","webpack://vcat/./node_modules/moo/moo.js","webpack://vcat/./node_modules/regenerator-runtime/runtime.js","webpack://vcat/webpack/bootstrap","webpack://vcat/webpack/runtime/compat get default export","webpack://vcat/webpack/runtime/define property getters","webpack://vcat/webpack/runtime/hasOwnProperty shorthand","webpack://vcat/webpack/runtime/make namespace object","webpack://vcat/./node_modules/line-i18n/dist/StringTypes.js","webpack://vcat/./src/util/config.ts","webpack://vcat/./node_modules/line-i18n/dist/LanguageService.js","webpack://vcat/./node_modules/line-i18n/dist/LocalizedStrings.js","webpack://vcat/./node_modules/line-i18n/dist/index.js","webpack://vcat/./node_modules/line-i18n/dist/LanguageServiceNoLS.js","webpack://vcat/./i18n/index.ts","webpack://vcat/./grammar/helper.ts","webpack://vcat/./grammar/lexer.ts","webpack://vcat/./grammar/pt/ivprog.ts","webpack://vcat/./grammar/en/ivprog.ts","webpack://vcat/./grammar/index.ts","webpack://vcat/./src/services/languageService.ts","webpack://vcat/./src/ast/commands/command.js","webpack://vcat/./src/ast/commands/break.js","webpack://vcat/./src/ast/commands/return.js","webpack://vcat/./src/ast/commands/assign.js","webpack://vcat/./src/ast/commands/arrayAssign.js","webpack://vcat/./src/ast/commands/declaration.js","webpack://vcat/./src/ast/commands/arrayDeclaration.js","webpack://vcat/./src/ast/commands/while.js","webpack://vcat/./src/ast/commands/for.js","webpack://vcat/./src/typeSystem/type.ts","webpack://vcat/./src/typeSystem/multiType.ts","webpack://vcat/./src/typeSystem/types.ts","webpack://vcat/./src/ast/commands/function.js","webpack://vcat/./src/ast/commands/ifThenElse.js","webpack://vcat/./src/ast/commands/commandBlock.js","webpack://vcat/./src/ast/commands/repeatUntil.js","webpack://vcat/./src/ast/expressions/expression.js","webpack://vcat/./src/ast/commands/switch.js","webpack://vcat/./src/ast/commands/case.js","webpack://vcat/./src/ast/commands/sysCall.js","webpack://vcat/./src/ast/commands/formalParameter.js","webpack://vcat/./src/ast/expressions/functionCall.js","webpack://vcat/./src/processor/modes.ts","webpack://vcat/./src/typeSystem/parsers.js","webpack://vcat/./src/processor/error/runtimeError.js","webpack://vcat/./src/processor/error/semanticError.js","webpack://vcat/./src/processor/error/processorErrorFactory.js","webpack://vcat/./src/processor/store/value/store_value.ts","webpack://vcat/./src/typeSystem/array_type.ts","webpack://vcat/./src/ast/expressions/arrayAccess.js","webpack://vcat/./src/ast/expressions/literal.js","webpack://vcat/./src/ast/expressions/intLiteral.js","webpack://vcat/./src/ast/expressions/realLiteral.js","webpack://vcat/./src/ast/expressions/boolLiteral.js","webpack://vcat/./src/ast/expressions/charLiteral.js","webpack://vcat/./src/ast/expressions/stringLiteral.js","webpack://vcat/./src/ast/expressions/arrayLiteral.js","webpack://vcat/./src/ast/expressions/variableLiteral.js","webpack://vcat/./src/ast/expressions/infixApp.js","webpack://vcat/./src/ast/expressions/unaryApp.js","webpack://vcat/./src/ast/sourceInfo.js","webpack://vcat/./src/ast/operators.ts","webpack://vcat/./src/ast/error/syntaxError.js","webpack://vcat/./src/ast/error/syntaxErrorFactory.js","webpack://vcat/./src/ast/ivprogParser.js","webpack://vcat/./src/processor/lib/math.js","webpack://vcat/./src/processor/definedFunctions.js","webpack://vcat/./src/processor/lib/io.js","webpack://vcat/./src/processor/lib/strings.js","webpack://vcat/./src/processor/lib/arrays.js","webpack://vcat/./src/processor/lib/lang.js","webpack://vcat/./src/services/localizedStringsService.js","webpack://vcat/./src/services/i18nHelper.js","webpack://vcat/./src/util/utils.js","webpack://vcat/./src/util/dataProcess.js","webpack://vcat/./src/util/parseFromVisual.js","webpack://vcat/./src/processor/compatibilityTable.ts","webpack://vcat/./src/memory/address.ts","webpack://vcat/./src/memory/location.ts","webpack://vcat/./src/processor/store/storeObject.ts","webpack://vcat/./src/processor/store/storeObjectRef.ts","webpack://vcat/./src/processor/store/value/store_value_address.ts","webpack://vcat/./src/processor/store/value/array_store_value.ts","webpack://vcat/./src/processor/store/storeObjectArray.ts","webpack://vcat/./src/processor/store/value/store_value_ref.ts","webpack://vcat/./src/processor/store/value/array_store_value_ref.ts","webpack://vcat/./src/processor/store/store_object_array_ref.ts","webpack://vcat/./src/processor/store/store.ts","webpack://vcat/./src/processor/semantic/semanticAnalyser.js","webpack://vcat/./src/processor/context.ts","webpack://vcat/./src/processor/ivprogProcessor.js","webpack://vcat/./src/util/inputTest.js","webpack://vcat/./src/io/input.js","webpack://vcat/./src/util/outputTest.js","webpack://vcat/./src/io/output.js","webpack://vcat/./src/util/auto_gen_output.js","webpack://vcat/./main.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vcat\"] = factory();\n\telse\n\t\troot[\"vcat\"] = factory();\n})(this, function() {\nreturn ","module.exports = {\"pt\":{\"token_missing_one\":\"Erro de sintaxe: Espera-se $0, mas encontrou-se $1 na linha:$2, coluna:$3\",\"token_missing_two\":\"Erro de sintaxe: Esperava-se $0 ou $1 mas encontrou-se $2 na liha:$3, coluna: $4\",\"eos_missing\":\"Falta uma nova linha ou ; na linha: $0, coluna: $1\",\"invalid_type\":\"$0 na linha: $1, coluna: $2 é um tipo inválido. Os tipos válidos são: $3\",\"invalid_array_dimension\":\"A dimensão inválida na linha: $0, coluna: $1. Insira um $2 ou identificador válido do mesmo tipo.\",\"invalid_array_size\":\"O tamnho do vetor/matriz excede o máximo de 2 na linha $0\",\"extra_lines\":\"Nenhum texto é permitido após '}' em 'programa {...}'\",\"invalid_main_return\":\"A função $0 declarada na linha $2 deve retornar $1.\",\"invalid_var_declaration\":\"Erro na linha $0: variáveis só podem ser declaradas no corpo principal da função e nas primeiras linhas, antes de qualquer comando.\",\"invalid_break_command\":\"Erro na linha $0. O comando $1 não pode ser usado fora de uma estrutura de repetição ou 'escolha...caso'\",\"invalid_terminal\":\"Não é possível utilizar $0 na expressão da linha: $1, coluna: $2. Tente um valor númerico, variável ou chamada de função.\",\"const_not_init\":\"Erro na linha: $0, coluna: $1. Uma variável declarada como const deve ser inicializada\",\"id_missing\":\"Esperava-se um identificador, mas encontrou-se $0 na linha: $1, coluna: $2\",\"invalid_id_format\":\"$0 na linha: $1, coluna: $2 não é um identificador válido. O símbolo '.' não é permitido neste contexto.\",\"main_missing\":\"A função principal não foi encontrada\",\"invalid_global_var\":\"Erro crítico: Chamada inválida da função initGlobal fora do contexto BASE\",\"not_implemented\":\"Erro interno crítico: A função definida pelo sistema $0 não foi implementada.\",\"function_missing\":\"A função $0 não foi encontrada\",\"function_missing_full\":\"A função $0 na linha: $1, coluna: $2 não foi encontrada\",\"invalid_parameters_size_full\":\"Erro na linha $0: a quantidade de parâmetros fornecidos à função $1 está incorreta. Esperava-se $2, encontrou-se $3.\",\"invalid_parameters_size\":\"A quantidade de parâmetros fornecidos à função $0 está incorreta. Esperava-se $1, encontrou-se $2\",\"invalid_ref_full\":\"A expressão $0 fornecida como parâmetro para a função $1 na linha $2 não é válida para esta função. Use uma variável ou posição de vetor.\",\"invalid_ref\":\"A expressão $0 fornecida como parâmetro para a função $1 não é válida para esta função. Use uma variável ou posição de vetor.\",\"invalid_parameter_type_full\":\"A expressão $0 fornecida como parâmetro para a função $1 na linha $2 não é compatível com o tipo esperado.\",\"invalid_parameter_type\":\"A expressão $0 fornecida como parâmetro para a função $1 não é compatível com o tipo esperado.\",\"unknown_command_full\":\"Erro interno crítico: comando desconhecido encontrado na linha $0\",\"unknown_command\":\"Erro interno crítico: comando desconhecido encontrado!\",\"loop_condition_type_full\":\"Erro na linha: $0, coluna $1: a condição $2 do laço de repetição deve ser do tipo lógico\",\"loop_condition_type\":\"A condição $0 do laço de repetição deve ser do tipo lógico\",\"endless_loop_full\":\"Possível laço infinito detectado no seu código. Verifique a linha $0\",\"endless_loop\":\"Possível laço infinito detectado no seu código.\",\"for_condition_type_full\":\"Erro na linha: $0, coluna $1: a condição de parada $2 do comando para(...) deve ser do tipo lógico\",\"for_condition_type\":\"A condição de parada $0 do comando para(...) deve ser do tipo lógico\",\"if_condition_type_full\":\"Erro na linha: $0, coluna $1: a condição $2 do comando se...senao deve ser do tipo lógico\",\"if_condition_type\":\"A condição $0 do comando se...senao deve ser do tipo lógico\",\"invalid_return_type_full\":\"Erro na linha $0: a expressão não produz um tipo compatível com a função $1. Tipo esperado: $2.\",\"invalid_return_type\":\"A expressão não produz um tipo compatível com a função $0. Tipo esperado: $1.\",\"invalid_void_return_full\":\"Erro na linha $0: a função $1 não pode retornar uma expressão vazia, use uma espressão do tipo $2\",\"invalid_void_return\":\"A função $0 não pode retornar uma expressão vazia, use uma espressão do tipo $1\",\"unexpected_break_command_full\":\"Erro interno crítico: comando pare encontrado fora do contexto de um laço/escolha..caso na linha $0\",\"unexpected_break_command\":\"Erro interno crítico: comando pare encontrado fora do contexto de um laço/escolha..caso\",\"invalid_dimension\":\"As dimensões de um vetor/matriz devem ser do tipo inteiro\",\"void_in_expression_full\":\"Erro na linha: $0, coluna: $1: a função $2 não pode ser utilizada em uma expressão pois seu tipo de retorno é vazio\",\"void_in_expression\":\"A função $0 não pode ser utilizada em uma expressão pois seu tipo de retorno é vazio\",\"invalid_array_access_full\":\"Identificador $0 na linha: $1, coluna: $2 não se refere a um vetor/matriz válido\",\"invalid_array_access\":\"Identificador $0 não se refere a um vetor/matriz válido\",\"invalid_matrix_access_full\":\"Identificador $0 na linha: $1, coluna: $2 não se refere a uma matriz válida\",\"invalid_matrix_access\":\"Identificador $0 não se refere a uma matriz válida\",\"matrix_column_outbounds_full\":\"Erro na linha $0: número de colunas $1 é inválido para a matriz $2 que possui $3 colunas\",\"matrix_column_outbounds\":\"Número de colunas $0 é inválido para a matriz $1 que possui $2 colunas\",\"matrix_line_outbounds_full\":\"Erro na linha $0: número de linhas $1 é inválido para a matriz $2 que possui $3 linhas\",\"matrix_line_outbounds\":\"Número de linhas $0 é inválido para a matriz $1 que possui $2 linhas\",\"vector_line_outbounds_full\":\"Erro na linha $0: O número de elementos $1 é inválido para a vetor $2 que possui $3 elementos.\",\"vector_line_outbounds\":\"O número de elementos $1 é inválido para a vetor $2 que possui $3 elementos.\",\"vector_not_matrix_full\":\"Erro na linha $0: $1 não é uma matriz\",\"vector_not_matrix\":\"$0 não é uma matriz\",\"invalid_infix_op_full\":\"Erro na linha $0: a expressão $1 é inválida, pois o operador $2 não pode ser aplicado aos tipos $3 e $4\",\"invalid_infix_op\":\"A expressão $0 é inválida, pois o operador $1 não pode ser aplicado aos tipos $2 e $3\",\"invalid_unary_op_full\":\"Erro na linha $0: a expressão $1 é inválida, pois o operador $2 não pode ser aplicado ao tipo $3\",\"invalid_unary_op\":\"A expressão $0 é inválida, pois o operador $1 não pode ser aplicado ao tipo $2\",\"unknown_op\":\"Erro interno crítico: Operação $0 desconhecida\",\"duplicate_function\":\"A função $0 na linha: $1, coluna: $2 já foi definida anteriormente.\",\"duplicate_variable\":\"A variável $0 na linha: $1, coluna: $2 já foi declarada anteriormente.\",\"main_parameters\":\"A função inicio não pode ter parâmetros.\",\"symbol_not_found_full\":\"A variável $0 na linha: $1, coluna: $2 não foi declarada\",\"symbol_not_found\":\"A variável $0 não foi declarada\",\"array_dimension_not_int_full\":\"As dimensões do arranjo (vetor ou matriz) na linha $0 devem ser do tipo inteiro.\",\"array_dimension_not_int\":\"As dimensões de um arranjo (vetor ou matriz) devem ser do tipo inteiro.\",\"array_dimension_not_positive_full\":\"As dimensões do arranjo (vetor ou matriz) na linha $0 devem ser valores positivos.\",\"array_dimension_not_positive\":\"As dimensões de um arranjo (vetor ou matriz) devem ser valores positivos.\",\"incompatible_types_full\":\"Era esperado um $0 mas a expressão $1 na linha $2 resulta em $3.\",\"incompatible_types\":\"Era esperado um $0 mas a expressão $1 resulta em $2.\",\"incompatible_types_array_full\":\"A expressão $0 na linha $2 é incompatível com o tipo $1.\",\"incompatible_types_array\":\"A expressão $0 é incompatível com o tipo $1.\",\"invalid_case_type_full\":\"O caso $0 na linha $1 é incompatível com o tipo $2.\",\"invalid_case_type\":\"O caso $0 é incompatível com o tipo $1.\",\"function_no_return\":\"A função $0 não possui um comando de devolução acessível. Toda função deve ter ao menos um comando 'devolva' no seu corpo principal.\",\"invalid_array_literal_type_full\":\"Erro na linha $0: a expressão $1 não resulta em um tipo compatível.\",\"invalid_array_literal_type\":\"A expressão $0 não resulta em um tipo compatível.\",\"invalid_array_literal_line_full\":\"Erro na linha $0: esperava-se $1 linhas mas encontrou $2.\",\"invalid_array_literal_line\":\"Esperava-se $0 linhas mas encontrou $1.\",\"invalid_array_literal_column_full\":\"Erro na linha $0: esperava-se $1 colunas mas encontrou $2.\",\"invalid_array_literal_column\":\"Esperava-se $0 colunas mas encontrou $1.\",\"exceeded_input_request\":\"A quantidade de leituras requisitadas execedeu a quantidade de entradas disponíveis.\",\"test_case_few_reads\":\"Caso de teste $0 falhou: ainda restam entradas!\",\"test_case_failed\":\"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\\\"$1\\\"> <span>Caso de teste $0 não executou com sucesso.</span></div>\",\"test_case_failed_exception\":\"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\\\"$2\\\"> <span>Caso de teste $0 falhou</span>: $1\",\"test_case_exception\":\"Ocorreu uma exceção no caso de teste $0: $1\",\"invalid_type_conversion\":\"O valor $0 não pode ser convertido para o tipo $1\",\"invalid_read_type\":\"Erro na linha $0: A entrada \\\"$1\\\" não é do tipo $2, que é o tipo da variável <span class='ivprog-error-varname'>$3</span>.\",\"invalid_read_type_array\":\"Erro na linha $0: A entrada \\\"$1\\\" não é do tipo $2, que é o tipo aceito pela variável <span class='ivprog-error-varname'>$3</span> que é um $4.\",\"inform_valid_identifier\":\"Informe um nome válido! O nome não pode ser uma palavra reservadas e deve começar com letras ou _ e conter apenas letras, números e _.\",\"inform_valid_global_duplicated\":\"Já existe uma variável global com o nome <span class='ivprog-error-varname'>$0</span>, você precisa de nomes distintos.\",\"inform_valid_variable_duplicated\":\"Já existe uma variável com o nome <span class='ivprog-error-varname'>$0</span> na função <span class='ivprog-error-varname'>$1</span>, você precisa de nomes distintos.\",\"inform_valid_function_duplicated\":\"Já existe uma função com o nome <span class='ivprog-error-varname'>$0</span>, você precisa de nomes distintos.\",\"inform_valid_param_duplicated\":\"Já existe um parâmetro com o nome <span class='ivprog-error-varname'>$0</span> na função <span class='ivprog-error-varname'>$1</span>, você precisa de nomes distintos.\",\"invalid_character\":\"O caractere $0 na linha $1 não pode ser utilizado neste contexto.\",\"invalid_syntax\":\"O iVProg não reconhece o texto $0 na linha $1. Certifique-se que não há erro de digitação ou caractere inválido.\",\"annonymous_array_literal\":\"Erro na linha $0: a notação de vetor/matriz só permitida durante a inicialização de uma variável desse tipo. Ex: inteiro vec[3] ← {1,2,3}.\",\"invalid_matrix_literal_line\":\"A expressão $0 na linha $1 não possui um número de elementos igual a linha anterior. Todas as linhas de uma matriz devem ter a mesma quantidade de elementos.\",\"cannot_infer_matrix_line\":\"Não é possível inferir o número de linhas da matriz $0 na linha $1. É necessário que ela seja inicializada ou que o valor seja informado de forma explícita.\",\"cannot_infer_matrix_column\":\"Não é possível inferir o número de colunas da matriz $0 na linha $1. É necessário que ela seja inicializada ou que o valor seja informado de forma explícita.\",\"cannot_infer_vector_size\":\"Não é possível inferir o número de elementos do vetor $0 na linha $1. É necessário que ele seja inicializado ou que o valor seja informado de forma explícita\",\"matrix_to_vector_literal_attr\":\"Erro na linha $0: A expressão $1 representa uma matriz e não pode ser atribuída ao vetor $2.\",\"vector_to_matrix_literal_attr\":\"Erro na linha $0: A expressão $1 representa um vetor e não pode ser atribuído a matriz $2.\",\"invalid_const_ref_full\":\"A variável $0 fornecida como parâmetro para a função $1 na linha $2 é uma constante e não pode ser usada neste contexto. Use uma variável ou posição de vetor.\",\"invalid_const_ref\":\"A variável $0 fornecida como parâmetro para a função $1 é uma constante e não pode ser usada neste contexto. Use uma variável ou posição de vetor.\",\"invalid_const_assignment_full\":\"Erro na linha $0: $1 é uma constante e portanto não pode ter seu valor alterado\",\"invalid_const_assignment\":\"$0 é uma constante e portanto não pode ter seu valor alterado\",\"array_init_not_literal\":\"Erro na linha $0: Vetor/Matriz só pode ser inicializado por literal. Ex: real vetor[] <- {1,2,3}\",\"array_exceeds_2d\":\"Erro na linha $0: O número máximo de dimensões que um arranjo pode ter é 2. Elemento de 3 ou mais dimensões encontrado!\",\"invalid_matrix_id_dimension\":\"Erro na linha $0: Você deve definir todas as dimensões da matriz quando uma delas é definida por uma variável! Ex: real mat1[var][5], mat2[5][var]\",\"invalid_vector_init\":\"Erro na linha $0: Não se pode inicializar um vetor que teve seu tamanho declarado utilizando uma variável! Utilize uma atribuição de vetores ou use um laço de repetição.\",\"invalid_matrix_init\":\"Erro na linha $0: Não se pode inicializar uma matrix que teve ao menos uma das suas dimensões declaradas utilizando uma variável! Utilize uma atribuição de matrizes ou use um laço de repetição.\",\"invalid_vector_assignment_full\":\"Erro na linha $0: Só se pode atribuir um vetor a outro desde que eles comportem o mesmo número de elementos. $1 comporta $2 e $3 comporta $4!\",\"invalid_vector_assignment\":\"Só se pode atribuir um vetor a outro desde que eles comportem o mesmo número de elementos. $0 comporta $1 e $2 comporta $3!\",\"invalid_matrix_assignment_full\":\"Erro na linha $0: Só se pode atribuir uma matriz a outra desde que ambas possuam dimensões de mesmo tamanho. $1 tem $2 linhas e $3 colunas, enquanto $4 possui $5 linhas e $6 colunas!\",\"invalid_matrix_assignment\":\"Só se pode atribuir uma matriz a outra desde que ambas possuam dimensões de mesmo tamanho. $0 tem $1 linhas e $2 colunas, enquanto $3 possui $4 linhas e $5 colunas!\",\"matrix_to_vector_attr\":\"Erro na linha $0: $1 representa uma matriz e não pode ser atribuída ao vetor $2.\",\"vector_to_matrix_attr\":\"Erro na linha $0: $1 representa um vetor e não pode ser atribuído a matriz $2.\",\"invalid_matrix_index_assign_full\":\"Erro na linha $0: A posição $1 da matriz $2 aceita apenas vetores de tamanho $3, mas $4 tem tamanho $5\",\"invalid_matrix_index_assign\":\"A linha $0 da matriz $1 aceita apenas vetores de tamanho $2, mas $3 tem tamanho $4\",\"invalid_number_elements_vector\":\"Esperava-se por $0 elementos na linha $1 mas a expressão $2 possui $3 elementos.\",\"invalid_number_lines_matrix\":\"Esperava-se por uma matriz com $0 linhas na linha $1 mas a expressão $2 possui $3 linhas\",\"divsion_by_zero_full\":\"Erro na linha $0: A expressão $1 resulta em uma divisão por 0.\",\"divsion_by_zero\":\"A expressão $0 resulta em uma divisão por 0.\",\"undefined_tanget_value\":\"Erro na linha $0: A tangente de $1° não é indefinida.\",\"negative_log_value\":\"Erro na linha $0: Não se pode calcular o log de um valor negativo.\",\"invalid_string_index\":\"Erro na linha $0 durante a execução da função $1: $2 é um índice inválido para a cadeia de texto $3. Os valores válidos vão de 0 à $4\",\"negative_sqrt_value\":\"Erro na linha $0: Não é permitido calcular a raiz quadrada de um número negativo.\",\"exceeded_recursive_calls\":\"Erro na execução da linha $0: Número de chamadas recursivas execedeu o limite máximo definido!\",\"invalid_for_variable\":\"Erro na linha $0: A variavel $1 utilizada no comando repita_para deve ser do tipo inteiro.\",\"invalid_for_from\":\"Erro na linha $0: O valor $1 passado para o parâmetro 'de' do comando repita_para deve ser do tipo inteiro.\",\"invalid_for_to\":\"Erro na linha $0: O valor $1 passado para o parâmetro 'para' do comando repita_para deve ser do tipo inteiro.\",\"invalid_for_pass\":\"Erro na linha $0: O valor $1 passado para o parâmetro 'passo' do comando repita_para deve ser do tipo inteiro.\",\"exceed_max_instructions\":\"Número de instruções excedeu o limite definido. Certifique-se que seu código não possui laços infinitos ou muitas chamadas de funções recursivas.\"},\"en\":{\"token_missing_one\":\"Syntax error: Expected $0 but found $1 at line:$2, column:$3\",\"token_missing_two\":\"Syntax error: Expected $0 or $1 but found $2 at line:$3, column: $4\",\"eos_missing\":\"A new line or a ‘;’ is missing at line: $0, column: $1\",\"invalid_type\":\"$0 at line: $1, column: $2 is a invalid type. The valid types are: $3\",\"invalid_array_dimension\":\"Invalid dimension at line: $0, column: $1. Insert a $2 or a valid identifier of the same type.\",\"invalid_array_size\":\"The array at line $0 exceeds the maximum size of 2.\",\"extra_lines\":\"No text is allowed after '}' in 'program { … }'\",\"invalid_main_return\":\"The function $0 declared at line $2 must return $1.\",\"invalid_var_declaration\":\"Error at line $0: Variables can only be declared in the main body of a function and at the first lines, before any command.\",\"invalid_break_command\":\"Error at line $0. The command $1 cannot be used outside a loop command or ‘switch ...case’ structure.\",\"invalid_terminal\":\"It is not possible to use $0 in the expression at line: $1, column: $2. Try a numeric value, variable or function call.\",\"const_not_init\":\"Error at line: $0, column: $1. A variable declared as const must be initialized.\",\"id_missing\":\"Expected an identifier but found $0 at line: $1, column: $2.\",\"invalid_id_format\":\"$0 at line: $1, column: $2 is not a valid identifier. The symbol '.' is not permitted in this context.\",\"main_missing\":\"The main function was not found. You need to declare a function of return type void named main.\",\"invalid_global_var\":\"Critical Error: Invalid call of the function IVProgProcessor.initGlobal outside the BASE context.\",\"not_implemented\":\"Critial internal error: The system defined function $0 was not found.\",\"function_missing\":\"The function $0 was not found.\",\"function_missing_full\":\"The function $0 at line: $1, column: $2 was not found.\",\"invalid_parameters_size_full\":\"Error at line $0: The number of parameters provided to the function $1 is incorrect. It expected $2 but found $3.\",\"invalid_parameters_size\":\"The number of parameters provided to the function $0 is incorrect. It expected $1 but found $2.\",\"invalid_ref_full\":\"The expression $0 provided as a parameter to the function $1 at line $2 is not valid in this context. Use a variable or a position of a vector.\",\"invalid_ref\":\"The expression $0 provided as a parameter to the function $1 is not valid in this context. Use a variable or a position of a vector.\",\"invalid_parameter_type_full\":\"The expression $0 provided as a parameter to the function $1 at line $2 is not of the expected type.\",\"invalid_parameter_type\":\"The expression $0 provided as a parameter to the function $1 is not of the expected type.\",\"unknown_command_full\":\"Internal error: an unknown command found at line $0.\",\"unknown_command\":\"Internal error: an unknown command found.\",\"loop_condition_type_full\":\"Error at line: $0, column $1: the condition $2 of the loop must be of type bool (true or false).\",\"loop_condition_type\":\"The condition $0 of the loop must be of type bool (true or false).\",\"endless_loop_full\":\"Possible infinite loop detected in your code. Check line $0.\",\"endless_loop\":\"Possible infinite loop detected in your code.\",\"for_condition_type_full\":\"Erro na linha: $0, coluna $1: a condição de parada $2 do comando para(...) deve ser do tipo lógico\",\"for_condition_type\":\"A condição de parada $0 do comando para(...) deve ser do tipo lógico\",\"if_condition_type_full\":\"Error at line: $0, column $1: the condition $2 in the if … else command must result in a bool (true or false).\",\"if_condition_type\":\"The condition $0 in the if … else command must result in a bool (true or false).\",\"invalid_return_type_full\":\"Error at line $0: The expression doest not result in a type compatible with the function $1.  Expected type: $2.\",\"invalid_return_type\":\"The expression doest not result in a type compatible with the function $0.  Expected type: $1.\",\"invalid_void_return_full\":\"Error at line $0: The function $1 cannot return an empty expression, use an expression that results in a $2\",\"invalid_void_return\":\"The function $0 cannot return an empty expression, use an expression that results in a $1\",\"unexpected_break_command_full\":\"Critical error at line $0:  a break command was found outside a valid context: loop or switch … case structure.\",\"unexpected_break_command\":\"Critical error:  a break command was found outside a valid context: loop or switch … case structure.\",\"invalid_dimension\":\"Array (vector or matrix) dimensions must be of type int.\",\"void_in_expression_full\":\"Error at line: $0, column: $1: The function $2 cannot be used inside an expression since its return type is void.\",\"void_in_expression\":\"The function $0 cannot be used inside an expression since its return type is void.\",\"invalid_array_access_full\":\"Identifier $0 at line: $1, column: $2 does not identify a valid vector or matrix.\",\"invalid_array_access\":\"Identifier $0 does not identify a valid vector or matrix.\",\"invalid_matrix_access_full\":\"Identifier $0 at line: $1, column: $2 does not identify a valid matrix.\",\"invalid_matrix_access\":\"Identifier $0 does not identify a valid matrix.\",\"matrix_column_outbounds_full\":\"Error at line $0: The number of columns $1 is invalid for the matrix $2 which has $3 columns.\",\"matrix_column_outbounds\":\"The number of columns $0 is invalid for the matrix $1 which has $2 columns.\",\"matrix_line_outbounds_full\":\"Error at line $0: The number of lines $1 is invalid for matrix $2 which has $3 lines.\",\"matrix_line_outbounds\":\"The number of lines $0 is invalid for matrix $1 which has $2 lines.\",\"vector_line_outbounds_full\":\"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.\",\"vector_line_outbounds\":\"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.\",\"vector_not_matrix_full\":\"Error at line $0: $1 is not a matrix.\",\"vector_not_matrix\":\"$0 is not a matrix.\",\"invalid_infix_op_full\":\"Error at line $0:  The expression $1 is not valid because the operator $2 cannot be applied to the types $3 and $4.\",\"invalid_infix_op\":\"The expression $0 is not valid because the operator $1 cannot be applied to the types $2 and $3.\",\"invalid_unary_op_full\":\"Error at line $0:  The expression $1 is not valid because the operator $2 cannot be applied to the type $3.\",\"invalid_unary_op\":\"The expression $0 is not valid because the operator $1 cannot be applied to the type $2.\",\"unknown_op\":\"Critical error: Unknown operator $0.\",\"duplicate_function\":\"The function $0 at line: $1, column: $2 has already been declared.\",\"duplicate_variable\":\"The variable $0 at line: $1, column: $2 has already been declared.\",\"main_parameters\":\"The main function cannot have parameters.\",\"symbol_not_found_full\":\"The variable $0 at line: $1, column: $2 has not been declared.\",\"symbol_not_found\":\"The variable $0 has not been declared.\",\"array_dimension_not_int_full\":\"The array (vector or matrix) dimensions at line $0 must be of type int.\",\"array_dimension_not_int\":\"An array (vector or matrix) dimensions must be of type int.\",\"array_dimension_not_positive_full\":\"The array (vector or matrix) dimensions at line $0 must be positive.\",\"array_dimension_not_positive\":\"An array (vector or matrix) dimensions must be positive.\",\"incompatible_types_full\":\"It expected $0 but the expression $1 at line $2 results in $3.\",\"incompatible_types\":\"It expected $0 but the expression $1 results in $2.\",\"incompatible_types_array_full\":\"The expression $0 at line $2 is not compatible with type $1.\",\"incompatible_types_array\":\"The expression $0 is not compatible with type $1.\",\"invalid_case_type_full\":\"The case expression $0 at line $1 is not compatible with type $2.\",\"invalid_case_type\":\"The case expression $0 is not compatible with type $1.\",\"function_no_return\":\"The function $0 does not have a reacheable return command. Every function must have at least one return command in its main body.\",\"invalid_array_literal_type_full\":\"Error at line $0: the expression $1 does not result in a compatible type.\",\"invalid_array_literal_type\":\"The expression $0 does not result in a compatible type.\",\"invalid_array_literal_line_full\":\"Error at line $0: it expected $1 lines but found $2.\",\"invalid_array_literal_line\":\"It expected $0 lines but found $1.\",\"invalid_array_literal_column_full\":\"Error at line $0: it expected $1 column but found $2.\",\"invalid_array_literal_column\":\"It expected $0 column but found $1.\",\"exceeded_input_request\":\"The amount of reads requested exceeded the amount of inputs available.\",\"test_case_few_reads\":\"Teste case $0 failed: there are available inputs remaining.\",\"test_case_failed\":\"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\\\"$1\\\"> <span>Test case $0 did not executed successfully.</span></div>\",\"test_case_failed_exception\":\"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\\\"$2\\\"> <span>Test case $0 failed</span>: $1\",\"test_case_exception\":\"An exception has ocurred during the execution of test case $0: $1\",\"invalid_type_conversion\":\"The value $0 cannot be converted to type $1.\",\"invalid_read_type\":\"Error at line $0: The input \\\"$1\\\" is not of type $2 which is the type of the variable <span class='ivprog-error-varname'>$3</span>.\",\"invalid_read_type_array\":\"Error at line $0: The input \\\"$1\\\" is not of type $2 which is the type  accepted by the variable <span class='ivprog-error-varname'>$3</span> of type $4.\",\"inform_valid_identifier\":\"Enter a valid identifier! The identifier cannot be a reserved word and it must begin with a letter or _, followed by numbers, letters and _ only.\",\"inform_valid_global_duplicated\":\"A global variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each gloval variable.\",\"inform_valid_variable_duplicated\":\"A variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each variable.\",\"inform_valid_function_duplicated\":\"A function named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each function.\",\"inform_valid_param_duplicated\":\"A parameter named <span class='ivprog-error-varname'>$0</span> already exists in function <span class='ivprog-error-varname'>$1</span>, you need distinc names for each parameter.\",\"invalid_character\":\"The character $0 at line $1 cannot be used in this context.\",\"invalid_syntax\":\"iVProg does not recognize the text $0 at line $1. Check for typos or invalid character.\",\"annonymous_array_literal\":\"Error at line $0: the array notation is only permitted during initialization of an array variable. i. e.: int vec[3] ← {1, 2, 3}.\",\"invalid_matrix_literal_line\":\"The expression $0 at line $1 does not have the same number of elements as the last line. All lines of a matrix must have the same number of elements.\",\"cannot_infer_matrix_line\":\"It is not possible to infer the number of lines of matrix $0 at line $1. It must be initialized or have its lines explicitly declared.\",\"cannot_infer_matrix_column\":\"It is not possible to infer the number of columns of matrix $0 at line $1. It must be initialized or have its columns explicitly declared.\",\"cannot_infer_vector_size\":\"It is not possible to infer the number of elements of vector $0 at line $1. It must be initialized or have its size explicitly declard.\",\"matrix_to_vector_literal_attr\":\"Error at line $0: The expression $1 represents a matrix and cannot be assigned to the vector $2.\",\"vector_to_matrix_literal_attr\":\"Error at line $0: The expression $1 represents a vector and cannot be assigned to the matrix $2.\",\"invalid_const_ref_full\":\"The variable $0 provided as a parameter to the function $1 at line $2 is a constant and cannot be used in this context. Use a non-constant variable or vector position.\",\"invalid_const_ref\":\"The variable $0 provided as a parameter to the function $1 is a constant and cannot be used in this context. Use a non-constant variable or vector position.\",\"invalid_const_assignment_full\":\"Error at line $0: $1 is a constant e therefore cannot have its value changed.\",\"invalid_const_assignment\":\"$0 is a constant e therefore cannot have its value changed.\",\"array_init_not_literal\":\"Error at line $0: An array (vector or matrix) can only be initialized by an array literal. i.e : real vector[] <- {1,2,3}\",\"array_exceeds_2d\":\"Error at line $0: The maximum number of dimensions an array can have is 2. An element of 3 or dimensions was found.\",\"invalid_matrix_id_dimension\":\"Error at line $0: You must define all dimensions of the matrix when one of them is defined by a variable! i.e: real mat1[var][5], mat2[5][var]\",\"invalid_vector_init\":\"Error at line $0: You cannot initialize a vector when its size is defined by a variable. Use a vector assignment or loop command.\",\"invalid_matrix_init\":\"Error at line $0: You cannot initialize a matrix when one of its dimensions is defined by a variable. Use a matrix assignment or loop command.\",\"invalid_vector_assignment_full\":\"Error at line $0: You can only assign a vector to another when both have the same number of elements. $1 has $2 and $3 has $4 elements!\",\"invalid_vector_assignment\":\"You can only assign a vector to another when both have the same number of elements. $0 has $1 and $2 has $3 elements!\",\"invalid_matrix_assignment_full\":\"Error at line $0: You can only assign a matrix to another when both have dimensions of the same size. $1 has $2 lines e $3 columns while $4 has $5 lines and $6 columns!\",\"invalid_matrix_assignment\":\"You can only assign a matrix to another when both have dimensions of the same size. $0 has $1 lines e $2 columns while $3 has $4 lines and $5 columns!\",\"matrix_to_vector_attr\":\"Error at line $0: $1 represents a matrix and cannot be assigned to the vector $2.\",\"vector_to_matrix_attr\":\"Error at line $0: $1 represents a vector and cannot be assigned to the matrix $2.\",\"invalid_matrix_index_assign_full\":\"Error at line $0: The position $1 of the matrix $2 only accepts vectors of size $3 but $4 has size $5.\",\"invalid_matrix_index_assign\":\"The position $0 of the matrix $1 only accepts vectors of size $2 but $3 has size $4.\",\"invalid_number_elements_vector\":\"It expected $0 elements at line $1 but the expression $2 has $3 elements.\",\"invalid_number_lines_matrix\":\"It expected a matrix with $0 lines at line $1 but the expression $2 has $3 lines.\",\"divsion_by_zero_full\":\"Error at line $0: The expression $1 resuts in a division by zero.\",\"divsion_by_zero\":\"The expression $0 resuts in a division by zero.\",\"undefined_tanget_value\":\"Error at line $0: The tangent of $1° is undefined.\",\"negative_log_value\":\"Error at line $0: You cannot calculate the logarithm of a negative value.\",\"invalid_string_index\":\"Error at line $0 during the execution of the function $1: $2 is an invalid index for the text string $3. The valid indexes go from 0 to $4.\",\"negative_sqrt_value\":\"Error at line $0: It is not allowd to calculate the square root of a negative number.\",\"exceeded_recursive_calls\":\"Error during the execution of line $0: The number of recursive calls exceeded the allowed number of calls.\",\"invalid_for_variable\":\"Error at line $0: The variable $1 used in the repeat_for command must be of type int.\",\"invalid_for_from\":\"Error at line $0: The value $1 passed to the parameter 'from' of the repeat_for command must be of type int.\",\"invalid_for_to\":\"Error at line $0: The value $1 passed to the parameter 'to' of the repeat_for command must be of type int.\",\"invalid_for_pass\":\"Error at line $0: The value $1 passed to the parameter 'pass' of the repeat_for command must be of type int.\",\"exceed_max_instructions\":\"The number of instructions executed by your program exceed the defined limit. Check your code for infinite loops or excessive recursive functions calls.\"},\"es\":{\"token_missing_one\":\"Syntax error: Expected $0 but found $1 at line:$2, column:$3\",\"token_missing_two\":\"Syntax error: Expected $0 or $1 but found $2 at line:$3, column: $4\",\"eos_missing\":\"A new line or a ‘;’ is missing at line: $0, column: $1\",\"invalid_type\":\"$0 at line: $1, column: $2 is a invalid type. The valid types are: $3\",\"invalid_array_dimension\":\"Invalid dimension at line: $0, column: $1. Insert a $2 or a valid identifier of the same type.\",\"invalid_array_size\":\"The array at line $0 exceeds the maximum size of 2.\",\"extra_lines\":\"No text is allowed after '}' in 'program { … }'\",\"invalid_main_return\":\"The function $0 declared at line $2 must return $1.\",\"invalid_var_declaration\":\"Error at line $0: Variables can only be declared in the main body of a function and at the first lines, before any command.\",\"invalid_break_command\":\"Error at line $0. The command $1 cannot be used outside a loop command or ‘switch ...case’ structure.\",\"invalid_terminal\":\"It is not possible to use $0 in the expression at line: $1, column: $2. Try a numeric value, variable or function call.\",\"const_not_init\":\"Error at line: $0, column: $1. A variable declared as const must be initialized.\",\"id_missing\":\"Expected an identifier but found $0 at line: $1, column: $2.\",\"invalid_id_format\":\"$0 at line: $1, column: $2 is not a valid identifier. The symbol '.' is not permitted in this context.\",\"main_missing\":\"The main function was not found. You need to declare a function of return type void named main.\",\"invalid_global_var\":\"Critical Error: Invalid call of the function IVProgProcessor.initGlobal outside the BASE context.\",\"not_implemented\":\"Critial internal error: The system defined function $0 was not found.\",\"function_missing\":\"The function $0 was not found.\",\"function_missing_full\":\"The function $0 at line: $1, column: $2 was not found.\",\"invalid_parameters_size_full\":\"Error at line $0: The number of parameters provided to the function $1 is incorrect. It expected $2 but found $3.\",\"invalid_parameters_size\":\"The number of parameters provided to the function $0 is incorrect. It expected $1 but found $2.\",\"invalid_ref_full\":\"The expression $0 provided as a parameter to the function $1 at line $2 is not valid in this context. Use a variable or a position of a vector.\",\"invalid_ref\":\"The expression $0 provided as a parameter to the function $1 is not valid in this context. Use a variable or a position of a vector.\",\"invalid_parameter_type_full\":\"The expression $0 provided as a parameter to the function $1 at line $2 is not of the expected type.\",\"invalid_parameter_type\":\"The expression $0 provided as a parameter to the function $1 is not of the expected type.\",\"unknown_command_full\":\"Internal error: an unknown command found at line $0.\",\"unknown_command\":\"Internal error: an unknown command found.\",\"loop_condition_type_full\":\"Error at line: $0, column $1: the condition $2 of the loop must be of type bool (true or false).\",\"loop_condition_type\":\"The condition $0 of the loop must be of type bool (true or false).\",\"endless_loop_full\":\"Possible infinite loop detected in your code. Check line $0.\",\"endless_loop\":\"Possible infinite loop detected in your code.\",\"for_condition_type_full\":\"Erro na linha: $0, coluna $1: a condição de parada $2 do comando para(...) deve ser do tipo lógico\",\"for_condition_type\":\"A condição de parada $0 do comando para(...) deve ser do tipo lógico\",\"if_condition_type_full\":\"Error at line: $0, column $1: the condition $2 in the if … else command must result in a bool (true or false).\",\"if_condition_type\":\"The condition $0 in the if … else command must result in a bool (true or false).\",\"invalid_return_type_full\":\"Error at line $0: The expression doest not result in a type compatible with the function $1.  Expected type: $2.\",\"invalid_return_type\":\"The expression doest not result in a type compatible with the function $0.  Expected type: $1.\",\"invalid_void_return_full\":\"Error at line $0: The function $1 cannot return an empty expression, use an expression that results in a $2\",\"invalid_void_return\":\"The function $0 cannot return an empty expression, use an expression that results in a $1\",\"unexpected_break_command_full\":\"Critical error at line $0:  a break command was found outside a valid context: loop or switch … case structure.\",\"unexpected_break_command\":\"Critical error:  a break command was found outside a valid context: loop or switch … case structure.\",\"invalid_dimension\":\"Array (vector or matrix) dimensions must be of type int.\",\"void_in_expression_full\":\"Error at line: $0, column: $1: The function $2 cannot be used inside an expression since its return type is void.\",\"void_in_expression\":\"The function $0 cannot be used inside an expression since its return type is void.\",\"invalid_array_access_full\":\"Identifier $0 at line: $1, column: $2 does not identify a valid vector or matrix.\",\"invalid_array_access\":\"Identifier $0 does not identify a valid vector or matrix.\",\"invalid_matrix_access_full\":\"Identifier $0 at line: $1, column: $2 does not identify a valid matrix.\",\"invalid_matrix_access\":\"Identifier $0 does not identify a valid matrix.\",\"matrix_column_outbounds_full\":\"Error at line $0: The number of columns $1 is invalid for the matrix $2 which has $3 columns.\",\"matrix_column_outbounds\":\"The number of columns $0 is invalid for the matrix $1 which has $2 columns.\",\"matrix_line_outbounds_full\":\"Error at line $0: The number of lines $1 is invalid for matrix $2 which has $3 lines.\",\"matrix_line_outbounds\":\"The number of lines $0 is invalid for matrix $1 which has $2 lines.\",\"vector_line_outbounds_full\":\"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.\",\"vector_line_outbounds\":\"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.\",\"vector_not_matrix_full\":\"Error at line $0: $1 is not a matrix.\",\"vector_not_matrix\":\"$0 is not a matrix.\",\"invalid_infix_op_full\":\"Error at line $0:  The expression $1 is not valid because the operator $2 cannot be applied to the types $3 and $4.\",\"invalid_infix_op\":\"The expression $0 is not valid because the operator $1 cannot be applied to the types $2 and $3.\",\"invalid_unary_op_full\":\"Error at line $0:  The expression $1 is not valid because the operator $2 cannot be applied to the type $3.\",\"invalid_unary_op\":\"The expression $0 is not valid because the operator $1 cannot be applied to the type $2.\",\"unknown_op\":\"Critical error: Unknown operator $0.\",\"duplicate_function\":\"The function $0 at line: $1, column: $2 has already been declared.\",\"duplicate_variable\":\"The variable $0 at line: $1, column: $2 has already been declared.\",\"main_parameters\":\"The main function cannot have parameters.\",\"symbol_not_found_full\":\"The variable $0 at line: $1, column: $2 has not been declared.\",\"symbol_not_found\":\"The variable $0 has not been declared.\",\"array_dimension_not_int_full\":\"The array (vector or matrix) dimensions at line $0 must be of type int.\",\"array_dimension_not_int\":\"An array (vector or matrix) dimensions must be of type int.\",\"array_dimension_not_positive_full\":\"The array (vector or matrix) dimensions at line $0 must be positive.\",\"array_dimension_not_positive\":\"An array (vector or matrix) dimensions must be positive.\",\"incompatible_types_full\":\"It expected $0 but the expression $1 at line $2 results in $3.\",\"incompatible_types\":\"It expected $0 but the expression $1 results in $2.\",\"incompatible_types_array_full\":\"The expression $0 at line $2 is not compatible with type $1.\",\"incompatible_types_array\":\"The expression $0 is not compatible with type $1.\",\"invalid_case_type_full\":\"The case expression $0 at line $1 is not compatible with type $2.\",\"invalid_case_type\":\"The case expression $0 is not compatible with type $1.\",\"function_no_return\":\"The function $0 does not have a reacheable return command. Every function must have at least one return command in its main body.\",\"invalid_array_literal_type_full\":\"Error at line $0: the expression $1 does not result in a compatible type.\",\"invalid_array_literal_type\":\"The expression $0 does not result in a compatible type.\",\"invalid_array_literal_line_full\":\"Error at line $0: it expected $1 lines but found $2.\",\"invalid_array_literal_line\":\"It expected $0 lines but found $1.\",\"invalid_array_literal_column_full\":\"Error at line $0: it expected $1 column but found $2.\",\"invalid_array_literal_column\":\"It expected $0 column but found $1.\",\"exceeded_input_request\":\"The amount of reads requested exceeded the amount of inputs available.\",\"test_case_few_reads\":\"Teste case $0 failed: there are available inputs remaining.\",\"test_case_failed\":\"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\\\"$1\\\"> <span>Test case $0 did not executed successfully.</span></div>\",\"test_case_failed_exception\":\"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\\\"$2\\\"> <span>Test case $0 failed</span>: $1\",\"test_case_exception\":\"An exception has ocurred during the execution of test case $0: $1\",\"invalid_type_conversion\":\"The value $0 cannot be converted to type $1.\",\"invalid_read_type\":\"Error at line $0: The input \\\"$1\\\" is not of type $2 which is the type of the variable <span class='ivprog-error-varname'>$3</span>.\",\"invalid_read_type_array\":\"Error at line $0: The input \\\"$1\\\" is not of type $2 which is the type  accepted by the variable <span class='ivprog-error-varname'>$3</span> of type $4.\",\"inform_valid_identifier\":\"Enter a valid identifier! The identifier cannot be a reserved word and it must begin with a letter or _, followed by numbers, letters and _ only.\",\"inform_valid_global_duplicated\":\"A global variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each gloval variable.\",\"inform_valid_variable_duplicated\":\"A variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each variable.\",\"inform_valid_function_duplicated\":\"A function named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each function.\",\"inform_valid_param_duplicated\":\"A parameter named <span class='ivprog-error-varname'>$0</span> already exists in function <span class='ivprog-error-varname'>$1</span>, you need distinc names for each parameter.\",\"invalid_character\":\"The character $0 at line $1 cannot be used in this context.\",\"invalid_syntax\":\"iVProg does not recognize the text $0 at line $1. Check for typos or invalid character.\",\"annonymous_array_literal\":\"Error at line $0: the array notation is only permitted during initialization of an array variable. i. e.: int vec[3] ← {1, 2, 3}.\",\"invalid_matrix_literal_line\":\"The expression $0 at line $1 does not have the same number of elements as the last line. All lines of a matrix must have the same number of elements.\",\"cannot_infer_matrix_line\":\"It is not possible to infer the number of lines of matrix $0 at line $1. It must be initialized or have its lines explicitly declared.\",\"cannot_infer_matrix_column\":\"It is not possible to infer the number of columns of matrix $0 at line $1. It must be initialized or have its columns explicitly declared.\",\"cannot_infer_vector_size\":\"It is not possible to infer the number of elements of vector $0 at line $1. It must be initialized or have its size explicitly declard.\",\"matrix_to_vector_literal_attr\":\"Error at line $0: The expression $1 represents a matrix and cannot be assigned to the vector $2.\",\"vector_to_matrix_literal_attr\":\"Error at line $0: The expression $1 represents a vector and cannot be assigned to the matrix $2.\",\"invalid_const_ref_full\":\"The variable $0 provided as a parameter to the function $1 at line $2 is a constant and cannot be used in this context. Use a non-constant variable or vector position.\",\"invalid_const_ref\":\"The variable $0 provided as a parameter to the function $1 is a constant and cannot be used in this context. Use a non-constant variable or vector position.\",\"invalid_const_assignment_full\":\"Error at line $0: $1 is a constant e therefore cannot have its value changed.\",\"invalid_const_assignment\":\"$0 is a constant e therefore cannot have its value changed.\",\"array_init_not_literal\":\"Error at line $0: An array (vector or matrix) can only be initialized by an array literal. i.e : real vector[] <- {1,2,3}\",\"array_exceeds_2d\":\"Error at line $0: The maximum number of dimensions an array can have is 2. An element of 3 or dimensions was found.\",\"invalid_matrix_id_dimension\":\"Error at line $0: You must define all dimensions of the matrix when one of them is defined by a variable! i.e: real mat1[var][5], mat2[5][var]\",\"invalid_vector_init\":\"Error at line $0: You cannot initialize a vector when its size is defined by a variable. Use a vector assignment or loop command.\",\"invalid_matrix_init\":\"Error at line $0: You cannot initialize a matrix when one of its dimensions is defined by a variable. Use a matrix assignment or loop command.\",\"invalid_vector_assignment_full\":\"Error at line $0: You can only assign a vector to another when both have the same number of elements. $1 has $2 and $3 has $4 elements!\",\"invalid_vector_assignment\":\"You can only assign a vector to another when both have the same number of elements. $0 has $1 and $2 has $3 elements!\",\"invalid_matrix_assignment_full\":\"Error at line $0: You can only assign a matrix to another when both have dimensions of the same size. $1 has $2 lines e $3 columns while $4 has $5 lines and $6 columns!\",\"invalid_matrix_assignment\":\"You can only assign a matrix to another when both have dimensions of the same size. $0 has $1 lines e $2 columns while $3 has $4 lines and $5 columns!\",\"matrix_to_vector_attr\":\"Error at line $0: $1 represents a matrix and cannot be assigned to the vector $2.\",\"vector_to_matrix_attr\":\"Error at line $0: $1 represents a vector and cannot be assigned to the matrix $2.\",\"invalid_matrix_index_assign_full\":\"Error at line $0: The position $1 of the matrix $2 only accepts vectors of size $3 but $4 has size $5.\",\"invalid_matrix_index_assign\":\"The position $0 of the matrix $1 only accepts vectors of size $2 but $3 has size $4.\",\"invalid_number_elements_vector\":\"It expected $0 elements at line $1 but the expression $2 has $3 elements.\",\"invalid_number_lines_matrix\":\"It expected a matrix with $0 lines at line $1 but the expression $2 has $3 lines.\",\"divsion_by_zero_full\":\"Error at line $0: The expression $1 resuts in a division by zero.\",\"divsion_by_zero\":\"The expression $0 resuts in a division by zero.\",\"undefined_tanget_value\":\"Error at line $0: The tangent of $1° is undefined.\",\"negative_log_value\":\"Error at line $0: You cannot calculate the logarithm of a negative value.\",\"invalid_string_index\":\"Error at line $0 during the execution of the function $1: $2 is an invalid index for the text string $3. The valid indexes go from 0 to $4.\",\"negative_sqrt_value\":\"Error at line $0: It is not allowd to calculate the square root of a negative number.\",\"exceeded_recursive_calls\":\"Error during the execution of line $0: The number of recursive calls exceeded the allowed number of calls.\",\"invalid_for_variable\":\"Error at line $0: The variable $1 used in the repeat_for command must be of type int.\",\"invalid_for_from\":\"Error at line $0: The value $1 passed to the parameter 'from' of the repeat_for command must be of type int.\",\"invalid_for_to\":\"Error at line $0: The value $1 passed to the parameter 'to' of the repeat_for command must be of type int.\",\"invalid_for_pass\":\"Error at line $0: The value $1 passed to the parameter 'pass' of the repeat_for command must be of type int.\",\"exceed_max_instructions\":\"The number of instructions executed by your program exceed the defined limit. Check your code for infinite loops or excessive recursive functions calls.\"}}","module.exports = {\"pt\":{\"test_case_success\":\"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\\\"$1\\\"><span>Caso de teste $0</span>: OK</div>\",\"test_case_duration\":\"Levou $0ms\",\"test_suite_grade\":\"A sua solução alcançou $0% da nota.\",\"awaiting_input_message\":\"O seu programa está em execução e aguardando uma entrada! Digite algo e pressione ENTER...\",\"assessment-empty-expected-tooltip\":\"A saída gerada foi além do esperado\",\"assessment-empty-generated-tooltip\":\"O programa não gerou saídas suficientes\",\"testcase_autogen_unused_input\":\"A solução submetida não lê todas entradas disponíveis no caso de teste 1\",\"testcase_autogen_empty\":\"Sua solução não gerou qualquer saída para o caso de teste $0.\",\"success_execution\":\"Execução do programa finalizada!\",\"aborted_execution\":\"A execução do programa foi interrompida!\",\"unexpected_execution_error\":\"Erro inesperado durante a execução do programa.\"},\"en\":{\"test_case_success\":\"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\\\"$1\\\"><span>Test case $0</span>: OK</div>\",\"test_case_duration\":\"Took $0ms\",\"test_suite_grade\":\"Your solution scored $0% of the grade.\",\"awaiting_input_message\":\"Your program is running and awaiting for an input. Type something and press ENTER…\",\"assessment-empty-expected-tooltip\":\"The generated output was beyond the amount expected\",\"assessment-empty-generated-tooltip\":\"The program did not generate enough outputs\",\"testcase_autogen_unused_input\":\"The submitted solution does not read all inputs available in the test case $0\",\"testcase_autogen_empty\":\"Your solution did not generate any output for test case $0.\",\"success_execution\":\"Program execution finished!\",\"aborted_execution\":\"Program execution was aborted!\",\"unexpected_execution_error\":\"Unexpected error during program execution.\"},\"es\":{\"test_case_success\":\"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\\\"$1\\\"><span>Test case $0</span>: OK</div>\",\"test_case_duration\":\"Tardó $0ms\",\"test_suite_grade\":\"Su solución obtuvo $0% de la calificación.\",\"awaiting_input_message\":\"Su programa se está ejecutando y esperando una entrada. Escriba algo y presione ENTER ...\",\"assessment-empty-expected-tooltip\":\"The generated output was beyond the amount expected\",\"assessment-empty-generated-tooltip\":\"El programa no generó suficientes resultados.\",\"testcase_autogen_unused_input\":\"La solución presentada no lee todas las entradas disponibles en el caso de prueba 1\",\"testcase_autogen_empty\":\"Su solución no generó ningún resultado para el caso de prueba de $ 0.\",\"success_execution\":\"¡Ejecución del programa terminada!\",\"aborted_execution\":\"¡La ejecución del programa fue abortada!\",\"unexpected_execution_error\":\"Error inesperado durante la ejecución del programa.\"}}","module.exports = {\"pt\":{\"function\":\"funcao\",\"btn_clear\":\"Limpar\",\"btn_function\":\"Função\",\"btn_arithmetic_plus\":\"Adição\",\"btn_arithmetic_minus\":\"Subtração\",\"btn_arithmetic_multiplication\":\"Multiplicação\",\"btn_arithmetic_division\":\"Divisão\",\"btn_arithmetic_module\":\"Módulo\",\"btn_break\":\"Pare\",\"btn_case\":\"Caso\",\"btn_add_var\":\"Adicionar variável\",\"btn_drag_and_drop_function\":\"Mover função\",\"btn_delete_function\":\"Excluir função\",\"expression_invalid\":\"Expressão inválida. Verifique a sintáxe antes de continuar.\",\"expression_undelcared_variable\":\"Variáveis não declaradas:\",\"expression_undeclared_function\":\"Funções não definidas:\",\"start\":\"inicio\",\"type_void\":\"vazio\",\"type_integer\":\"inteiro\",\"logic_operator_and\":\"E\",\"logic_operator_or\":\"OU\",\"logic_operator_not\":\"nao\",\"type_real\":\"real\",\"program\":\"programa\",\"type_text\":\"cadeia\",\"textvar_default_value\":\"texto\",\"type_boolean\":\"logico\",\"logic_value_true\":\"verdadeiro\",\"logic_value_false\":\"falso\",\"variable\":\"Variável\",\"command\":\"Comando\",\"new_parameter\":\"parametro\",\"new_variable\":\"variavel\",\"new_global\":\"global\",\"new_function\":\"nova_funcao\",\"matrix\":\"matriz\",\"vector\":\"vetor\",\"text_lock_expression\":\"Bloquear expressão\",\"text_unlock_expression\":\"Desbloquear expressão\",\"text_edit_expression\":\"Editar expressão manualmente\",\"text_edit_expression_confirm\":\"Confirmar edição\",\"text_edit_expression_cancel\":\"Cancelar edição\",\"text_add_function\":\"Adicionar uma nova função ao programa\",\"text_move_command\":\"Mover comando\",\"text_add_parameters\":\"Adicionar um novo parâmetro\",\"text_parameter_reference\":\"Definir parâmetro como passagem por referência\",\"text_parameter_copy\":\"Definir parâmetro como passagem por cópia\",\"text_comment_start\":\"Comentário inicial da função...\",\"text_comment_main\":\"Esta é a função principal...\",\"text_read_var\":\"Entrada/Leitura de dados\",\"text_write_var\":\"Saída/Escrita de dados\",\"text_command_read\":\"leia\",\"text_command_write\":\"escreva\",\"text_return\":\"devolva\",\"text_btn_return\":\"Devolver\",\"text_comment\":\"Comentário\",\"string_join_or\":\"ou\",\"matrix_info_string\":\"matriz de $0\",\"vector_info_string\":\"vetor de $0\",\"text_attribution\":\"Atribuição\",\"text_if\":\"se\",\"text_break\":\"pare\",\"text_else\":\"senao\",\"text_for\":\"repita_para\",\"text_code_while\":\"repita_enquanto\",\"text_code_do\":\"repita\",\"text_code_do_until\":\"ate_que\",\"text_command_do\":\"repita\",\"text_command_while\":\"repita enquanto\",\"text_command_do_until\":\"até que\",\"text_code_switch\":\"escolha\",\"text_code_case\":\"caso\",\"text_config_programming\":\"Programação\",\"text_config_programming_both\":\"Visual e textual\",\"text_config_programming_textual\":\"Textual\",\"text_config_programming_visual\":\"Visual\",\"text_logic_expression\":\"Lógicos\",\"text_arithmetic_expression\":\"Aritméticos\",\"text_iftrue\":\"Se condição senão\",\"text_message_error_activity_file\":\"Aconteceu um erro ao processar a atividade. <br> Recarregue a página para tentar novamente.\",\"text_message_error_upload_file\":\"Não foi possível carregar o arquivo.<br>Verifique o conteúdo do arquivo e tente novamente.\",\"text_message_error_upload_close\":\"Fechar\",\"text_message_error_activity_reload\":\"Recarregar\",\"text_repeatNtimes\":\"Repita N vezes\",\"text_receives\":\"recebe\",\"text_whiletrue\":\"Enquanto verdadeiro\",\"text_dowhiletrue\":\"Repita até que verdadeiro\",\"text_switch\":\"Escolha\",\"text_functioncall\":\"Chamada de função\",\"text_value\":\"Valor\",\"text_operator\":\"Operador\",\"text_parentheses\":\"Parênteses\",\"text_change\":\"Alterar\",\"text_teacher_algorithm\":\"Algoritmo\",\"text_teacher_algorithm_include\":\"Incluir o algoritmo abaixo no exercício\",\"text_teacher_test_case\":\"Casos de teste\",\"text_teacher_config\":\"Configurações\",\"text_teacher_data_types\":\"Tipos de dados\",\"text_teacher_commands\":\"Comandos\",\"text_teacher_functions\":\"Funções\",\"text_teacher_create_functions\":\"Criar novas funções\",\"text_teacher_create_movement_functions\":\"Movimentar funções\",\"text_teacher_test_case_input\":\"Entrada\",\"text_teacher_test_case_output\":\"Saída\",\"text_teacher_test_case_actions\":\"Ações\",\"text_teacher_test_case_add\":\"Adicionar caso de teste\",\"text_header_ivprog_functions\":\"Funções do iVProg\",\"text_menu_functions_math\":\"Matemática\",\"text_menu_functions_text\":\"Texto\",\"text_menu_functions_array\":\"Arranjo\",\"text_menu_functions_conversion\":\"Conversão\",\"text_no_variable\":\"Nenhuma variável declarada\",\"text_no_variable_instruction\":\"Antes de utilizar uma variável, é necessário criá-la\",\"text_ivprog_description\":\"Programação Visual interativa na Internet\",\"tooltip_visual\":\"Programação visual\",\"tooltip_textual\":\"Programação textual\",\"tooltip_upload\":\"Upload de código fonte\",\"tooltip_download\":\"Download do código fonte\",\"tooltip_undo\":\"Desfazer\",\"tooltip_redo\":\"Refazer\",\"tooltip_run\":\"Executar o programa\",\"tooltip_evaluate\":\"Avaliar o programa\",\"tooltip_help\":\"Ajuda\",\"tooltip_add_global\":\"Adicionar variável global\",\"tooltip_hide_function\":\"Ocultar os elementos da função\",\"var_menu_select_var\":\"Selecione uma variável\",\"var_menu_select_all\":\"Selecione\",\"var_menu_select_function\":\"Selecione uma função\",\"expression_menu_select\":\"Construir uma expressão lógica\",\"inform_valid_content\":\"Informe o conteúdo!\",\"inform_valid_expression\":\"Construa uma expressão lógica!\",\"tooltip_terminal_clear\":\"Limpa o terminal removendo todos os textos já escritos e os pendentes.\",\"tooltip_terminal_show\":\"Exibe o terminal caso esteja escondido\",\"tooltip_terminal_hide\":\"Esconde o terminal caso não esteja escondido\",\"tooltip_menu_read\":\"Comando para receber dados pelo teclado\",\"tooltip_menu_write\":\"Comando para apresentar conteúdo ao usuário\",\"tooltip_menu_comments\":\"Bloco para comentários internos do programador\",\"tooltip_menu_attribution\":\"Comando para atribuir uma expressão a uma variável\",\"tooltip_menu_call_function\":\"Comando para realizar a chamada de uma função\",\"tooltip_menu_if_else\":\"Estrutura para que os comandos só sejam executados de acordo com as condições estabelecidas\",\"tooltip_menu_repeat_n_times\":\"Estrutura para executar um bloco de comandos repetidamente\",\"tooltip_menu_repeat_whiletrue\":\"Estrutura para repetir um bloco de comandos enquanto a condição for verdadeira\",\"tooltip_menu_repeat_dowhiletrue\":\"Estrutura que executa um bloco e o repete enquanto a condição for verdadeira\",\"tooltip_menu_repeat_switch\":\"Estrutura de escolha do bloco a ser executado\",\"tooltip_menu_repeat_return\":\"Comando para devolver o resultado e finalizar a função\",\"tooltip_move_var\":\"Mover variável\",\"tooltip_remove_var\":\"Excluir variável\",\"text_ivprog_version\":\"Versão\",\"text_teacher_filter\":\"Filtro\",\"text_teacher_filter_active\":\"Ativado\",\"text_teacher_filter_help\":\"Ao ativar o filtro, as modificações do iVProg estarão bloqueadas.\",\"text_join_assessment_outputs\":\" ; \",\"assessment-detail-time-label\":\"Duração\",\"assessment-detail-grade-label\":\"Nota\",\"assessment-detail-input-label\":\"Entradas\",\"assessment-detail-output-label\":\"Saídas\",\"assessment-detail-expected-label\":\"Esperava\",\"assessment-detail-generated-label\":\"Gerou\",\"assessment-detail-result-label\":\"Correção\",\"assessment-detail-title\":\"Caso de Teste $0\",\"text_teacher_generate_outputs\":\"Gerar saídas\",\"text_teacher_generate_outputs_algorithm\":\"Antes de gerar as saídas, elabore um algoritmo!\",\"text_code_for_from\":\"de\",\"text_code_for_to\":\"ate\",\"text_code_for_pass\":\"passo\",\"text_for_from\":\"de\",\"text_for_to\":\"até\",\"text_for_pass\":\"passo\",\"text_relational_expression\":\"Relacionais\",\"write_command_newline_on\":\"Quebra de linha ativada\",\"write_command_newline_off\":\" Quebra de linha desativada\",\"write_seprator_menu_text\":\"Espaço\",\"initial_program_code\":\"programa {\\\\n\\\\n\\\\t\\\\tfuncao vazio inicio () {\\\\n\\\\t\\\\t\\\\t// Inicie seu codigo aqui!\\\\n\\\\t\\\\t}\\\\n}\",\"type_char\":\"caractere\",\"charvar_default_value\":\"A\",\"write_seprator_menu_tooltip\":\"Separador para imprimir mais valores/variáveis\"},\"en\":{\"function\":\"function\",\"btn_clear\":\"Clean\",\"btn_function\":\"Function\",\"btn_arithmetic_plus\":\"Addition\",\"btn_arithmetic_minus\":\"Subtraction\",\"btn_arithmetic_multiplication\":\"Multiplication\",\"btn_arithmetic_division\":\"Division\",\"btn_arithmetic_module\":\"Remainder\",\"btn_break\":\"break\",\"btn_case\":\"Case\",\"btn_add_var\":\"Add a variable\",\"btn_drag_and_drop_function\":\"Move function\",\"btn_delete_function\":\"Delete function\",\"expression_invalid\":\"Invalid expression. Check the syntax before proceeding.\",\"expression_undelcared_variable\":\"Undeclared variables:\",\"expression_undeclared_function\":\"Undefined functions:\",\"start\":\"main\",\"type_void\":\"void\",\"type_integer\":\"int\",\"logic_operator_and\":\"AND\",\"logic_operator_or\":\"OR\",\"logic_operator_not\":\"not\",\"type_real\":\"real\",\"program\":\"program\",\"type_text\":\"string\",\"textvar_default_value\":\"text\",\"type_boolean\":\"bool\",\"logic_value_true\":\"true\",\"logic_value_false\":\"false\",\"variable\":\"Variable\",\"command\":\"Command\",\"new_parameter\":\"parameter\",\"new_variable\":\"variable\",\"new_global\":\"global\",\"new_function\":\"new_function\",\"matrix\":\"matrix\",\"vector\":\"vector\",\"text_lock_expression\":\"Block expression\",\"text_unlock_expression\":\"Unlock expression\",\"text_edit_expression\":\"Edit expression manually\",\"text_edit_expression_confirm\":\"Confirm edition\",\"text_edit_expression_cancel\":\"Cancel edition\",\"text_add_function\":\"Add a new function to the program\",\"text_move_command\":\"Move command\",\"text_add_parameters\":\"Add a new parameter\",\"text_parameter_reference\":\"Define parameter passed by reference\",\"text_parameter_copy\":\"Define parameter passed by copy\",\"text_comment_start\":\"Function initial comment\",\"text_comment_main\":\"This is the main funcion\",\"text_read_var\":\"Input/Read data\",\"text_write_var\":\"Output/Write data\",\"text_command_read\":\"read\",\"text_command_write\":\"write\",\"text_return\":\"return\",\"text_btn_return\":\"Return\",\"text_comment\":\"Comment\",\"string_join_or\":\"or\",\"matrix_info_string\":\"matrix of $0\",\"vector_info_string\":\"vector of $0\",\"text_attribution\":\"Assignment\",\"text_if\":\"if\",\"text_break\":\"break\",\"text_else\":\"else\",\"text_for\":\"repeat_for\",\"text_code_while\":\"repeat_while\",\"text_code_do\":\"repeat\",\"text_code_do_until\":\"until\",\"text_command_do\":\"repeat\",\"text_command_while\":\"repeat while\",\"text_command_do_until\":\"until\",\"text_code_switch\":\"switch\",\"text_code_case\":\"case\",\"text_config_programming\":\"Programming\",\"text_config_programming_both\":\"Visual & Textual\",\"text_config_programming_textual\":\"Textual\",\"text_config_programming_visual\":\"Visual\",\"text_logic_expression\":\"Logic\",\"text_arithmetic_expression\":\"Arithmetics\",\"text_iftrue\":\"If condition else\",\"text_message_error_activity_file\":\"There was an error processing the activity.<br> Reload the page to try again.\",\"text_message_error_upload_file\":\"It was not possible upload the file.<br>Verify the file's content and try again.\",\"text_message_error_upload_close\":\"Close\",\"text_message_error_activity_reload\":\"Reload\",\"text_repeatNtimes\":\"Repeat N times\",\"text_receives\":\"receives\",\"text_whiletrue\":\"While true\",\"text_dowhiletrue\":\"Repeat until true\",\"text_switch\":\"Switch\",\"text_functioncall\":\"Function call\",\"text_value\":\"Value\",\"text_operator\":\"Operator\",\"text_parentheses\":\"Parentheses\",\"text_change\":\"Modify\",\"text_teacher_algorithm\":\"Algorithm\",\"text_teacher_algorithm_include\":\"Include the algorithm below in the activity\",\"text_teacher_test_case\":\"Test cases\",\"text_teacher_config\":\"Configurations\",\"text_teacher_data_types\":\"Data types\",\"text_teacher_commands\":\"Commands\",\"text_teacher_functions\":\"Functions\",\"text_teacher_create_functions\":\"Create new functions\",\"text_teacher_create_movement_functions\":\"Move functions\",\"text_teacher_test_case_input\":\"Input\",\"text_teacher_test_case_output\":\"Output\",\"text_teacher_test_case_actions\":\"Actions\",\"text_teacher_test_case_add\":\"Add test case\",\"text_header_ivprog_functions\":\"iVProg Functions\",\"text_menu_functions_math\":\"Math\",\"text_menu_functions_text\":\"Text\",\"text_menu_functions_array\":\"Array\",\"text_menu_functions_conversion\":\"Conversion\",\"text_no_variable\":\"No variable declared\",\"text_no_variable_instruction\":\"Before using a variable, you need to create it\",\"text_ivprog_description\":\"Interactive and Visual Programming on the Internet\",\"tooltip_visual\":\"Visual programming\",\"tooltip_textual\":\"Textual programming\",\"tooltip_upload\":\"Upload source code\",\"tooltip_download\":\"Download source code\",\"tooltip_undo\":\"Undo\",\"tooltip_redo\":\"Redo\",\"tooltip_run\":\"Run the program\",\"tooltip_evaluate\":\"Evaluate the program\",\"tooltip_help\":\"Help\",\"tooltip_add_global\":\"Add a global variable\",\"tooltip_hide_function\":\"Hide function elements\",\"var_menu_select_var\":\"Select a variable\",\"var_menu_select_all\":\"Select\",\"var_menu_select_function\":\"Select a function\",\"expression_menu_select\":\"Construct a logic expression\",\"inform_valid_content\":\"Provide some data\",\"inform_valid_expression\":\"Construct a logic expression\",\"tooltip_terminal_clear\":\"Clears the terminal by removing all wrriten and pending text.\",\"tooltip_terminal_show\":\"Shows the terminal if it is hidden\",\"tooltip_terminal_hide\":\"Hides the terminal if it is not on display\",\"tooltip_menu_read\":\"Command to input data from keyboard\",\"tooltip_menu_write\":\"Command to present content to user\",\"tooltip_menu_comments\":\"Block to comments from developer\",\"tooltip_menu_attribution\":\"Command to assign an expression to a variable\",\"tooltip_menu_call_function\":\"Command to execute a function call\",\"tooltip_menu_if_else\":\"Structure in which command only run when the conditions are satisfied\",\"tooltip_menu_repeat_n_times\":\"Structure to execute a block of commands repeatedly\",\"tooltip_menu_repeat_whiletrue\":\"Structure to execute a block repeatdly while condition is true\",\"tooltip_menu_repeat_dowhiletrue\":\"Structure that executes a block and repeat while the condition is true\",\"tooltip_menu_repeat_switch\":\"Structure that choices the block to be executed\",\"tooltip_menu_repeat_return\":\"Command to return the result and finish the function\",\"tooltip_move_var\":\"Move variable\",\"tooltip_remove_var\":\"Delete variable\",\"text_ivprog_version\":\"Version\",\"text_teacher_filter\":\"Filter\",\"text_teacher_filter_active\":\"Activated\",\"text_teacher_filter_help\":\"By activating the filter modifications in iVProg will be blocked\",\"text_join_assessment_outputs\":\" ; \",\"assessment-detail-time-label\":\"Duration\",\"assessment-detail-grade-label\":\"Grade\",\"assessment-detail-input-label\":\"Inputs\",\"assessment-detail-output-label\":\"Outputs\",\"assessment-detail-expected-label\":\"Expected\",\"assessment-detail-generated-label\":\"Generated\",\"assessment-detail-result-label\":\"Correction\",\"assessment-detail-title\":\"Test Case $0\",\"text_teacher_generate_outputs\":\"Generate outputs\",\"text_teacher_generate_outputs_algorithm\":\"Before generating the outputs you need to create an algorithm\",\"text_code_for_from\":\"from\",\"text_code_for_to\":\"to\",\"text_code_for_pass\":\"pass\",\"text_for_from\":\"from\",\"text_for_to\":\"to\",\"text_for_pass\":\"pass\",\"text_relational_expression\":\"Relational\",\"write_command_newline_on\":\" Line break is on\",\"write_command_newline_off\":\" Line break is off\",\"write_seprator_menu_text\":\"Spacer\",\"initial_program_code\":\"program {\\\\n\\\\n\\\\t\\\\tfunction void main () {\\\\n\\\\t\\\\t\\\\t// Start your code here!\\\\n\\\\t\\\\t}\\\\n}\",\"type_char\":\"char\",\"charvar_default_value\":\"A\",\"write_seprator_menu_tooltip\":\"Separator used to print more values/variables\"},\"es\":{\"function\":\"function\",\"btn_clear\":\"Limpiar\",\"btn_function\":\"Funcíon\",\"btn_arithmetic_plus\":\"Adición\",\"btn_arithmetic_minus\":\"Sustracción\",\"btn_arithmetic_multiplication\":\"Multiplicación\",\"btn_arithmetic_division\":\"División\",\"btn_arithmetic_module\":\"Resto\",\"btn_break\":\"break\",\"btn_case\":\"Caso\",\"btn_add_var\":\"Add a variable\",\"btn_drag_and_drop_function\":\"Mover función\",\"btn_delete_function\":\"Borrar función\",\"expression_invalid\":\"Expresión no válida. Verifique la sintaxis antes de continuar.\",\"expression_undelcared_variable\":\"Variables no declaradas:\",\"expression_undeclared_function\":\"Funcíon no declaradas:\",\"start\":\"main\",\"type_void\":\"void\",\"type_integer\":\"int\",\"logic_operator_and\":\"AND\",\"logic_operator_or\":\"OR\",\"logic_operator_not\":\"not\",\"type_real\":\"real\",\"program\":\"program\",\"type_text\":\"string\",\"textvar_default_value\":\"texto\",\"type_boolean\":\"bool\",\"logic_value_true\":\"true\",\"logic_value_false\":\"false\",\"variable\":\"Variable\",\"command\":\"Comando\",\"new_parameter\":\"parametro\",\"new_variable\":\"variable\",\"new_global\":\"global\",\"new_function\":\"nueva_función\",\"matrix\":\"matriz\",\"vector\":\"vector\",\"text_lock_expression\":\"Expresión de bloque\",\"text_unlock_expression\":\"Desbloquear expresión\",\"text_edit_expression\":\"Editar expresión manualmente\",\"text_edit_expression_confirm\":\"Confirmar edición\",\"text_edit_expression_cancel\":\"Cancelar edición\",\"text_add_function\":\"Agregar una nueva función al programa\",\"text_move_command\":\"Mover comando\",\"text_add_parameters\":\"Agregar un nuevo parámetro\",\"text_parameter_reference\":\"Define parameter passed by reference\",\"text_parameter_copy\":\"Define parameter passed by copy\",\"text_comment_start\":\"Comentario inicial de la función\",\"text_comment_main\":\"Esta es la función principal\",\"text_read_var\":\"Entrada/Lectura de dados\",\"text_write_var\":\"Salida/Escribir datos\",\"text_command_read\":\"read\",\"text_command_write\":\"write\",\"text_return\":\"return\",\"text_btn_return\":\"Devolución\",\"text_comment\":\"Comentario\",\"string_join_or\":\"or\",\"matrix_info_string\":\"matriz de $0\",\"vector_info_string\":\"vector de $0\",\"text_attribution\":\"Asignación\",\"text_if\":\"if\",\"text_break\":\"break\",\"text_else\":\"else\",\"text_for\":\"repeat_for\",\"text_code_while\":\"repeat_while\",\"text_code_do\":\"repeat\",\"text_code_do_until\":\"until\",\"text_command_do\":\"repeat\",\"text_command_while\":\"repeat while\",\"text_command_do_until\":\"until\",\"text_code_switch\":\"switch\",\"text_code_case\":\"case\",\"text_config_programming\":\"Programación\",\"text_config_programming_both\":\"Visual & Textual\",\"text_config_programming_textual\":\"Textual\",\"text_config_programming_visual\":\"Visual\",\"text_logic_expression\":\"Lógicos\",\"text_arithmetic_expression\":\"Aritmética\",\"text_iftrue\":\"Si condicion sino\",\"text_message_error_activity_file\":\"Se produjo un error al procesar la actividad.<br> Recargar la página para volver a intentarlo.\",\"text_message_error_upload_file\":\"text_message_error_upload_file\",\"text_message_error_upload_close\":\"Close\",\"text_message_error_activity_reload\":\"Recargar\",\"text_repeatNtimes\":\"Repetir N veces\",\"text_receives\":\"receives\",\"text_whiletrue\":\"Mientras verdad\",\"text_dowhiletrue\":\"Repita hasta verdad\",\"text_switch\":\"Switch\",\"text_functioncall\":\"Llamada de función\",\"text_value\":\"Valor\",\"text_operator\":\"Operador\",\"text_parentheses\":\"Paréntesis\",\"text_change\":\"Modify\",\"text_teacher_algorithm\":\"Algorithm\",\"text_teacher_algorithm_include\":\"Incluir el algoritmo en la actividad.\",\"text_teacher_test_case\":\"Test cases\",\"text_teacher_config\":\"Configuraciones\",\"text_teacher_data_types\":\"Data types\",\"text_teacher_commands\":\"Commands\",\"text_teacher_functions\":\"Funciones\",\"text_teacher_create_functions\":\"Create new functions\",\"text_teacher_create_movement_functions\":\"Move functions\",\"text_teacher_test_case_input\":\"Input\",\"text_teacher_test_case_output\":\"Output\",\"text_teacher_test_case_actions\":\"Actions\",\"text_teacher_test_case_add\":\"Add test case\",\"text_header_ivprog_functions\":\"iVProg Functions\",\"text_menu_functions_math\":\"Math\",\"text_menu_functions_text\":\"Text\",\"text_menu_functions_array\":\"Array\",\"text_menu_functions_conversion\":\"Conversion\",\"text_no_variable\":\"No variable declared\",\"text_no_variable_instruction\":\"Antes de usar una variable, debe crearla\",\"text_ivprog_description\":\"Interactive and Visual Programming on the Internet\",\"tooltip_visual\":\"Visual programming\",\"tooltip_textual\":\"Textual programming\",\"tooltip_upload\":\"Upload source code\",\"tooltip_download\":\"Download source code\",\"tooltip_undo\":\"Undo\",\"tooltip_redo\":\"Redo\",\"tooltip_run\":\"Run the program\",\"tooltip_evaluate\":\"Evaluate the program\",\"tooltip_help\":\"Help\",\"tooltip_add_global\":\"Add a global variable\",\"tooltip_hide_function\":\"Hide function elements\",\"var_menu_select_var\":\"Select a variable\",\"var_menu_select_all\":\"Select\",\"var_menu_select_function\":\"Select a function\",\"expression_menu_select\":\"Construct a logic expression\",\"inform_valid_content\":\"Proporcionar algunos datos\",\"inform_valid_expression\":\"Construct a logic expression\",\"tooltip_terminal_clear\":\"Borra el terminal eliminando todo el texto escrito y pendiente.\",\"tooltip_terminal_show\":\"Muestra el terminal si está oculto.\",\"tooltip_terminal_hide\":\"Oculta el terminal si no está en exhibición\",\"tooltip_menu_read\":\"Command to input data from keyboard\",\"tooltip_menu_write\":\"Command to present content to user\",\"tooltip_menu_comments\":\"Block to comments from developer\",\"tooltip_menu_attribution\":\"Command to assign an expression to a variable\",\"tooltip_menu_call_function\":\"Command to execute a function call\",\"tooltip_menu_if_else\":\"Structure in which command only run when the conditions are satisfied\",\"tooltip_menu_repeat_n_times\":\"Structure to execute a block of commands repeatedly\",\"tooltip_menu_repeat_whiletrue\":\"Structure to execute a block repeatdly while condition is true\",\"tooltip_menu_repeat_dowhiletrue\":\"Structure that executes a block and repeat while the condition is true\",\"tooltip_menu_repeat_switch\":\"Structure that choices the block to be executed\",\"tooltip_menu_repeat_return\":\"Command to return the result and finish the function\",\"tooltip_move_var\":\"Move variable\",\"tooltip_remove_var\":\"Delete variable\",\"text_ivprog_version\":\"Version\",\"text_teacher_filter\":\"Filter\",\"text_teacher_filter_active\":\"Activated\",\"text_teacher_filter_help\":\"Al activar el filtro, las modificaciones en iVProg serán bloqueadas\",\"text_join_assessment_outputs\":\" ;\",\"assessment-detail-time-label\":\"Duration\",\"assessment-detail-grade-label\":\"Grade\",\"assessment-detail-input-label\":\"Inputs\",\"assessment-detail-output-label\":\"Outputs\",\"assessment-detail-expected-label\":\"Expected\",\"assessment-detail-generated-label\":\"Generated\",\"assessment-detail-result-label\":\"Correction\",\"assessment-detail-title\":\"Test Case $0\",\"text_teacher_generate_outputs\":\"Generate outputs\",\"text_teacher_generate_outputs_algorithm\":\"Antes de generar las salidas necesita crear un algoritmo\",\"text_code_for_from\":\"from\",\"text_code_for_to\":\"to\",\"text_code_for_pass\":\"pass\",\"text_for_from\":\"from\",\"text_for_to\":\"to\",\"text_for_pass\":\"pass\",\"text_relational_expression\":\"Relational\",\"write_command_newline_on\":\"El salto de línea está activado\",\"write_command_newline_off\":\"El salto de línea está desactivado\",\"write_seprator_menu_text\":\"Spacer\",\"initial_program_code\":\"program {\\\\n\\\\n\\\\t\\\\tfunction void main () {\\\\n\\\\t\\\\t\\\\t// Start your code here!\\\\n\\\\t\\\\t}\\\\n}\",\"type_char\":\"char\",\"charvar_default_value\":\"A\",\"write_seprator_menu_tooltip\":\"Separator used to print more values/variables\"}}","function _arrayLikeToArray(arr, len) {\n  if (len == null || len > arr.length) len = arr.length;\n\n  for (var i = 0, arr2 = new Array(len); i < len; i++) {\n    arr2[i] = arr[i];\n  }\n\n  return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","function _arrayWithHoles(arr) {\n  if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _arrayWithoutHoles(arr) {\n  if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;","function _assertThisInitialized(self) {\n  if (self === void 0) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n\n  return self;\n}\n\nmodule.exports = _assertThisInitialized;","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n  try {\n    var info = gen[key](arg);\n    var value = info.value;\n  } catch (error) {\n    reject(error);\n    return;\n  }\n\n  if (info.done) {\n    resolve(value);\n  } else {\n    Promise.resolve(value).then(_next, _throw);\n  }\n}\n\nfunction _asyncToGenerator(fn) {\n  return function () {\n    var self = this,\n        args = arguments;\n    return new Promise(function (resolve, reject) {\n      var gen = fn.apply(self, args);\n\n      function _next(value) {\n        asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n      }\n\n      function _throw(err) {\n        asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n      }\n\n      _next(undefined);\n    });\n  };\n}\n\nmodule.exports = _asyncToGenerator;","function _classCallCheck(instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n}\n\nmodule.exports = _classCallCheck;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nvar isNativeReflectConstruct = require(\"./isNativeReflectConstruct\");\n\nfunction _construct(Parent, args, Class) {\n  if (isNativeReflectConstruct()) {\n    module.exports = _construct = Reflect.construct;\n  } else {\n    module.exports = _construct = function _construct(Parent, args, Class) {\n      var a = [null];\n      a.push.apply(a, args);\n      var Constructor = Function.bind.apply(Parent, a);\n      var instance = new Constructor();\n      if (Class) setPrototypeOf(instance, Class.prototype);\n      return instance;\n    };\n  }\n\n  return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;","function _defineProperties(target, props) {\n  for (var i = 0; i < props.length; i++) {\n    var descriptor = props[i];\n    descriptor.enumerable = descriptor.enumerable || false;\n    descriptor.configurable = true;\n    if (\"value\" in descriptor) descriptor.writable = true;\n    Object.defineProperty(target, descriptor.key, descriptor);\n  }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n  if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n  if (staticProps) _defineProperties(Constructor, staticProps);\n  return Constructor;\n}\n\nmodule.exports = _createClass;","function _defineProperty(obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n\n  return obj;\n}\n\nmodule.exports = _defineProperty;","var superPropBase = require(\"./superPropBase\");\n\nfunction _get(target, property, receiver) {\n  if (typeof Reflect !== \"undefined\" && Reflect.get) {\n    module.exports = _get = Reflect.get;\n  } else {\n    module.exports = _get = function _get(target, property, receiver) {\n      var base = superPropBase(target, property);\n      if (!base) return;\n      var desc = Object.getOwnPropertyDescriptor(base, property);\n\n      if (desc.get) {\n        return desc.get.call(receiver);\n      }\n\n      return desc.value;\n    };\n  }\n\n  return _get(target, property, receiver || target);\n}\n\nmodule.exports = _get;","function _getPrototypeOf(o) {\n  module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n    return o.__proto__ || Object.getPrototypeOf(o);\n  };\n  return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n  if (typeof superClass !== \"function\" && superClass !== null) {\n    throw new TypeError(\"Super expression must either be null or a function\");\n  }\n\n  subClass.prototype = Object.create(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      writable: true,\n      configurable: true\n    }\n  });\n  if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","function _isNativeFunction(fn) {\n  return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n\nmodule.exports = _isNativeFunction;","function _isNativeReflectConstruct() {\n  if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n  if (Reflect.construct.sham) return false;\n  if (typeof Proxy === \"function\") return true;\n\n  try {\n    Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\nmodule.exports = _isNativeReflectConstruct;","function _iterableToArray(iter) {\n  if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","function _iterableToArrayLimit(arr, i) {\n  if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n  var _arr = [];\n  var _n = true;\n  var _d = false;\n  var _e = undefined;\n\n  try {\n    for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n      _arr.push(_s.value);\n\n      if (i && _arr.length === i) break;\n    }\n  } catch (err) {\n    _d = true;\n    _e = err;\n  } finally {\n    try {\n      if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n    } finally {\n      if (_d) throw _e;\n    }\n  }\n\n  return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n  throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","function _nonIterableSpread() {\n  throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n  if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n    return call;\n  }\n\n  return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _setPrototypeOf(o, p) {\n  module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n    o.__proto__ = p;\n    return o;\n  };\n\n  return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n  return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","var getPrototypeOf = require(\"./getPrototypeOf\");\n\nfunction _superPropBase(object, property) {\n  while (!Object.prototype.hasOwnProperty.call(object, property)) {\n    object = getPrototypeOf(object);\n    if (object === null) break;\n  }\n\n  return object;\n}\n\nmodule.exports = _superPropBase;","function _taggedTemplateLiteral(strings, raw) {\n  if (!raw) {\n    raw = strings.slice(0);\n  }\n\n  return Object.freeze(Object.defineProperties(strings, {\n    raw: {\n      value: Object.freeze(raw)\n    }\n  }));\n}\n\nmodule.exports = _taggedTemplateLiteral;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n  return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","function _typeof(obj) {\n  \"@babel/helpers - typeof\";\n\n  if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n    module.exports = _typeof = function _typeof(obj) {\n      return typeof obj;\n    };\n  } else {\n    module.exports = _typeof = function _typeof(obj) {\n      return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n    };\n  }\n\n  return _typeof(obj);\n}\n\nmodule.exports = _typeof;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n  if (!o) return;\n  if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n  var n = Object.prototype.toString.call(o).slice(8, -1);\n  if (n === \"Object\" && o.constructor) n = o.constructor.name;\n  if (n === \"Map\" || n === \"Set\") return Array.from(o);\n  if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","var getPrototypeOf = require(\"./getPrototypeOf\");\n\nvar setPrototypeOf = require(\"./setPrototypeOf\");\n\nvar isNativeFunction = require(\"./isNativeFunction\");\n\nvar construct = require(\"./construct\");\n\nfunction _wrapNativeSuper(Class) {\n  var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n  module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {\n    if (Class === null || !isNativeFunction(Class)) return Class;\n\n    if (typeof Class !== \"function\") {\n      throw new TypeError(\"Super expression must either be null or a function\");\n    }\n\n    if (typeof _cache !== \"undefined\") {\n      if (_cache.has(Class)) return _cache.get(Class);\n\n      _cache.set(Class, Wrapper);\n    }\n\n    function Wrapper() {\n      return construct(Class, arguments, getPrototypeOf(this).constructor);\n    }\n\n    Wrapper.prototype = Object.create(Class.prototype, {\n      constructor: {\n        value: Wrapper,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n    return setPrototypeOf(Wrapper, Class);\n  };\n\n  return _wrapNativeSuper(Class);\n}\n\nmodule.exports = _wrapNativeSuper;","module.exports = require(\"regenerator-runtime\");\n",";(function (globalScope) {\r\n  'use strict';\r\n\r\n\r\n  /*\r\n   *  decimal.js v10.2.0\r\n   *  An arbitrary-precision Decimal type for JavaScript.\r\n   *  https://github.com/MikeMcl/decimal.js\r\n   *  Copyright (c) 2019 Michael Mclaughlin <M8ch88l@gmail.com>\r\n   *  MIT Licence\r\n   */\r\n\r\n\r\n  // -----------------------------------  EDITABLE DEFAULTS  ------------------------------------ //\r\n\r\n\r\n    // The maximum exponent magnitude.\r\n    // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.\r\n  var EXP_LIMIT = 9e15,                      // 0 to 9e15\r\n\r\n    // The limit on the value of `precision`, and on the value of the first argument to\r\n    // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n    MAX_DIGITS = 1e9,                        // 0 to 1e9\r\n\r\n    // Base conversion alphabet.\r\n    NUMERALS = '0123456789abcdef',\r\n\r\n    // The natural logarithm of 10 (1025 digits).\r\n    LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',\r\n\r\n    // Pi (1025 digits).\r\n    PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',\r\n\r\n\r\n    // The initial configuration properties of the Decimal constructor.\r\n    DEFAULTS = {\r\n\r\n      // These values must be integers within the stated ranges (inclusive).\r\n      // Most of these values can be changed at run-time using the `Decimal.config` method.\r\n\r\n      // The maximum number of significant digits of the result of a calculation or base conversion.\r\n      // E.g. `Decimal.config({ precision: 20 });`\r\n      precision: 20,                         // 1 to MAX_DIGITS\r\n\r\n      // The rounding mode used when rounding to `precision`.\r\n      //\r\n      // ROUND_UP         0 Away from zero.\r\n      // ROUND_DOWN       1 Towards zero.\r\n      // ROUND_CEIL       2 Towards +Infinity.\r\n      // ROUND_FLOOR      3 Towards -Infinity.\r\n      // ROUND_HALF_UP    4 Towards nearest neighbour. If equidistant, up.\r\n      // ROUND_HALF_DOWN  5 Towards nearest neighbour. If equidistant, down.\r\n      // ROUND_HALF_EVEN  6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n      // ROUND_HALF_CEIL  7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n      // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n      //\r\n      // E.g.\r\n      // `Decimal.rounding = 4;`\r\n      // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n      rounding: 4,                           // 0 to 8\r\n\r\n      // The modulo mode used when calculating the modulus: a mod n.\r\n      // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n      // The remainder (r) is calculated as: r = a - n * q.\r\n      //\r\n      // UP         0 The remainder is positive if the dividend is negative, else is negative.\r\n      // DOWN       1 The remainder has the same sign as the dividend (JavaScript %).\r\n      // FLOOR      3 The remainder has the same sign as the divisor (Python %).\r\n      // HALF_EVEN  6 The IEEE 754 remainder function.\r\n      // EUCLID     9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.\r\n      //\r\n      // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian\r\n      // division (9) are commonly used for the modulus operation. The other rounding modes can also\r\n      // be used, but they may not give useful results.\r\n      modulo: 1,                             // 0 to 9\r\n\r\n      // The exponent value at and beneath which `toString` returns exponential notation.\r\n      // JavaScript numbers: -7\r\n      toExpNeg: -7,                          // 0 to -EXP_LIMIT\r\n\r\n      // The exponent value at and above which `toString` returns exponential notation.\r\n      // JavaScript numbers: 21\r\n      toExpPos:  21,                         // 0 to EXP_LIMIT\r\n\r\n      // The minimum exponent value, beneath which underflow to zero occurs.\r\n      // JavaScript numbers: -324  (5e-324)\r\n      minE: -EXP_LIMIT,                      // -1 to -EXP_LIMIT\r\n\r\n      // The maximum exponent value, above which overflow to Infinity occurs.\r\n      // JavaScript numbers: 308  (1.7976931348623157e+308)\r\n      maxE: EXP_LIMIT,                       // 1 to EXP_LIMIT\r\n\r\n      // Whether to use cryptographically-secure random number generation, if available.\r\n      crypto: false                          // true/false\r\n    },\r\n\r\n\r\n  // ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n    Decimal, inexact, noConflict, quadrant,\r\n    external = true,\r\n\r\n    decimalError = '[DecimalError] ',\r\n    invalidArgument = decimalError + 'Invalid argument: ',\r\n    precisionLimitExceeded = decimalError + 'Precision limit exceeded',\r\n    cryptoUnavailable = decimalError + 'crypto unavailable',\r\n\r\n    mathfloor = Math.floor,\r\n    mathpow = Math.pow,\r\n\r\n    isBinary = /^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,\r\n    isHex = /^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,\r\n    isOctal = /^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,\r\n    isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n    BASE = 1e7,\r\n    LOG_BASE = 7,\r\n    MAX_SAFE_INTEGER = 9007199254740991,\r\n\r\n    LN10_PRECISION = LN10.length - 1,\r\n    PI_PRECISION = PI.length - 1,\r\n\r\n    // Decimal.prototype object\r\n    P = { name: '[object Decimal]' };\r\n\r\n\r\n  // Decimal prototype methods\r\n\r\n\r\n  /*\r\n   *  absoluteValue             abs\r\n   *  ceil\r\n   *  comparedTo                cmp\r\n   *  cosine                    cos\r\n   *  cubeRoot                  cbrt\r\n   *  decimalPlaces             dp\r\n   *  dividedBy                 div\r\n   *  dividedToIntegerBy        divToInt\r\n   *  equals                    eq\r\n   *  floor\r\n   *  greaterThan               gt\r\n   *  greaterThanOrEqualTo      gte\r\n   *  hyperbolicCosine          cosh\r\n   *  hyperbolicSine            sinh\r\n   *  hyperbolicTangent         tanh\r\n   *  inverseCosine             acos\r\n   *  inverseHyperbolicCosine   acosh\r\n   *  inverseHyperbolicSine     asinh\r\n   *  inverseHyperbolicTangent  atanh\r\n   *  inverseSine               asin\r\n   *  inverseTangent            atan\r\n   *  isFinite\r\n   *  isInteger                 isInt\r\n   *  isNaN\r\n   *  isNegative                isNeg\r\n   *  isPositive                isPos\r\n   *  isZero\r\n   *  lessThan                  lt\r\n   *  lessThanOrEqualTo         lte\r\n   *  logarithm                 log\r\n   *  [maximum]                 [max]\r\n   *  [minimum]                 [min]\r\n   *  minus                     sub\r\n   *  modulo                    mod\r\n   *  naturalExponential        exp\r\n   *  naturalLogarithm          ln\r\n   *  negated                   neg\r\n   *  plus                      add\r\n   *  precision                 sd\r\n   *  round\r\n   *  sine                      sin\r\n   *  squareRoot                sqrt\r\n   *  tangent                   tan\r\n   *  times                     mul\r\n   *  toBinary\r\n   *  toDecimalPlaces           toDP\r\n   *  toExponential\r\n   *  toFixed\r\n   *  toFraction\r\n   *  toHexadecimal             toHex\r\n   *  toNearest\r\n   *  toNumber\r\n   *  toOctal\r\n   *  toPower                   pow\r\n   *  toPrecision\r\n   *  toSignificantDigits       toSD\r\n   *  toString\r\n   *  truncated                 trunc\r\n   *  valueOf                   toJSON\r\n   */\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the absolute value of this Decimal.\r\n   *\r\n   */\r\n  P.absoluteValue = P.abs = function () {\r\n    var x = new this.constructor(this);\r\n    if (x.s < 0) x.s = 1;\r\n    return finalise(x);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n   * direction of positive Infinity.\r\n   *\r\n   */\r\n  P.ceil = function () {\r\n    return finalise(new this.constructor(this), this.e + 1, 2);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return\r\n   *   1    if the value of this Decimal is greater than the value of `y`,\r\n   *  -1    if the value of this Decimal is less than the value of `y`,\r\n   *   0    if they have the same value,\r\n   *   NaN  if the value of either Decimal is NaN.\r\n   *\r\n   */\r\n  P.comparedTo = P.cmp = function (y) {\r\n    var i, j, xdL, ydL,\r\n      x = this,\r\n      xd = x.d,\r\n      yd = (y = new x.constructor(y)).d,\r\n      xs = x.s,\r\n      ys = y.s;\r\n\r\n    // Either NaN or ±Infinity?\r\n    if (!xd || !yd) {\r\n      return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;\r\n    }\r\n\r\n    // Either zero?\r\n    if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;\r\n\r\n    // Signs differ?\r\n    if (xs !== ys) return xs;\r\n\r\n    // Compare exponents.\r\n    if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;\r\n\r\n    xdL = xd.length;\r\n    ydL = yd.length;\r\n\r\n    // Compare digit by digit.\r\n    for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n      if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;\r\n    }\r\n\r\n    // Compare lengths.\r\n    return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.\r\n   *\r\n   * Domain: [-Infinity, Infinity]\r\n   * Range: [-1, 1]\r\n   *\r\n   * cos(0)         = 1\r\n   * cos(-0)        = 1\r\n   * cos(Infinity)  = NaN\r\n   * cos(-Infinity) = NaN\r\n   * cos(NaN)       = NaN\r\n   *\r\n   */\r\n  P.cosine = P.cos = function () {\r\n    var pr, rm,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (!x.d) return new Ctor(NaN);\r\n\r\n    // cos(0) = cos(-0) = 1\r\n    if (!x.d[0]) return new Ctor(1);\r\n\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n    Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n    Ctor.rounding = 1;\r\n\r\n    x = cosine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n    Ctor.precision = pr;\r\n    Ctor.rounding = rm;\r\n\r\n    return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);\r\n  };\r\n\r\n\r\n  /*\r\n   *\r\n   * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to\r\n   * `precision` significant digits using rounding mode `rounding`.\r\n   *\r\n   *  cbrt(0)  =  0\r\n   *  cbrt(-0) = -0\r\n   *  cbrt(1)  =  1\r\n   *  cbrt(-1) = -1\r\n   *  cbrt(N)  =  N\r\n   *  cbrt(-I) = -I\r\n   *  cbrt(I)  =  I\r\n   *\r\n   * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))\r\n   *\r\n   */\r\n  P.cubeRoot = P.cbrt = function () {\r\n    var e, m, n, r, rep, s, sd, t, t3, t3plusx,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n    external = false;\r\n\r\n    // Initial estimate.\r\n    s = x.s * mathpow(x.s * x, 1 / 3);\r\n\r\n     // Math.cbrt underflow/overflow?\r\n     // Pass x to Math.pow as integer, then adjust the exponent of the result.\r\n    if (!s || Math.abs(s) == 1 / 0) {\r\n      n = digitsToString(x.d);\r\n      e = x.e;\r\n\r\n      // Adjust n exponent so it is a multiple of 3 away from x exponent.\r\n      if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00');\r\n      s = mathpow(n, 1 / 3);\r\n\r\n      // Rarely, e may be one less than the result exponent value.\r\n      e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));\r\n\r\n      if (s == 1 / 0) {\r\n        n = '5e' + e;\r\n      } else {\r\n        n = s.toExponential();\r\n        n = n.slice(0, n.indexOf('e') + 1) + e;\r\n      }\r\n\r\n      r = new Ctor(n);\r\n      r.s = x.s;\r\n    } else {\r\n      r = new Ctor(s.toString());\r\n    }\r\n\r\n    sd = (e = Ctor.precision) + 3;\r\n\r\n    // Halley's method.\r\n    // TODO? Compare Newton's method.\r\n    for (;;) {\r\n      t = r;\r\n      t3 = t.times(t).times(t);\r\n      t3plusx = t3.plus(x);\r\n      r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);\r\n\r\n      // TODO? Replace with for-loop and checkRoundingDigits.\r\n      if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n        n = n.slice(sd - 3, sd + 1);\r\n\r\n        // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999\r\n        // , i.e. approaching a rounding boundary, continue the iteration.\r\n        if (n == '9999' || !rep && n == '4999') {\r\n\r\n          // On the first iteration only, check to see if rounding up gives the exact result as the\r\n          // nines may infinitely repeat.\r\n          if (!rep) {\r\n            finalise(t, e + 1, 0);\r\n\r\n            if (t.times(t).times(t).eq(x)) {\r\n              r = t;\r\n              break;\r\n            }\r\n          }\r\n\r\n          sd += 4;\r\n          rep = 1;\r\n        } else {\r\n\r\n          // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n          // If not, then there are further digits and m will be truthy.\r\n          if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n            // Truncate to the first rounding digit.\r\n            finalise(r, e + 1, 1);\r\n            m = !r.times(r).times(r).eq(x);\r\n          }\r\n\r\n          break;\r\n        }\r\n      }\r\n    }\r\n\r\n    external = true;\r\n\r\n    return finalise(r, e, Ctor.rounding, m);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return the number of decimal places of the value of this Decimal.\r\n   *\r\n   */\r\n  P.decimalPlaces = P.dp = function () {\r\n    var w,\r\n      d = this.d,\r\n      n = NaN;\r\n\r\n    if (d) {\r\n      w = d.length - 1;\r\n      n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n      // Subtract the number of trailing zeros of the last word.\r\n      w = d[w];\r\n      if (w) for (; w % 10 == 0; w /= 10) n--;\r\n      if (n < 0) n = 0;\r\n    }\r\n\r\n    return n;\r\n  };\r\n\r\n\r\n  /*\r\n   *  n / 0 = I\r\n   *  n / N = N\r\n   *  n / I = 0\r\n   *  0 / n = 0\r\n   *  0 / 0 = N\r\n   *  0 / N = N\r\n   *  0 / I = 0\r\n   *  N / n = N\r\n   *  N / 0 = N\r\n   *  N / N = N\r\n   *  N / I = N\r\n   *  I / n = I\r\n   *  I / 0 = I\r\n   *  I / N = N\r\n   *  I / I = N\r\n   *\r\n   * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to\r\n   * `precision` significant digits using rounding mode `rounding`.\r\n   *\r\n   */\r\n  P.dividedBy = P.div = function (y) {\r\n    return divide(this, new this.constructor(y));\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n   * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.\r\n   *\r\n   */\r\n  P.dividedToIntegerBy = P.divToInt = function (y) {\r\n    var x = this,\r\n      Ctor = x.constructor;\r\n    return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n   *\r\n   */\r\n  P.equals = P.eq = function (y) {\r\n    return this.cmp(y) === 0;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n   * direction of negative Infinity.\r\n   *\r\n   */\r\n  P.floor = function () {\r\n    return finalise(new this.constructor(this), this.e + 1, 3);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n   * false.\r\n   *\r\n   */\r\n  P.greaterThan = P.gt = function (y) {\r\n    return this.cmp(y) > 0;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n   * otherwise return false.\r\n   *\r\n   */\r\n  P.greaterThanOrEqualTo = P.gte = function (y) {\r\n    var k = this.cmp(y);\r\n    return k == 1 || k === 0;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this\r\n   * Decimal.\r\n   *\r\n   * Domain: [-Infinity, Infinity]\r\n   * Range: [1, Infinity]\r\n   *\r\n   * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...\r\n   *\r\n   * cosh(0)         = 1\r\n   * cosh(-0)        = 1\r\n   * cosh(Infinity)  = Infinity\r\n   * cosh(-Infinity) = Infinity\r\n   * cosh(NaN)       = NaN\r\n   *\r\n   *  x        time taken (ms)   result\r\n   * 1000      9                 9.8503555700852349694e+433\r\n   * 10000     25                4.4034091128314607936e+4342\r\n   * 100000    171               1.4033316802130615897e+43429\r\n   * 1000000   3817              1.5166076984010437725e+434294\r\n   * 10000000  abandoned after 2 minute wait\r\n   *\r\n   * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))\r\n   *\r\n   */\r\n  P.hyperbolicCosine = P.cosh = function () {\r\n    var k, n, pr, rm, len,\r\n      x = this,\r\n      Ctor = x.constructor,\r\n      one = new Ctor(1);\r\n\r\n    if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);\r\n    if (x.isZero()) return one;\r\n\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n    Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n    Ctor.rounding = 1;\r\n    len = x.d.length;\r\n\r\n    // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1\r\n    // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))\r\n\r\n    // Estimate the optimum number of times to use the argument reduction.\r\n    // TODO? Estimation reused from cosine() and may not be optimal here.\r\n    if (len < 32) {\r\n      k = Math.ceil(len / 3);\r\n      n = (1 / tinyPow(4, k)).toString();\r\n    } else {\r\n      k = 16;\r\n      n = '2.3283064365386962890625e-10';\r\n    }\r\n\r\n    x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);\r\n\r\n    // Reverse argument reduction\r\n    var cosh2_x,\r\n      i = k,\r\n      d8 = new Ctor(8);\r\n    for (; i--;) {\r\n      cosh2_x = x.times(x);\r\n      x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));\r\n    }\r\n\r\n    return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this\r\n   * Decimal.\r\n   *\r\n   * Domain: [-Infinity, Infinity]\r\n   * Range: [-Infinity, Infinity]\r\n   *\r\n   * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...\r\n   *\r\n   * sinh(0)         = 0\r\n   * sinh(-0)        = -0\r\n   * sinh(Infinity)  = Infinity\r\n   * sinh(-Infinity) = -Infinity\r\n   * sinh(NaN)       = NaN\r\n   *\r\n   * x        time taken (ms)\r\n   * 10       2 ms\r\n   * 100      5 ms\r\n   * 1000     14 ms\r\n   * 10000    82 ms\r\n   * 100000   886 ms            1.4033316802130615897e+43429\r\n   * 200000   2613 ms\r\n   * 300000   5407 ms\r\n   * 400000   8824 ms\r\n   * 500000   13026 ms          8.7080643612718084129e+217146\r\n   * 1000000  48543 ms\r\n   *\r\n   * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))\r\n   *\r\n   */\r\n  P.hyperbolicSine = P.sinh = function () {\r\n    var k, pr, rm, len,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n    Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n    Ctor.rounding = 1;\r\n    len = x.d.length;\r\n\r\n    if (len < 3) {\r\n      x = taylorSeries(Ctor, 2, x, x, true);\r\n    } else {\r\n\r\n      // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))\r\n      // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))\r\n      // 3 multiplications and 1 addition\r\n\r\n      // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))\r\n      // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))\r\n      // 4 multiplications and 2 additions\r\n\r\n      // Estimate the optimum number of times to use the argument reduction.\r\n      k = 1.4 * Math.sqrt(len);\r\n      k = k > 16 ? 16 : k | 0;\r\n\r\n      x = x.times(1 / tinyPow(5, k));\r\n      x = taylorSeries(Ctor, 2, x, x, true);\r\n\r\n      // Reverse argument reduction\r\n      var sinh2_x,\r\n        d5 = new Ctor(5),\r\n        d16 = new Ctor(16),\r\n        d20 = new Ctor(20);\r\n      for (; k--;) {\r\n        sinh2_x = x.times(x);\r\n        x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));\r\n      }\r\n    }\r\n\r\n    Ctor.precision = pr;\r\n    Ctor.rounding = rm;\r\n\r\n    return finalise(x, pr, rm, true);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this\r\n   * Decimal.\r\n   *\r\n   * Domain: [-Infinity, Infinity]\r\n   * Range: [-1, 1]\r\n   *\r\n   * tanh(x) = sinh(x) / cosh(x)\r\n   *\r\n   * tanh(0)         = 0\r\n   * tanh(-0)        = -0\r\n   * tanh(Infinity)  = 1\r\n   * tanh(-Infinity) = -1\r\n   * tanh(NaN)       = NaN\r\n   *\r\n   */\r\n  P.hyperbolicTangent = P.tanh = function () {\r\n    var pr, rm,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (!x.isFinite()) return new Ctor(x.s);\r\n    if (x.isZero()) return new Ctor(x);\r\n\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n    Ctor.precision = pr + 7;\r\n    Ctor.rounding = 1;\r\n\r\n    return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of\r\n   * this Decimal.\r\n   *\r\n   * Domain: [-1, 1]\r\n   * Range: [0, pi]\r\n   *\r\n   * acos(x) = pi/2 - asin(x)\r\n   *\r\n   * acos(0)       = pi/2\r\n   * acos(-0)      = pi/2\r\n   * acos(1)       = 0\r\n   * acos(-1)      = pi\r\n   * acos(1/2)     = pi/3\r\n   * acos(-1/2)    = 2*pi/3\r\n   * acos(|x| > 1) = NaN\r\n   * acos(NaN)     = NaN\r\n   *\r\n   */\r\n  P.inverseCosine = P.acos = function () {\r\n    var halfPi,\r\n      x = this,\r\n      Ctor = x.constructor,\r\n      k = x.abs().cmp(1),\r\n      pr = Ctor.precision,\r\n      rm = Ctor.rounding;\r\n\r\n    if (k !== -1) {\r\n      return k === 0\r\n        // |x| is 1\r\n        ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)\r\n        // |x| > 1 or x is NaN\r\n        : new Ctor(NaN);\r\n    }\r\n\r\n    if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n    // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3\r\n\r\n    Ctor.precision = pr + 6;\r\n    Ctor.rounding = 1;\r\n\r\n    x = x.asin();\r\n    halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n    Ctor.precision = pr;\r\n    Ctor.rounding = rm;\r\n\r\n    return halfPi.minus(x);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the\r\n   * value of this Decimal.\r\n   *\r\n   * Domain: [1, Infinity]\r\n   * Range: [0, Infinity]\r\n   *\r\n   * acosh(x) = ln(x + sqrt(x^2 - 1))\r\n   *\r\n   * acosh(x < 1)     = NaN\r\n   * acosh(NaN)       = NaN\r\n   * acosh(Infinity)  = Infinity\r\n   * acosh(-Infinity) = NaN\r\n   * acosh(0)         = NaN\r\n   * acosh(-0)        = NaN\r\n   * acosh(1)         = 0\r\n   * acosh(-1)        = NaN\r\n   *\r\n   */\r\n  P.inverseHyperbolicCosine = P.acosh = function () {\r\n    var pr, rm,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);\r\n    if (!x.isFinite()) return new Ctor(x);\r\n\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n    Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;\r\n    Ctor.rounding = 1;\r\n    external = false;\r\n\r\n    x = x.times(x).minus(1).sqrt().plus(x);\r\n\r\n    external = true;\r\n    Ctor.precision = pr;\r\n    Ctor.rounding = rm;\r\n\r\n    return x.ln();\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value\r\n   * of this Decimal.\r\n   *\r\n   * Domain: [-Infinity, Infinity]\r\n   * Range: [-Infinity, Infinity]\r\n   *\r\n   * asinh(x) = ln(x + sqrt(x^2 + 1))\r\n   *\r\n   * asinh(NaN)       = NaN\r\n   * asinh(Infinity)  = Infinity\r\n   * asinh(-Infinity) = -Infinity\r\n   * asinh(0)         = 0\r\n   * asinh(-0)        = -0\r\n   *\r\n   */\r\n  P.inverseHyperbolicSine = P.asinh = function () {\r\n    var pr, rm,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n    Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;\r\n    Ctor.rounding = 1;\r\n    external = false;\r\n\r\n    x = x.times(x).plus(1).sqrt().plus(x);\r\n\r\n    external = true;\r\n    Ctor.precision = pr;\r\n    Ctor.rounding = rm;\r\n\r\n    return x.ln();\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the\r\n   * value of this Decimal.\r\n   *\r\n   * Domain: [-1, 1]\r\n   * Range: [-Infinity, Infinity]\r\n   *\r\n   * atanh(x) = 0.5 * ln((1 + x) / (1 - x))\r\n   *\r\n   * atanh(|x| > 1)   = NaN\r\n   * atanh(NaN)       = NaN\r\n   * atanh(Infinity)  = NaN\r\n   * atanh(-Infinity) = NaN\r\n   * atanh(0)         = 0\r\n   * atanh(-0)        = -0\r\n   * atanh(1)         = Infinity\r\n   * atanh(-1)        = -Infinity\r\n   *\r\n   */\r\n  P.inverseHyperbolicTangent = P.atanh = function () {\r\n    var pr, rm, wpr, xsd,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (!x.isFinite()) return new Ctor(NaN);\r\n    if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);\r\n\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n    xsd = x.sd();\r\n\r\n    if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);\r\n\r\n    Ctor.precision = wpr = xsd - x.e;\r\n\r\n    x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);\r\n\r\n    Ctor.precision = pr + 4;\r\n    Ctor.rounding = 1;\r\n\r\n    x = x.ln();\r\n\r\n    Ctor.precision = pr;\r\n    Ctor.rounding = rm;\r\n\r\n    return x.times(0.5);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this\r\n   * Decimal.\r\n   *\r\n   * Domain: [-Infinity, Infinity]\r\n   * Range: [-pi/2, pi/2]\r\n   *\r\n   * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))\r\n   *\r\n   * asin(0)       = 0\r\n   * asin(-0)      = -0\r\n   * asin(1/2)     = pi/6\r\n   * asin(-1/2)    = -pi/6\r\n   * asin(1)       = pi/2\r\n   * asin(-1)      = -pi/2\r\n   * asin(|x| > 1) = NaN\r\n   * asin(NaN)     = NaN\r\n   *\r\n   * TODO? Compare performance of Taylor series.\r\n   *\r\n   */\r\n  P.inverseSine = P.asin = function () {\r\n    var halfPi, k,\r\n      pr, rm,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (x.isZero()) return new Ctor(x);\r\n\r\n    k = x.abs().cmp(1);\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n\r\n    if (k !== -1) {\r\n\r\n      // |x| is 1\r\n      if (k === 0) {\r\n        halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n        halfPi.s = x.s;\r\n        return halfPi;\r\n      }\r\n\r\n      // |x| > 1 or x is NaN\r\n      return new Ctor(NaN);\r\n    }\r\n\r\n    // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6\r\n\r\n    Ctor.precision = pr + 6;\r\n    Ctor.rounding = 1;\r\n\r\n    x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();\r\n\r\n    Ctor.precision = pr;\r\n    Ctor.rounding = rm;\r\n\r\n    return x.times(2);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value\r\n   * of this Decimal.\r\n   *\r\n   * Domain: [-Infinity, Infinity]\r\n   * Range: [-pi/2, pi/2]\r\n   *\r\n   * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n   *\r\n   * atan(0)         = 0\r\n   * atan(-0)        = -0\r\n   * atan(1)         = pi/4\r\n   * atan(-1)        = -pi/4\r\n   * atan(Infinity)  = pi/2\r\n   * atan(-Infinity) = -pi/2\r\n   * atan(NaN)       = NaN\r\n   *\r\n   */\r\n  P.inverseTangent = P.atan = function () {\r\n    var i, j, k, n, px, t, r, wpr, x2,\r\n      x = this,\r\n      Ctor = x.constructor,\r\n      pr = Ctor.precision,\r\n      rm = Ctor.rounding;\r\n\r\n    if (!x.isFinite()) {\r\n      if (!x.s) return new Ctor(NaN);\r\n      if (pr + 4 <= PI_PRECISION) {\r\n        r = getPi(Ctor, pr + 4, rm).times(0.5);\r\n        r.s = x.s;\r\n        return r;\r\n      }\r\n    } else if (x.isZero()) {\r\n      return new Ctor(x);\r\n    } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {\r\n      r = getPi(Ctor, pr + 4, rm).times(0.25);\r\n      r.s = x.s;\r\n      return r;\r\n    }\r\n\r\n    Ctor.precision = wpr = pr + 10;\r\n    Ctor.rounding = 1;\r\n\r\n    // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);\r\n\r\n    // Argument reduction\r\n    // Ensure |x| < 0.42\r\n    // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))\r\n\r\n    k = Math.min(28, wpr / LOG_BASE + 2 | 0);\r\n\r\n    for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));\r\n\r\n    external = false;\r\n\r\n    j = Math.ceil(wpr / LOG_BASE);\r\n    n = 1;\r\n    x2 = x.times(x);\r\n    r = new Ctor(x);\r\n    px = x;\r\n\r\n    // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n    for (; i !== -1;) {\r\n      px = px.times(x2);\r\n      t = r.minus(px.div(n += 2));\r\n\r\n      px = px.times(x2);\r\n      r = t.plus(px.div(n += 2));\r\n\r\n      if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;);\r\n    }\r\n\r\n    if (k) r = r.times(2 << (k - 1));\r\n\r\n    external = true;\r\n\r\n    return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Decimal is a finite number, otherwise return false.\r\n   *\r\n   */\r\n  P.isFinite = function () {\r\n    return !!this.d;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Decimal is an integer, otherwise return false.\r\n   *\r\n   */\r\n  P.isInteger = P.isInt = function () {\r\n    return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Decimal is NaN, otherwise return false.\r\n   *\r\n   */\r\n  P.isNaN = function () {\r\n    return !this.s;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Decimal is negative, otherwise return false.\r\n   *\r\n   */\r\n  P.isNegative = P.isNeg = function () {\r\n    return this.s < 0;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Decimal is positive, otherwise return false.\r\n   *\r\n   */\r\n  P.isPositive = P.isPos = function () {\r\n    return this.s > 0;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Decimal is 0 or -0, otherwise return false.\r\n   *\r\n   */\r\n  P.isZero = function () {\r\n    return !!this.d && this.d[0] === 0;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n   *\r\n   */\r\n  P.lessThan = P.lt = function (y) {\r\n    return this.cmp(y) < 0;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n   *\r\n   */\r\n  P.lessThanOrEqualTo = P.lte = function (y) {\r\n    return this.cmp(y) < 1;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   * If no base is specified, return log[10](arg).\r\n   *\r\n   * log[base](arg) = ln(arg) / ln(base)\r\n   *\r\n   * The result will always be correctly rounded if the base of the log is 10, and 'almost always'\r\n   * otherwise:\r\n   *\r\n   * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen\r\n   * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error\r\n   * between the result and the correctly rounded result will be one ulp (unit in the last place).\r\n   *\r\n   * log[-b](a)       = NaN\r\n   * log[0](a)        = NaN\r\n   * log[1](a)        = NaN\r\n   * log[NaN](a)      = NaN\r\n   * log[Infinity](a) = NaN\r\n   * log[b](0)        = -Infinity\r\n   * log[b](-0)       = -Infinity\r\n   * log[b](-a)       = NaN\r\n   * log[b](1)        = 0\r\n   * log[b](Infinity) = Infinity\r\n   * log[b](NaN)      = NaN\r\n   *\r\n   * [base] {number|string|Decimal} The base of the logarithm.\r\n   *\r\n   */\r\n  P.logarithm = P.log = function (base) {\r\n    var isBase10, d, denominator, k, inf, num, sd, r,\r\n      arg = this,\r\n      Ctor = arg.constructor,\r\n      pr = Ctor.precision,\r\n      rm = Ctor.rounding,\r\n      guard = 5;\r\n\r\n    // Default base is 10.\r\n    if (base == null) {\r\n      base = new Ctor(10);\r\n      isBase10 = true;\r\n    } else {\r\n      base = new Ctor(base);\r\n      d = base.d;\r\n\r\n      // Return NaN if base is negative, or non-finite, or is 0 or 1.\r\n      if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);\r\n\r\n      isBase10 = base.eq(10);\r\n    }\r\n\r\n    d = arg.d;\r\n\r\n    // Is arg negative, non-finite, 0 or 1?\r\n    if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {\r\n      return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);\r\n    }\r\n\r\n    // The result will have a non-terminating decimal expansion if base is 10 and arg is not an\r\n    // integer power of 10.\r\n    if (isBase10) {\r\n      if (d.length > 1) {\r\n        inf = true;\r\n      } else {\r\n        for (k = d[0]; k % 10 === 0;) k /= 10;\r\n        inf = k !== 1;\r\n      }\r\n    }\r\n\r\n    external = false;\r\n    sd = pr + guard;\r\n    num = naturalLogarithm(arg, sd);\r\n    denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n\r\n    // The result will have 5 rounding digits.\r\n    r = divide(num, denominator, sd, 1);\r\n\r\n    // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,\r\n    // calculate 10 further digits.\r\n    //\r\n    // If the result is known to have an infinite decimal expansion, repeat this until it is clear\r\n    // that the result is above or below the boundary. Otherwise, if after calculating the 10\r\n    // further digits, the last 14 are nines, round up and assume the result is exact.\r\n    // Also assume the result is exact if the last 14 are zero.\r\n    //\r\n    // Example of a result that will be incorrectly rounded:\r\n    // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...\r\n    // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it\r\n    // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so\r\n    // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal\r\n    // place is still 2.6.\r\n    if (checkRoundingDigits(r.d, k = pr, rm)) {\r\n\r\n      do {\r\n        sd += 10;\r\n        num = naturalLogarithm(arg, sd);\r\n        denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n        r = divide(num, denominator, sd, 1);\r\n\r\n        if (!inf) {\r\n\r\n          // Check for 14 nines from the 2nd rounding digit, as the first may be 4.\r\n          if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {\r\n            r = finalise(r, pr + 1, 0);\r\n          }\r\n\r\n          break;\r\n        }\r\n      } while (checkRoundingDigits(r.d, k += 10, rm));\r\n    }\r\n\r\n    external = true;\r\n\r\n    return finalise(r, pr, rm);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.\r\n   *\r\n   * arguments {number|string|Decimal}\r\n   *\r\n  P.max = function () {\r\n    Array.prototype.push.call(arguments, this);\r\n    return maxOrMin(this.constructor, arguments, 'lt');\r\n  };\r\n   */\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.\r\n   *\r\n   * arguments {number|string|Decimal}\r\n   *\r\n  P.min = function () {\r\n    Array.prototype.push.call(arguments, this);\r\n    return maxOrMin(this.constructor, arguments, 'gt');\r\n  };\r\n   */\r\n\r\n\r\n  /*\r\n   *  n - 0 = n\r\n   *  n - N = N\r\n   *  n - I = -I\r\n   *  0 - n = -n\r\n   *  0 - 0 = 0\r\n   *  0 - N = N\r\n   *  0 - I = -I\r\n   *  N - n = N\r\n   *  N - 0 = N\r\n   *  N - N = N\r\n   *  N - I = N\r\n   *  I - n = I\r\n   *  I - 0 = I\r\n   *  I - N = N\r\n   *  I - I = N\r\n   *\r\n   * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   */\r\n  P.minus = P.sub = function (y) {\r\n    var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    y = new Ctor(y);\r\n\r\n    // If either is not finite...\r\n    if (!x.d || !y.d) {\r\n\r\n      // Return NaN if either is NaN.\r\n      if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n      // Return y negated if x is finite and y is ±Infinity.\r\n      else if (x.d) y.s = -y.s;\r\n\r\n      // Return x if y is finite and x is ±Infinity.\r\n      // Return x if both are ±Infinity with different signs.\r\n      // Return NaN if both are ±Infinity with the same sign.\r\n      else y = new Ctor(y.d || x.s !== y.s ? x : NaN);\r\n\r\n      return y;\r\n    }\r\n\r\n    // If signs differ...\r\n    if (x.s != y.s) {\r\n      y.s = -y.s;\r\n      return x.plus(y);\r\n    }\r\n\r\n    xd = x.d;\r\n    yd = y.d;\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n\r\n    // If either is zero...\r\n    if (!xd[0] || !yd[0]) {\r\n\r\n      // Return y negated if x is zero and y is non-zero.\r\n      if (yd[0]) y.s = -y.s;\r\n\r\n      // Return x if y is zero and x is non-zero.\r\n      else if (xd[0]) y = new Ctor(x);\r\n\r\n      // Return zero if both are zero.\r\n      // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.\r\n      else return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n      return external ? finalise(y, pr, rm) : y;\r\n    }\r\n\r\n    // x and y are finite, non-zero numbers with the same sign.\r\n\r\n    // Calculate base 1e7 exponents.\r\n    e = mathfloor(y.e / LOG_BASE);\r\n    xe = mathfloor(x.e / LOG_BASE);\r\n\r\n    xd = xd.slice();\r\n    k = xe - e;\r\n\r\n    // If base 1e7 exponents differ...\r\n    if (k) {\r\n      xLTy = k < 0;\r\n\r\n      if (xLTy) {\r\n        d = xd;\r\n        k = -k;\r\n        len = yd.length;\r\n      } else {\r\n        d = yd;\r\n        e = xe;\r\n        len = xd.length;\r\n      }\r\n\r\n      // Numbers with massively different exponents would result in a very high number of\r\n      // zeros needing to be prepended, but this can be avoided while still ensuring correct\r\n      // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n      i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n      if (k > i) {\r\n        k = i;\r\n        d.length = 1;\r\n      }\r\n\r\n      // Prepend zeros to equalise exponents.\r\n      d.reverse();\r\n      for (i = k; i--;) d.push(0);\r\n      d.reverse();\r\n\r\n    // Base 1e7 exponents equal.\r\n    } else {\r\n\r\n      // Check digits to determine which is the bigger number.\r\n\r\n      i = xd.length;\r\n      len = yd.length;\r\n      xLTy = i < len;\r\n      if (xLTy) len = i;\r\n\r\n      for (i = 0; i < len; i++) {\r\n        if (xd[i] != yd[i]) {\r\n          xLTy = xd[i] < yd[i];\r\n          break;\r\n        }\r\n      }\r\n\r\n      k = 0;\r\n    }\r\n\r\n    if (xLTy) {\r\n      d = xd;\r\n      xd = yd;\r\n      yd = d;\r\n      y.s = -y.s;\r\n    }\r\n\r\n    len = xd.length;\r\n\r\n    // Append zeros to `xd` if shorter.\r\n    // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.\r\n    for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n    // Subtract yd from xd.\r\n    for (i = yd.length; i > k;) {\r\n\r\n      if (xd[--i] < yd[i]) {\r\n        for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n        --xd[j];\r\n        xd[i] += BASE;\r\n      }\r\n\r\n      xd[i] -= yd[i];\r\n    }\r\n\r\n    // Remove trailing zeros.\r\n    for (; xd[--len] === 0;) xd.pop();\r\n\r\n    // Remove leading zeros and adjust exponent accordingly.\r\n    for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n    // Zero?\r\n    if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n    y.d = xd;\r\n    y.e = getBase10Exponent(xd, e);\r\n\r\n    return external ? finalise(y, pr, rm) : y;\r\n  };\r\n\r\n\r\n  /*\r\n   *   n % 0 =  N\r\n   *   n % N =  N\r\n   *   n % I =  n\r\n   *   0 % n =  0\r\n   *  -0 % n = -0\r\n   *   0 % 0 =  N\r\n   *   0 % N =  N\r\n   *   0 % I =  0\r\n   *   N % n =  N\r\n   *   N % 0 =  N\r\n   *   N % N =  N\r\n   *   N % I =  N\r\n   *   I % n =  N\r\n   *   I % 0 =  N\r\n   *   I % N =  N\r\n   *   I % I =  N\r\n   *\r\n   * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to\r\n   * `precision` significant digits using rounding mode `rounding`.\r\n   *\r\n   * The result depends on the modulo mode.\r\n   *\r\n   */\r\n  P.modulo = P.mod = function (y) {\r\n    var q,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    y = new Ctor(y);\r\n\r\n    // Return NaN if x is ±Infinity or NaN, or y is NaN or ±0.\r\n    if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);\r\n\r\n    // Return x if y is ±Infinity or x is ±0.\r\n    if (!y.d || x.d && !x.d[0]) {\r\n      return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);\r\n    }\r\n\r\n    // Prevent rounding of intermediate calculations.\r\n    external = false;\r\n\r\n    if (Ctor.modulo == 9) {\r\n\r\n      // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n      // result = x - q * y    where  0 <= result < abs(y)\r\n      q = divide(x, y.abs(), 0, 3, 1);\r\n      q.s *= y.s;\r\n    } else {\r\n      q = divide(x, y, 0, Ctor.modulo, 1);\r\n    }\r\n\r\n    q = q.times(y);\r\n\r\n    external = true;\r\n\r\n    return x.minus(q);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n   * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   */\r\n  P.naturalExponential = P.exp = function () {\r\n    return naturalExponential(this);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n   * rounded to `precision` significant digits using rounding mode `rounding`.\r\n   *\r\n   */\r\n  P.naturalLogarithm = P.ln = function () {\r\n    return naturalLogarithm(this);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n   * -1.\r\n   *\r\n   */\r\n  P.negated = P.neg = function () {\r\n    var x = new this.constructor(this);\r\n    x.s = -x.s;\r\n    return finalise(x);\r\n  };\r\n\r\n\r\n  /*\r\n   *  n + 0 = n\r\n   *  n + N = N\r\n   *  n + I = I\r\n   *  0 + n = n\r\n   *  0 + 0 = 0\r\n   *  0 + N = N\r\n   *  0 + I = I\r\n   *  N + n = N\r\n   *  N + 0 = N\r\n   *  N + N = N\r\n   *  N + I = N\r\n   *  I + n = I\r\n   *  I + 0 = I\r\n   *  I + N = N\r\n   *  I + I = I\r\n   *\r\n   * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   */\r\n  P.plus = P.add = function (y) {\r\n    var carry, d, e, i, k, len, pr, rm, xd, yd,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    y = new Ctor(y);\r\n\r\n    // If either is not finite...\r\n    if (!x.d || !y.d) {\r\n\r\n      // Return NaN if either is NaN.\r\n      if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n      // Return x if y is finite and x is ±Infinity.\r\n      // Return x if both are ±Infinity with the same sign.\r\n      // Return NaN if both are ±Infinity with different signs.\r\n      // Return y if x is finite and y is ±Infinity.\r\n      else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);\r\n\r\n      return y;\r\n    }\r\n\r\n     // If signs differ...\r\n    if (x.s != y.s) {\r\n      y.s = -y.s;\r\n      return x.minus(y);\r\n    }\r\n\r\n    xd = x.d;\r\n    yd = y.d;\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n\r\n    // If either is zero...\r\n    if (!xd[0] || !yd[0]) {\r\n\r\n      // Return x if y is zero.\r\n      // Return y if y is non-zero.\r\n      if (!yd[0]) y = new Ctor(x);\r\n\r\n      return external ? finalise(y, pr, rm) : y;\r\n    }\r\n\r\n    // x and y are finite, non-zero numbers with the same sign.\r\n\r\n    // Calculate base 1e7 exponents.\r\n    k = mathfloor(x.e / LOG_BASE);\r\n    e = mathfloor(y.e / LOG_BASE);\r\n\r\n    xd = xd.slice();\r\n    i = k - e;\r\n\r\n    // If base 1e7 exponents differ...\r\n    if (i) {\r\n\r\n      if (i < 0) {\r\n        d = xd;\r\n        i = -i;\r\n        len = yd.length;\r\n      } else {\r\n        d = yd;\r\n        e = k;\r\n        len = xd.length;\r\n      }\r\n\r\n      // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n      k = Math.ceil(pr / LOG_BASE);\r\n      len = k > len ? k + 1 : len + 1;\r\n\r\n      if (i > len) {\r\n        i = len;\r\n        d.length = 1;\r\n      }\r\n\r\n      // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n      d.reverse();\r\n      for (; i--;) d.push(0);\r\n      d.reverse();\r\n    }\r\n\r\n    len = xd.length;\r\n    i = yd.length;\r\n\r\n    // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n    if (len - i < 0) {\r\n      i = len;\r\n      d = yd;\r\n      yd = xd;\r\n      xd = d;\r\n    }\r\n\r\n    // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n    for (carry = 0; i;) {\r\n      carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n      xd[i] %= BASE;\r\n    }\r\n\r\n    if (carry) {\r\n      xd.unshift(carry);\r\n      ++e;\r\n    }\r\n\r\n    // Remove trailing zeros.\r\n    // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n    for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n    y.d = xd;\r\n    y.e = getBase10Exponent(xd, e);\r\n\r\n    return external ? finalise(y, pr, rm) : y;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return the number of significant digits of the value of this Decimal.\r\n   *\r\n   * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n   *\r\n   */\r\n  P.precision = P.sd = function (z) {\r\n    var k,\r\n      x = this;\r\n\r\n    if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n    if (x.d) {\r\n      k = getPrecision(x.d);\r\n      if (z && x.e + 1 > k) k = x.e + 1;\r\n    } else {\r\n      k = NaN;\r\n    }\r\n\r\n    return k;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n   * rounding mode `rounding`.\r\n   *\r\n   */\r\n  P.round = function () {\r\n    var x = this,\r\n      Ctor = x.constructor;\r\n\r\n    return finalise(new Ctor(x), x.e + 1, Ctor.rounding);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the sine of the value in radians of this Decimal.\r\n   *\r\n   * Domain: [-Infinity, Infinity]\r\n   * Range: [-1, 1]\r\n   *\r\n   * sin(x) = x - x^3/3! + x^5/5! - ...\r\n   *\r\n   * sin(0)         = 0\r\n   * sin(-0)        = -0\r\n   * sin(Infinity)  = NaN\r\n   * sin(-Infinity) = NaN\r\n   * sin(NaN)       = NaN\r\n   *\r\n   */\r\n  P.sine = P.sin = function () {\r\n    var pr, rm,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (!x.isFinite()) return new Ctor(NaN);\r\n    if (x.isZero()) return new Ctor(x);\r\n\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n    Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n    Ctor.rounding = 1;\r\n\r\n    x = sine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n    Ctor.precision = pr;\r\n    Ctor.rounding = rm;\r\n\r\n    return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   *  sqrt(-n) =  N\r\n   *  sqrt(N)  =  N\r\n   *  sqrt(-I) =  N\r\n   *  sqrt(I)  =  I\r\n   *  sqrt(0)  =  0\r\n   *  sqrt(-0) = -0\r\n   *\r\n   */\r\n  P.squareRoot = P.sqrt = function () {\r\n    var m, n, sd, r, rep, t,\r\n      x = this,\r\n      d = x.d,\r\n      e = x.e,\r\n      s = x.s,\r\n      Ctor = x.constructor;\r\n\r\n    // Negative/NaN/Infinity/zero?\r\n    if (s !== 1 || !d || !d[0]) {\r\n      return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);\r\n    }\r\n\r\n    external = false;\r\n\r\n    // Initial estimate.\r\n    s = Math.sqrt(+x);\r\n\r\n    // Math.sqrt underflow/overflow?\r\n    // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n    if (s == 0 || s == 1 / 0) {\r\n      n = digitsToString(d);\r\n\r\n      if ((n.length + e) % 2 == 0) n += '0';\r\n      s = Math.sqrt(n);\r\n      e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n      if (s == 1 / 0) {\r\n        n = '1e' + e;\r\n      } else {\r\n        n = s.toExponential();\r\n        n = n.slice(0, n.indexOf('e') + 1) + e;\r\n      }\r\n\r\n      r = new Ctor(n);\r\n    } else {\r\n      r = new Ctor(s.toString());\r\n    }\r\n\r\n    sd = (e = Ctor.precision) + 3;\r\n\r\n    // Newton-Raphson iteration.\r\n    for (;;) {\r\n      t = r;\r\n      r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);\r\n\r\n      // TODO? Replace with for-loop and checkRoundingDigits.\r\n      if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n        n = n.slice(sd - 3, sd + 1);\r\n\r\n        // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n        // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n        if (n == '9999' || !rep && n == '4999') {\r\n\r\n          // On the first iteration only, check to see if rounding up gives the exact result as the\r\n          // nines may infinitely repeat.\r\n          if (!rep) {\r\n            finalise(t, e + 1, 0);\r\n\r\n            if (t.times(t).eq(x)) {\r\n              r = t;\r\n              break;\r\n            }\r\n          }\r\n\r\n          sd += 4;\r\n          rep = 1;\r\n        } else {\r\n\r\n          // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n          // If not, then there are further digits and m will be truthy.\r\n          if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n            // Truncate to the first rounding digit.\r\n            finalise(r, e + 1, 1);\r\n            m = !r.times(r).eq(x);\r\n          }\r\n\r\n          break;\r\n        }\r\n      }\r\n    }\r\n\r\n    external = true;\r\n\r\n    return finalise(r, e, Ctor.rounding, m);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.\r\n   *\r\n   * Domain: [-Infinity, Infinity]\r\n   * Range: [-Infinity, Infinity]\r\n   *\r\n   * tan(0)         = 0\r\n   * tan(-0)        = -0\r\n   * tan(Infinity)  = NaN\r\n   * tan(-Infinity) = NaN\r\n   * tan(NaN)       = NaN\r\n   *\r\n   */\r\n  P.tangent = P.tan = function () {\r\n    var pr, rm,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (!x.isFinite()) return new Ctor(NaN);\r\n    if (x.isZero()) return new Ctor(x);\r\n\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n    Ctor.precision = pr + 10;\r\n    Ctor.rounding = 1;\r\n\r\n    x = x.sin();\r\n    x.s = 1;\r\n    x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);\r\n\r\n    Ctor.precision = pr;\r\n    Ctor.rounding = rm;\r\n\r\n    return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);\r\n  };\r\n\r\n\r\n  /*\r\n   *  n * 0 = 0\r\n   *  n * N = N\r\n   *  n * I = I\r\n   *  0 * n = 0\r\n   *  0 * 0 = 0\r\n   *  0 * N = N\r\n   *  0 * I = N\r\n   *  N * n = N\r\n   *  N * 0 = N\r\n   *  N * N = N\r\n   *  N * I = N\r\n   *  I * n = I\r\n   *  I * 0 = N\r\n   *  I * N = N\r\n   *  I * I = I\r\n   *\r\n   * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant\r\n   * digits using rounding mode `rounding`.\r\n   *\r\n   */\r\n  P.times = P.mul = function (y) {\r\n    var carry, e, i, k, r, rL, t, xdL, ydL,\r\n      x = this,\r\n      Ctor = x.constructor,\r\n      xd = x.d,\r\n      yd = (y = new Ctor(y)).d;\r\n\r\n    y.s *= x.s;\r\n\r\n     // If either is NaN, ±Infinity or ±0...\r\n    if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n      return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd\r\n\r\n        // Return NaN if either is NaN.\r\n        // Return NaN if x is ±0 and y is ±Infinity, or y is ±0 and x is ±Infinity.\r\n        ? NaN\r\n\r\n        // Return ±Infinity if either is ±Infinity.\r\n        // Return ±0 if either is ±0.\r\n        : !xd || !yd ? y.s / 0 : y.s * 0);\r\n    }\r\n\r\n    e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);\r\n    xdL = xd.length;\r\n    ydL = yd.length;\r\n\r\n    // Ensure xd points to the longer array.\r\n    if (xdL < ydL) {\r\n      r = xd;\r\n      xd = yd;\r\n      yd = r;\r\n      rL = xdL;\r\n      xdL = ydL;\r\n      ydL = rL;\r\n    }\r\n\r\n    // Initialise the result array with zeros.\r\n    r = [];\r\n    rL = xdL + ydL;\r\n    for (i = rL; i--;) r.push(0);\r\n\r\n    // Multiply!\r\n    for (i = ydL; --i >= 0;) {\r\n      carry = 0;\r\n      for (k = xdL + i; k > i;) {\r\n        t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n        r[k--] = t % BASE | 0;\r\n        carry = t / BASE | 0;\r\n      }\r\n\r\n      r[k] = (r[k] + carry) % BASE | 0;\r\n    }\r\n\r\n    // Remove trailing zeros.\r\n    for (; !r[--rL];) r.pop();\r\n\r\n    if (carry) ++e;\r\n    else r.shift();\r\n\r\n    y.d = r;\r\n    y.e = getBase10Exponent(r, e);\r\n\r\n    return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Decimal in base 2, round to `sd` significant\r\n   * digits using rounding mode `rm`.\r\n   *\r\n   * If the optional `sd` argument is present then return binary exponential notation.\r\n   *\r\n   * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n   *\r\n   */\r\n  P.toBinary = function (sd, rm) {\r\n    return toStringBinary(this, 2, sd, rm);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n   * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n   *\r\n   * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n   *\r\n   * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n   *\r\n   */\r\n  P.toDecimalPlaces = P.toDP = function (dp, rm) {\r\n    var x = this,\r\n      Ctor = x.constructor;\r\n\r\n    x = new Ctor(x);\r\n    if (dp === void 0) return x;\r\n\r\n    checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n    if (rm === void 0) rm = Ctor.rounding;\r\n    else checkInt32(rm, 0, 8);\r\n\r\n    return finalise(x, dp + x.e + 1, rm);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Decimal in exponential notation rounded to\r\n   * `dp` fixed decimal places using rounding mode `rounding`.\r\n   *\r\n   * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n   *\r\n   */\r\n  P.toExponential = function (dp, rm) {\r\n    var str,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (dp === void 0) {\r\n      str = finiteToString(x, true);\r\n    } else {\r\n      checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n      if (rm === void 0) rm = Ctor.rounding;\r\n      else checkInt32(rm, 0, 8);\r\n\r\n      x = finalise(new Ctor(x), dp + 1, rm);\r\n      str = finiteToString(x, true, dp + 1);\r\n    }\r\n\r\n    return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n   * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n   * omitted.\r\n   *\r\n   * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n   *\r\n   * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n   *\r\n   * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n   * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n   * (-0).toFixed(3) is '0.000'.\r\n   * (-0.5).toFixed(0) is '-0'.\r\n   *\r\n   */\r\n  P.toFixed = function (dp, rm) {\r\n    var str, y,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (dp === void 0) {\r\n      str = finiteToString(x);\r\n    } else {\r\n      checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n      if (rm === void 0) rm = Ctor.rounding;\r\n      else checkInt32(rm, 0, 8);\r\n\r\n      y = finalise(new Ctor(x), dp + x.e + 1, rm);\r\n      str = finiteToString(y, false, dp + y.e + 1);\r\n    }\r\n\r\n    // To determine whether to add the minus sign look at the value before it was rounded,\r\n    // i.e. look at `x` rather than `y`.\r\n    return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return an array representing the value of this Decimal as a simple fraction with an integer\r\n   * numerator and an integer denominator.\r\n   *\r\n   * The denominator will be a positive non-zero value less than or equal to the specified maximum\r\n   * denominator. If a maximum denominator is not specified, the denominator will be the lowest\r\n   * value necessary to represent the number exactly.\r\n   *\r\n   * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity.\r\n   *\r\n   */\r\n  P.toFraction = function (maxD) {\r\n    var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r,\r\n      x = this,\r\n      xd = x.d,\r\n      Ctor = x.constructor;\r\n\r\n    if (!xd) return new Ctor(x);\r\n\r\n    n1 = d0 = new Ctor(1);\r\n    d1 = n0 = new Ctor(0);\r\n\r\n    d = new Ctor(d1);\r\n    e = d.e = getPrecision(xd) - x.e - 1;\r\n    k = e % LOG_BASE;\r\n    d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);\r\n\r\n    if (maxD == null) {\r\n\r\n      // d is 10**e, the minimum max-denominator needed.\r\n      maxD = e > 0 ? d : n1;\r\n    } else {\r\n      n = new Ctor(maxD);\r\n      if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);\r\n      maxD = n.gt(d) ? (e > 0 ? d : n1) : n;\r\n    }\r\n\r\n    external = false;\r\n    n = new Ctor(digitsToString(xd));\r\n    pr = Ctor.precision;\r\n    Ctor.precision = e = xd.length * LOG_BASE * 2;\r\n\r\n    for (;;)  {\r\n      q = divide(n, d, 0, 1, 1);\r\n      d2 = d0.plus(q.times(d1));\r\n      if (d2.cmp(maxD) == 1) break;\r\n      d0 = d1;\r\n      d1 = d2;\r\n      d2 = n1;\r\n      n1 = n0.plus(q.times(d2));\r\n      n0 = d2;\r\n      d2 = d;\r\n      d = n.minus(q.times(d2));\r\n      n = d2;\r\n    }\r\n\r\n    d2 = divide(maxD.minus(d0), d1, 0, 1, 1);\r\n    n0 = n0.plus(d2.times(n1));\r\n    d0 = d0.plus(d2.times(d1));\r\n    n0.s = n1.s = x.s;\r\n\r\n    // Determine which fraction is closer to x, n0/d0 or n1/d1?\r\n    r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1\r\n        ? [n1, d1] : [n0, d0];\r\n\r\n    Ctor.precision = pr;\r\n    external = true;\r\n\r\n    return r;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Decimal in base 16, round to `sd` significant\r\n   * digits using rounding mode `rm`.\r\n   *\r\n   * If the optional `sd` argument is present then return binary exponential notation.\r\n   *\r\n   * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n   *\r\n   */\r\n  P.toHexadecimal = P.toHex = function (sd, rm) {\r\n    return toStringBinary(this, 16, sd, rm);\r\n  };\r\n\r\n\r\n  /*\r\n   * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding\r\n   * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.\r\n   *\r\n   * The return value will always have the same sign as this Decimal, unless either this Decimal\r\n   * or `y` is NaN, in which case the return value will be also be NaN.\r\n   *\r\n   * The return value is not affected by the value of `precision`.\r\n   *\r\n   * y {number|string|Decimal} The magnitude to round to a multiple of.\r\n   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n   *\r\n   * 'toNearest() rounding mode not an integer: {rm}'\r\n   * 'toNearest() rounding mode out of range: {rm}'\r\n   *\r\n   */\r\n  P.toNearest = function (y, rm) {\r\n    var x = this,\r\n      Ctor = x.constructor;\r\n\r\n    x = new Ctor(x);\r\n\r\n    if (y == null) {\r\n\r\n      // If x is not finite, return x.\r\n      if (!x.d) return x;\r\n\r\n      y = new Ctor(1);\r\n      rm = Ctor.rounding;\r\n    } else {\r\n      y = new Ctor(y);\r\n      if (rm === void 0) {\r\n        rm = Ctor.rounding;\r\n      } else {\r\n        checkInt32(rm, 0, 8);\r\n      }\r\n\r\n      // If x is not finite, return x if y is not NaN, else NaN.\r\n      if (!x.d) return y.s ? x : y;\r\n\r\n      // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.\r\n      if (!y.d) {\r\n        if (y.s) y.s = x.s;\r\n        return y;\r\n      }\r\n    }\r\n\r\n    // If y is not zero, calculate the nearest multiple of y to x.\r\n    if (y.d[0]) {\r\n      external = false;\r\n      x = divide(x, y, 0, rm, 1).times(y);\r\n      external = true;\r\n      finalise(x);\r\n\r\n    // If y is zero, return zero with the sign of x.\r\n    } else {\r\n      y.s = x.s;\r\n      x = y;\r\n    }\r\n\r\n    return x;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return the value of this Decimal converted to a number primitive.\r\n   * Zero keeps its sign.\r\n   *\r\n   */\r\n  P.toNumber = function () {\r\n    return +this;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Decimal in base 8, round to `sd` significant\r\n   * digits using rounding mode `rm`.\r\n   *\r\n   * If the optional `sd` argument is present then return binary exponential notation.\r\n   *\r\n   * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n   *\r\n   */\r\n  P.toOctal = function (sd, rm) {\r\n    return toStringBinary(this, 8, sd, rm);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded\r\n   * to `precision` significant digits using rounding mode `rounding`.\r\n   *\r\n   * ECMAScript compliant.\r\n   *\r\n   *   pow(x, NaN)                           = NaN\r\n   *   pow(x, ±0)                            = 1\r\n\r\n   *   pow(NaN, non-zero)                    = NaN\r\n   *   pow(abs(x) > 1, +Infinity)            = +Infinity\r\n   *   pow(abs(x) > 1, -Infinity)            = +0\r\n   *   pow(abs(x) == 1, ±Infinity)           = NaN\r\n   *   pow(abs(x) < 1, +Infinity)            = +0\r\n   *   pow(abs(x) < 1, -Infinity)            = +Infinity\r\n   *   pow(+Infinity, y > 0)                 = +Infinity\r\n   *   pow(+Infinity, y < 0)                 = +0\r\n   *   pow(-Infinity, odd integer > 0)       = -Infinity\r\n   *   pow(-Infinity, even integer > 0)      = +Infinity\r\n   *   pow(-Infinity, odd integer < 0)       = -0\r\n   *   pow(-Infinity, even integer < 0)      = +0\r\n   *   pow(+0, y > 0)                        = +0\r\n   *   pow(+0, y < 0)                        = +Infinity\r\n   *   pow(-0, odd integer > 0)              = -0\r\n   *   pow(-0, even integer > 0)             = +0\r\n   *   pow(-0, odd integer < 0)              = -Infinity\r\n   *   pow(-0, even integer < 0)             = +Infinity\r\n   *   pow(finite x < 0, finite non-integer) = NaN\r\n   *\r\n   * For non-integer or very large exponents pow(x, y) is calculated using\r\n   *\r\n   *   x^y = exp(y*ln(x))\r\n   *\r\n   * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the\r\n   * probability of an incorrectly rounded result\r\n   * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14\r\n   * i.e. 1 in 250,000,000,000,000\r\n   *\r\n   * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).\r\n   *\r\n   * y {number|string|Decimal} The power to which to raise this Decimal.\r\n   *\r\n   */\r\n  P.toPower = P.pow = function (y) {\r\n    var e, k, pr, r, rm, s,\r\n      x = this,\r\n      Ctor = x.constructor,\r\n      yn = +(y = new Ctor(y));\r\n\r\n    // Either ±Infinity, NaN or ±0?\r\n    if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));\r\n\r\n    x = new Ctor(x);\r\n\r\n    if (x.eq(1)) return x;\r\n\r\n    pr = Ctor.precision;\r\n    rm = Ctor.rounding;\r\n\r\n    if (y.eq(1)) return finalise(x, pr, rm);\r\n\r\n    // y exponent\r\n    e = mathfloor(y.e / LOG_BASE);\r\n\r\n    // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n    if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n      r = intPow(Ctor, x, k, pr);\r\n      return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);\r\n    }\r\n\r\n    s = x.s;\r\n\r\n    // if x is negative\r\n    if (s < 0) {\r\n\r\n      // if y is not an integer\r\n      if (e < y.d.length - 1) return new Ctor(NaN);\r\n\r\n      // Result is positive if x is negative and the last digit of integer y is even.\r\n      if ((y.d[e] & 1) == 0) s = 1;\r\n\r\n      // if x.eq(-1)\r\n      if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {\r\n        x.s = s;\r\n        return x;\r\n      }\r\n    }\r\n\r\n    // Estimate result exponent.\r\n    // x^y = 10^e,  where e = y * log10(x)\r\n    // log10(x) = log10(x_significand) + x_exponent\r\n    // log10(x_significand) = ln(x_significand) / ln(10)\r\n    k = mathpow(+x, yn);\r\n    e = k == 0 || !isFinite(k)\r\n      ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1))\r\n      : new Ctor(k + '').e;\r\n\r\n    // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.\r\n\r\n    // Overflow/underflow?\r\n    if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);\r\n\r\n    external = false;\r\n    Ctor.rounding = x.s = 1;\r\n\r\n    // Estimate the extra guard digits needed to ensure five correct rounding digits from\r\n    // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):\r\n    // new Decimal(2.32456).pow('2087987436534566.46411')\r\n    // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815\r\n    k = Math.min(12, (e + '').length);\r\n\r\n    // r = x^y = exp(y*ln(x))\r\n    r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);\r\n\r\n    // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)\r\n    if (r.d) {\r\n\r\n      // Truncate to the required precision plus five rounding digits.\r\n      r = finalise(r, pr + 5, 1);\r\n\r\n      // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate\r\n      // the result.\r\n      if (checkRoundingDigits(r.d, pr, rm)) {\r\n        e = pr + 10;\r\n\r\n        // Truncate to the increased precision plus five rounding digits.\r\n        r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);\r\n\r\n        // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).\r\n        if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {\r\n          r = finalise(r, pr + 1, 0);\r\n        }\r\n      }\r\n    }\r\n\r\n    r.s = s;\r\n    external = true;\r\n    Ctor.rounding = rm;\r\n\r\n    return finalise(r, pr, rm);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n   * using rounding mode `rounding`.\r\n   *\r\n   * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n   * the integer part of the value in normal notation.\r\n   *\r\n   * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n   *\r\n   */\r\n  P.toPrecision = function (sd, rm) {\r\n    var str,\r\n      x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (sd === void 0) {\r\n      str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n    } else {\r\n      checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n      if (rm === void 0) rm = Ctor.rounding;\r\n      else checkInt32(rm, 0, 8);\r\n\r\n      x = finalise(new Ctor(x), sd, rm);\r\n      str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);\r\n    }\r\n\r\n    return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n   * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n   * omitted.\r\n   *\r\n   * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n   *\r\n   * 'toSD() digits out of range: {sd}'\r\n   * 'toSD() digits not an integer: {sd}'\r\n   * 'toSD() rounding mode not an integer: {rm}'\r\n   * 'toSD() rounding mode out of range: {rm}'\r\n   *\r\n   */\r\n  P.toSignificantDigits = P.toSD = function (sd, rm) {\r\n    var x = this,\r\n      Ctor = x.constructor;\r\n\r\n    if (sd === void 0) {\r\n      sd = Ctor.precision;\r\n      rm = Ctor.rounding;\r\n    } else {\r\n      checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n      if (rm === void 0) rm = Ctor.rounding;\r\n      else checkInt32(rm, 0, 8);\r\n    }\r\n\r\n    return finalise(new Ctor(x), sd, rm);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Decimal.\r\n   *\r\n   * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n   * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n   *\r\n   */\r\n  P.toString = function () {\r\n    var x = this,\r\n      Ctor = x.constructor,\r\n      str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n    return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.\r\n   *\r\n   */\r\n  P.truncated = P.trunc = function () {\r\n    return finalise(new this.constructor(this), this.e + 1, 1);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Decimal.\r\n   * Unlike `toString`, negative zero will include the minus sign.\r\n   *\r\n   */\r\n  P.valueOf = P.toJSON = function () {\r\n    var x = this,\r\n      Ctor = x.constructor,\r\n      str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n    return x.isNeg() ? '-' + str : str;\r\n  };\r\n\r\n\r\n  /*\r\n  // Add aliases to match BigDecimal method names.\r\n  // P.add = P.plus;\r\n  P.subtract = P.minus;\r\n  P.multiply = P.times;\r\n  P.divide = P.div;\r\n  P.remainder = P.mod;\r\n  P.compareTo = P.cmp;\r\n  P.negate = P.neg;\r\n   */\r\n\r\n\r\n  // Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n  /*\r\n   *  digitsToString           P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,\r\n   *                           finiteToString, naturalExponential, naturalLogarithm\r\n   *  checkInt32               P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,\r\n   *                           P.toPrecision, P.toSignificantDigits, toStringBinary, random\r\n   *  checkRoundingDigits      P.logarithm, P.toPower, naturalExponential, naturalLogarithm\r\n   *  convertBase              toStringBinary, parseOther\r\n   *  cos                      P.cos\r\n   *  divide                   P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,\r\n   *                           P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,\r\n   *                           P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,\r\n   *                           taylorSeries, atan2, parseOther\r\n   *  finalise                 P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,\r\n   *                           P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,\r\n   *                           P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,\r\n   *                           P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,\r\n   *                           P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,\r\n   *                           P.truncated, divide, getLn10, getPi, naturalExponential,\r\n   *                           naturalLogarithm, ceil, floor, round, trunc\r\n   *  finiteToString           P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,\r\n   *                           toStringBinary\r\n   *  getBase10Exponent        P.minus, P.plus, P.times, parseOther\r\n   *  getLn10                  P.logarithm, naturalLogarithm\r\n   *  getPi                    P.acos, P.asin, P.atan, toLessThanHalfPi, atan2\r\n   *  getPrecision             P.precision, P.toFraction\r\n   *  getZeroString            digitsToString, finiteToString\r\n   *  intPow                   P.toPower, parseOther\r\n   *  isOdd                    toLessThanHalfPi\r\n   *  maxOrMin                 max, min\r\n   *  naturalExponential       P.naturalExponential, P.toPower\r\n   *  naturalLogarithm         P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,\r\n   *                           P.toPower, naturalExponential\r\n   *  nonFiniteToString        finiteToString, toStringBinary\r\n   *  parseDecimal             Decimal\r\n   *  parseOther               Decimal\r\n   *  sin                      P.sin\r\n   *  taylorSeries             P.cosh, P.sinh, cos, sin\r\n   *  toLessThanHalfPi         P.cos, P.sin\r\n   *  toStringBinary           P.toBinary, P.toHexadecimal, P.toOctal\r\n   *  truncate                 intPow\r\n   *\r\n   *  Throws:                  P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,\r\n   *                           naturalLogarithm, config, parseOther, random, Decimal\r\n   */\r\n\r\n\r\n  function digitsToString(d) {\r\n    var i, k, ws,\r\n      indexOfLastWord = d.length - 1,\r\n      str = '',\r\n      w = d[0];\r\n\r\n    if (indexOfLastWord > 0) {\r\n      str += w;\r\n      for (i = 1; i < indexOfLastWord; i++) {\r\n        ws = d[i] + '';\r\n        k = LOG_BASE - ws.length;\r\n        if (k) str += getZeroString(k);\r\n        str += ws;\r\n      }\r\n\r\n      w = d[i];\r\n      ws = w + '';\r\n      k = LOG_BASE - ws.length;\r\n      if (k) str += getZeroString(k);\r\n    } else if (w === 0) {\r\n      return '0';\r\n    }\r\n\r\n    // Remove trailing zeros of last w.\r\n    for (; w % 10 === 0;) w /= 10;\r\n\r\n    return str + w;\r\n  }\r\n\r\n\r\n  function checkInt32(i, min, max) {\r\n    if (i !== ~~i || i < min || i > max) {\r\n      throw Error(invalidArgument + i);\r\n    }\r\n  }\r\n\r\n\r\n  /*\r\n   * Check 5 rounding digits if `repeating` is null, 4 otherwise.\r\n   * `repeating == null` if caller is `log` or `pow`,\r\n   * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.\r\n   */\r\n  function checkRoundingDigits(d, i, rm, repeating) {\r\n    var di, k, r, rd;\r\n\r\n    // Get the length of the first word of the array d.\r\n    for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n    // Is the rounding digit in the first word of d?\r\n    if (--i < 0) {\r\n      i += LOG_BASE;\r\n      di = 0;\r\n    } else {\r\n      di = Math.ceil((i + 1) / LOG_BASE);\r\n      i %= LOG_BASE;\r\n    }\r\n\r\n    // i is the index (0 - 6) of the rounding digit.\r\n    // E.g. if within the word 3487563 the first rounding digit is 5,\r\n    // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n    k = mathpow(10, LOG_BASE - i);\r\n    rd = d[di] % k | 0;\r\n\r\n    if (repeating == null) {\r\n      if (i < 3) {\r\n        if (i == 0) rd = rd / 100 | 0;\r\n        else if (i == 1) rd = rd / 10 | 0;\r\n        r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n      } else {\r\n        r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n          (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n            (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n      }\r\n    } else {\r\n      if (i < 4) {\r\n        if (i == 0) rd = rd / 1000 | 0;\r\n        else if (i == 1) rd = rd / 100 | 0;\r\n        else if (i == 2) rd = rd / 10 | 0;\r\n        r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n      } else {\r\n        r = ((repeating || rm < 4) && rd + 1 == k ||\r\n        (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n          (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n      }\r\n    }\r\n\r\n    return r;\r\n  }\r\n\r\n\r\n  // Convert string of `baseIn` to an array of numbers of `baseOut`.\r\n  // Eg. convertBase('255', 10, 16) returns [15, 15].\r\n  // Eg. convertBase('ff', 16, 10) returns [2, 5, 5].\r\n  function convertBase(str, baseIn, baseOut) {\r\n    var j,\r\n      arr = [0],\r\n      arrL,\r\n      i = 0,\r\n      strL = str.length;\r\n\r\n    for (; i < strL;) {\r\n      for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n      arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n      for (j = 0; j < arr.length; j++) {\r\n        if (arr[j] > baseOut - 1) {\r\n          if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n          arr[j + 1] += arr[j] / baseOut | 0;\r\n          arr[j] %= baseOut;\r\n        }\r\n      }\r\n    }\r\n\r\n    return arr.reverse();\r\n  }\r\n\r\n\r\n  /*\r\n   * cos(x) = 1 - x^2/2! + x^4/4! - ...\r\n   * |x| < pi/2\r\n   *\r\n   */\r\n  function cosine(Ctor, x) {\r\n    var k, y,\r\n      len = x.d.length;\r\n\r\n    // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1\r\n    // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1\r\n\r\n    // Estimate the optimum number of times to use the argument reduction.\r\n    if (len < 32) {\r\n      k = Math.ceil(len / 3);\r\n      y = (1 / tinyPow(4, k)).toString();\r\n    } else {\r\n      k = 16;\r\n      y = '2.3283064365386962890625e-10';\r\n    }\r\n\r\n    Ctor.precision += k;\r\n\r\n    x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));\r\n\r\n    // Reverse argument reduction\r\n    for (var i = k; i--;) {\r\n      var cos2x = x.times(x);\r\n      x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);\r\n    }\r\n\r\n    Ctor.precision -= k;\r\n\r\n    return x;\r\n  }\r\n\r\n\r\n  /*\r\n   * Perform division in the specified base.\r\n   */\r\n  var divide = (function () {\r\n\r\n    // Assumes non-zero x and k, and hence non-zero result.\r\n    function multiplyInteger(x, k, base) {\r\n      var temp,\r\n        carry = 0,\r\n        i = x.length;\r\n\r\n      for (x = x.slice(); i--;) {\r\n        temp = x[i] * k + carry;\r\n        x[i] = temp % base | 0;\r\n        carry = temp / base | 0;\r\n      }\r\n\r\n      if (carry) x.unshift(carry);\r\n\r\n      return x;\r\n    }\r\n\r\n    function compare(a, b, aL, bL) {\r\n      var i, r;\r\n\r\n      if (aL != bL) {\r\n        r = aL > bL ? 1 : -1;\r\n      } else {\r\n        for (i = r = 0; i < aL; i++) {\r\n          if (a[i] != b[i]) {\r\n            r = a[i] > b[i] ? 1 : -1;\r\n            break;\r\n          }\r\n        }\r\n      }\r\n\r\n      return r;\r\n    }\r\n\r\n    function subtract(a, b, aL, base) {\r\n      var i = 0;\r\n\r\n      // Subtract b from a.\r\n      for (; aL--;) {\r\n        a[aL] -= i;\r\n        i = a[aL] < b[aL] ? 1 : 0;\r\n        a[aL] = i * base + a[aL] - b[aL];\r\n      }\r\n\r\n      // Remove leading zeros.\r\n      for (; !a[0] && a.length > 1;) a.shift();\r\n    }\r\n\r\n    return function (x, y, pr, rm, dp, base) {\r\n      var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0,\r\n        yL, yz,\r\n        Ctor = x.constructor,\r\n        sign = x.s == y.s ? 1 : -1,\r\n        xd = x.d,\r\n        yd = y.d;\r\n\r\n      // Either NaN, Infinity or 0?\r\n      if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n        return new Ctor(// Return NaN if either NaN, or both Infinity or 0.\r\n          !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :\r\n\r\n          // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.\r\n          xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);\r\n      }\r\n\r\n      if (base) {\r\n        logBase = 1;\r\n        e = x.e - y.e;\r\n      } else {\r\n        base = BASE;\r\n        logBase = LOG_BASE;\r\n        e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);\r\n      }\r\n\r\n      yL = yd.length;\r\n      xL = xd.length;\r\n      q = new Ctor(sign);\r\n      qd = q.d = [];\r\n\r\n      // Result exponent may be one less than e.\r\n      // The digit array of a Decimal from toStringBinary may have trailing zeros.\r\n      for (i = 0; yd[i] == (xd[i] || 0); i++);\r\n\r\n      if (yd[i] > (xd[i] || 0)) e--;\r\n\r\n      if (pr == null) {\r\n        sd = pr = Ctor.precision;\r\n        rm = Ctor.rounding;\r\n      } else if (dp) {\r\n        sd = pr + (x.e - y.e) + 1;\r\n      } else {\r\n        sd = pr;\r\n      }\r\n\r\n      if (sd < 0) {\r\n        qd.push(1);\r\n        more = true;\r\n      } else {\r\n\r\n        // Convert precision in number of base 10 digits to base 1e7 digits.\r\n        sd = sd / logBase + 2 | 0;\r\n        i = 0;\r\n\r\n        // divisor < 1e7\r\n        if (yL == 1) {\r\n          k = 0;\r\n          yd = yd[0];\r\n          sd++;\r\n\r\n          // k is the carry.\r\n          for (; (i < xL || k) && sd--; i++) {\r\n            t = k * base + (xd[i] || 0);\r\n            qd[i] = t / yd | 0;\r\n            k = t % yd | 0;\r\n          }\r\n\r\n          more = k || i < xL;\r\n\r\n        // divisor >= 1e7\r\n        } else {\r\n\r\n          // Normalise xd and yd so highest order digit of yd is >= base/2\r\n          k = base / (yd[0] + 1) | 0;\r\n\r\n          if (k > 1) {\r\n            yd = multiplyInteger(yd, k, base);\r\n            xd = multiplyInteger(xd, k, base);\r\n            yL = yd.length;\r\n            xL = xd.length;\r\n          }\r\n\r\n          xi = yL;\r\n          rem = xd.slice(0, yL);\r\n          remL = rem.length;\r\n\r\n          // Add zeros to make remainder as long as divisor.\r\n          for (; remL < yL;) rem[remL++] = 0;\r\n\r\n          yz = yd.slice();\r\n          yz.unshift(0);\r\n          yd0 = yd[0];\r\n\r\n          if (yd[1] >= base / 2) ++yd0;\r\n\r\n          do {\r\n            k = 0;\r\n\r\n            // Compare divisor and remainder.\r\n            cmp = compare(yd, rem, yL, remL);\r\n\r\n            // If divisor < remainder.\r\n            if (cmp < 0) {\r\n\r\n              // Calculate trial digit, k.\r\n              rem0 = rem[0];\r\n              if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n              // k will be how many times the divisor goes into the current remainder.\r\n              k = rem0 / yd0 | 0;\r\n\r\n              //  Algorithm:\r\n              //  1. product = divisor * trial digit (k)\r\n              //  2. if product > remainder: product -= divisor, k--\r\n              //  3. remainder -= product\r\n              //  4. if product was < remainder at 2:\r\n              //    5. compare new remainder and divisor\r\n              //    6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n              if (k > 1) {\r\n                if (k >= base) k = base - 1;\r\n\r\n                // product = divisor * trial digit.\r\n                prod = multiplyInteger(yd, k, base);\r\n                prodL = prod.length;\r\n                remL = rem.length;\r\n\r\n                // Compare product and remainder.\r\n                cmp = compare(prod, rem, prodL, remL);\r\n\r\n                // product > remainder.\r\n                if (cmp == 1) {\r\n                  k--;\r\n\r\n                  // Subtract divisor from product.\r\n                  subtract(prod, yL < prodL ? yz : yd, prodL, base);\r\n                }\r\n              } else {\r\n\r\n                // cmp is -1.\r\n                // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n                // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n                if (k == 0) cmp = k = 1;\r\n                prod = yd.slice();\r\n              }\r\n\r\n              prodL = prod.length;\r\n              if (prodL < remL) prod.unshift(0);\r\n\r\n              // Subtract product from remainder.\r\n              subtract(rem, prod, remL, base);\r\n\r\n              // If product was < previous remainder.\r\n              if (cmp == -1) {\r\n                remL = rem.length;\r\n\r\n                // Compare divisor and new remainder.\r\n                cmp = compare(yd, rem, yL, remL);\r\n\r\n                // If divisor < new remainder, subtract divisor from remainder.\r\n                if (cmp < 1) {\r\n                  k++;\r\n\r\n                  // Subtract divisor from remainder.\r\n                  subtract(rem, yL < remL ? yz : yd, remL, base);\r\n                }\r\n              }\r\n\r\n              remL = rem.length;\r\n            } else if (cmp === 0) {\r\n              k++;\r\n              rem = [0];\r\n            }    // if cmp === 1, k will be 0\r\n\r\n            // Add the next digit, k, to the result array.\r\n            qd[i++] = k;\r\n\r\n            // Update the remainder.\r\n            if (cmp && rem[0]) {\r\n              rem[remL++] = xd[xi] || 0;\r\n            } else {\r\n              rem = [xd[xi]];\r\n              remL = 1;\r\n            }\r\n\r\n          } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n\r\n          more = rem[0] !== void 0;\r\n        }\r\n\r\n        // Leading zero?\r\n        if (!qd[0]) qd.shift();\r\n      }\r\n\r\n      // logBase is 1 when divide is being used for base conversion.\r\n      if (logBase == 1) {\r\n        q.e = e;\r\n        inexact = more;\r\n      } else {\r\n\r\n        // To calculate q.e, first get the number of digits of qd[0].\r\n        for (i = 1, k = qd[0]; k >= 10; k /= 10) i++;\r\n        q.e = i + e * logBase - 1;\r\n\r\n        finalise(q, dp ? pr + q.e + 1 : pr, rm, more);\r\n      }\r\n\r\n      return q;\r\n    };\r\n  })();\r\n\r\n\r\n  /*\r\n   * Round `x` to `sd` significant digits using rounding mode `rm`.\r\n   * Check for over/under-flow.\r\n   */\r\n   function finalise(x, sd, rm, isTruncated) {\r\n    var digits, i, j, k, rd, roundUp, w, xd, xdi,\r\n      Ctor = x.constructor;\r\n\r\n    // Don't round if sd is null or undefined.\r\n    out: if (sd != null) {\r\n      xd = x.d;\r\n\r\n      // Infinity/NaN.\r\n      if (!xd) return x;\r\n\r\n      // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n      // w: the word of xd containing rd, a base 1e7 number.\r\n      // xdi: the index of w within xd.\r\n      // digits: the number of digits of w.\r\n      // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n      // they had leading zeros)\r\n      // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n      // Get the length of the first word of the digits array xd.\r\n      for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;\r\n      i = sd - digits;\r\n\r\n      // Is the rounding digit in the first word of xd?\r\n      if (i < 0) {\r\n        i += LOG_BASE;\r\n        j = sd;\r\n        w = xd[xdi = 0];\r\n\r\n        // Get the rounding digit at index j of w.\r\n        rd = w / mathpow(10, digits - j - 1) % 10 | 0;\r\n      } else {\r\n        xdi = Math.ceil((i + 1) / LOG_BASE);\r\n        k = xd.length;\r\n        if (xdi >= k) {\r\n          if (isTruncated) {\r\n\r\n            // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.\r\n            for (; k++ <= xdi;) xd.push(0);\r\n            w = rd = 0;\r\n            digits = 1;\r\n            i %= LOG_BASE;\r\n            j = i - LOG_BASE + 1;\r\n          } else {\r\n            break out;\r\n          }\r\n        } else {\r\n          w = k = xd[xdi];\r\n\r\n          // Get the number of digits of w.\r\n          for (digits = 1; k >= 10; k /= 10) digits++;\r\n\r\n          // Get the index of rd within w.\r\n          i %= LOG_BASE;\r\n\r\n          // Get the index of rd within w, adjusted for leading zeros.\r\n          // The number of leading zeros of w is given by LOG_BASE - digits.\r\n          j = i - LOG_BASE + digits;\r\n\r\n          // Get the rounding digit at index j of w.\r\n          rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;\r\n        }\r\n      }\r\n\r\n      // Are there any non-zero digits after the rounding digit?\r\n      isTruncated = isTruncated || sd < 0 ||\r\n        xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));\r\n\r\n      // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right\r\n      // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression\r\n      // will give 714.\r\n\r\n      roundUp = rm < 4\r\n        ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n        : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&\r\n\r\n          // Check whether the digit to the left of the rounding digit is odd.\r\n          ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n            rm == (x.s < 0 ? 8 : 7));\r\n\r\n      if (sd < 1 || !xd[0]) {\r\n        xd.length = 0;\r\n        if (roundUp) {\r\n\r\n          // Convert sd to decimal places.\r\n          sd -= x.e + 1;\r\n\r\n          // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n          xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n          x.e = -sd || 0;\r\n        } else {\r\n\r\n          // Zero.\r\n          xd[0] = x.e = 0;\r\n        }\r\n\r\n        return x;\r\n      }\r\n\r\n      // Remove excess digits.\r\n      if (i == 0) {\r\n        xd.length = xdi;\r\n        k = 1;\r\n        xdi--;\r\n      } else {\r\n        xd.length = xdi + 1;\r\n        k = mathpow(10, LOG_BASE - i);\r\n\r\n        // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n        // j > 0 means i > number of leading zeros of w.\r\n        xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;\r\n      }\r\n\r\n      if (roundUp) {\r\n        for (;;) {\r\n\r\n          // Is the digit to be rounded up in the first word of xd?\r\n          if (xdi == 0) {\r\n\r\n            // i will be the length of xd[0] before k is added.\r\n            for (i = 1, j = xd[0]; j >= 10; j /= 10) i++;\r\n            j = xd[0] += k;\r\n            for (k = 1; j >= 10; j /= 10) k++;\r\n\r\n            // if i != k the length has increased.\r\n            if (i != k) {\r\n              x.e++;\r\n              if (xd[0] == BASE) xd[0] = 1;\r\n            }\r\n\r\n            break;\r\n          } else {\r\n            xd[xdi] += k;\r\n            if (xd[xdi] != BASE) break;\r\n            xd[xdi--] = 0;\r\n            k = 1;\r\n          }\r\n        }\r\n      }\r\n\r\n      // Remove trailing zeros.\r\n      for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n    }\r\n\r\n    if (external) {\r\n\r\n      // Overflow?\r\n      if (x.e > Ctor.maxE) {\r\n\r\n        // Infinity.\r\n        x.d = null;\r\n        x.e = NaN;\r\n\r\n      // Underflow?\r\n      } else if (x.e < Ctor.minE) {\r\n\r\n        // Zero.\r\n        x.e = 0;\r\n        x.d = [0];\r\n        // Ctor.underflow = true;\r\n      } // else Ctor.underflow = false;\r\n    }\r\n\r\n    return x;\r\n  }\r\n\r\n\r\n  function finiteToString(x, isExp, sd) {\r\n    if (!x.isFinite()) return nonFiniteToString(x);\r\n    var k,\r\n      e = x.e,\r\n      str = digitsToString(x.d),\r\n      len = str.length;\r\n\r\n    if (isExp) {\r\n      if (sd && (k = sd - len) > 0) {\r\n        str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n      } else if (len > 1) {\r\n        str = str.charAt(0) + '.' + str.slice(1);\r\n      }\r\n\r\n      str = str + (x.e < 0 ? 'e' : 'e+') + x.e;\r\n    } else if (e < 0) {\r\n      str = '0.' + getZeroString(-e - 1) + str;\r\n      if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n    } else if (e >= len) {\r\n      str += getZeroString(e + 1 - len);\r\n      if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n    } else {\r\n      if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n      if (sd && (k = sd - len) > 0) {\r\n        if (e + 1 === len) str += '.';\r\n        str += getZeroString(k);\r\n      }\r\n    }\r\n\r\n    return str;\r\n  }\r\n\r\n\r\n  // Calculate the base 10 exponent from the base 1e7 exponent.\r\n  function getBase10Exponent(digits, e) {\r\n    var w = digits[0];\r\n\r\n    // Add the number of digits of the first word of the digits array.\r\n    for ( e *= LOG_BASE; w >= 10; w /= 10) e++;\r\n    return e;\r\n  }\r\n\r\n\r\n  function getLn10(Ctor, sd, pr) {\r\n    if (sd > LN10_PRECISION) {\r\n\r\n      // Reset global state in case the exception is caught.\r\n      external = true;\r\n      if (pr) Ctor.precision = pr;\r\n      throw Error(precisionLimitExceeded);\r\n    }\r\n    return finalise(new Ctor(LN10), sd, 1, true);\r\n  }\r\n\r\n\r\n  function getPi(Ctor, sd, rm) {\r\n    if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);\r\n    return finalise(new Ctor(PI), sd, rm, true);\r\n  }\r\n\r\n\r\n  function getPrecision(digits) {\r\n    var w = digits.length - 1,\r\n      len = w * LOG_BASE + 1;\r\n\r\n    w = digits[w];\r\n\r\n    // If non-zero...\r\n    if (w) {\r\n\r\n      // Subtract the number of trailing zeros of the last word.\r\n      for (; w % 10 == 0; w /= 10) len--;\r\n\r\n      // Add the number of digits of the first word.\r\n      for (w = digits[0]; w >= 10; w /= 10) len++;\r\n    }\r\n\r\n    return len;\r\n  }\r\n\r\n\r\n  function getZeroString(k) {\r\n    var zs = '';\r\n    for (; k--;) zs += '0';\r\n    return zs;\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an\r\n   * integer of type number.\r\n   *\r\n   * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.\r\n   *\r\n   */\r\n  function intPow(Ctor, x, n, pr) {\r\n    var isTruncated,\r\n      r = new Ctor(1),\r\n\r\n      // Max n of 9007199254740991 takes 53 loop iterations.\r\n      // Maximum digits array length; leaves [28, 34] guard digits.\r\n      k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n    external = false;\r\n\r\n    for (;;) {\r\n      if (n % 2) {\r\n        r = r.times(x);\r\n        if (truncate(r.d, k)) isTruncated = true;\r\n      }\r\n\r\n      n = mathfloor(n / 2);\r\n      if (n === 0) {\r\n\r\n        // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n        n = r.d.length - 1;\r\n        if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n        break;\r\n      }\r\n\r\n      x = x.times(x);\r\n      truncate(x.d, k);\r\n    }\r\n\r\n    external = true;\r\n\r\n    return r;\r\n  }\r\n\r\n\r\n  function isOdd(n) {\r\n    return n.d[n.d.length - 1] & 1;\r\n  }\r\n\r\n\r\n  /*\r\n   * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'.\r\n   */\r\n  function maxOrMin(Ctor, args, ltgt) {\r\n    var y,\r\n      x = new Ctor(args[0]),\r\n      i = 0;\r\n\r\n    for (; ++i < args.length;) {\r\n      y = new Ctor(args[i]);\r\n      if (!y.s) {\r\n        x = y;\r\n        break;\r\n      } else if (x[ltgt](y)) {\r\n        x = y;\r\n      }\r\n    }\r\n\r\n    return x;\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant\r\n   * digits.\r\n   *\r\n   * Taylor/Maclaurin series.\r\n   *\r\n   * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n   *\r\n   * Argument reduction:\r\n   *   Repeat x = x / 32, k += 5, until |x| < 0.1\r\n   *   exp(x) = exp(x / 2^k)^(2^k)\r\n   *\r\n   * Previously, the argument was initially reduced by\r\n   * exp(x) = exp(r) * 10^k  where r = x - k * ln10, k = floor(x / ln10)\r\n   * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n   * found to be slower than just dividing repeatedly by 32 as above.\r\n   *\r\n   * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000\r\n   * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000\r\n   * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n   *\r\n   *  exp(Infinity)  = Infinity\r\n   *  exp(-Infinity) = 0\r\n   *  exp(NaN)       = NaN\r\n   *  exp(±0)        = 1\r\n   *\r\n   *  exp(x) is non-terminating for any finite, non-zero x.\r\n   *\r\n   *  The result will always be correctly rounded.\r\n   *\r\n   */\r\n  function naturalExponential(x, sd) {\r\n    var denominator, guard, j, pow, sum, t, wpr,\r\n      rep = 0,\r\n      i = 0,\r\n      k = 0,\r\n      Ctor = x.constructor,\r\n      rm = Ctor.rounding,\r\n      pr = Ctor.precision;\r\n\r\n    // 0/NaN/Infinity?\r\n    if (!x.d || !x.d[0] || x.e > 17) {\r\n\r\n      return new Ctor(x.d\r\n        ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0\r\n        : x.s ? x.s < 0 ? 0 : x : 0 / 0);\r\n    }\r\n\r\n    if (sd == null) {\r\n      external = false;\r\n      wpr = pr;\r\n    } else {\r\n      wpr = sd;\r\n    }\r\n\r\n    t = new Ctor(0.03125);\r\n\r\n    // while abs(x) >= 0.1\r\n    while (x.e > -2) {\r\n\r\n      // x = x / 2^5\r\n      x = x.times(t);\r\n      k += 5;\r\n    }\r\n\r\n    // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision\r\n    // necessary to ensure the first 4 rounding digits are correct.\r\n    guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n    wpr += guard;\r\n    denominator = pow = sum = new Ctor(1);\r\n    Ctor.precision = wpr;\r\n\r\n    for (;;) {\r\n      pow = finalise(pow.times(x), wpr, 1);\r\n      denominator = denominator.times(++i);\r\n      t = sum.plus(divide(pow, denominator, wpr, 1));\r\n\r\n      if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n        j = k;\r\n        while (j--) sum = finalise(sum.times(sum), wpr, 1);\r\n\r\n        // Check to see if the first 4 rounding digits are [49]999.\r\n        // If so, repeat the summation with a higher precision, otherwise\r\n        // e.g. with precision: 18, rounding: 1\r\n        // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)\r\n        // `wpr - guard` is the index of first rounding digit.\r\n        if (sd == null) {\r\n\r\n          if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n            Ctor.precision = wpr += 10;\r\n            denominator = pow = t = new Ctor(1);\r\n            i = 0;\r\n            rep++;\r\n          } else {\r\n            return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n          }\r\n        } else {\r\n          Ctor.precision = pr;\r\n          return sum;\r\n        }\r\n      }\r\n\r\n      sum = t;\r\n    }\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant\r\n   * digits.\r\n   *\r\n   *  ln(-n)        = NaN\r\n   *  ln(0)         = -Infinity\r\n   *  ln(-0)        = -Infinity\r\n   *  ln(1)         = 0\r\n   *  ln(Infinity)  = Infinity\r\n   *  ln(-Infinity) = NaN\r\n   *  ln(NaN)       = NaN\r\n   *\r\n   *  ln(n) (n != 1) is non-terminating.\r\n   *\r\n   */\r\n  function naturalLogarithm(y, sd) {\r\n    var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2,\r\n      n = 1,\r\n      guard = 10,\r\n      x = y,\r\n      xd = x.d,\r\n      Ctor = x.constructor,\r\n      rm = Ctor.rounding,\r\n      pr = Ctor.precision;\r\n\r\n    // Is x negative or Infinity, NaN, 0 or 1?\r\n    if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {\r\n      return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);\r\n    }\r\n\r\n    if (sd == null) {\r\n      external = false;\r\n      wpr = pr;\r\n    } else {\r\n      wpr = sd;\r\n    }\r\n\r\n    Ctor.precision = wpr += guard;\r\n    c = digitsToString(xd);\r\n    c0 = c.charAt(0);\r\n\r\n    if (Math.abs(e = x.e) < 1.5e15) {\r\n\r\n      // Argument reduction.\r\n      // The series converges faster the closer the argument is to 1, so using\r\n      // ln(a^b) = b * ln(a),   ln(a) = ln(a^b) / b\r\n      // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n      // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n      // later be divided by this number, then separate out the power of 10 using\r\n      // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n      // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n      //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n      // max n is 6 (gives 0.7 - 1.3)\r\n      while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n        x = x.times(y);\r\n        c = digitsToString(x.d);\r\n        c0 = c.charAt(0);\r\n        n++;\r\n      }\r\n\r\n      e = x.e;\r\n\r\n      if (c0 > 1) {\r\n        x = new Ctor('0.' + c);\r\n        e++;\r\n      } else {\r\n        x = new Ctor(c0 + '.' + c.slice(1));\r\n      }\r\n    } else {\r\n\r\n      // The argument reduction method above may result in overflow if the argument y is a massive\r\n      // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n      // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n      t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n      x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n      Ctor.precision = pr;\r\n\r\n      return sd == null ? finalise(x, pr, rm, external = true) : x;\r\n    }\r\n\r\n    // x1 is x reduced to a value near 1.\r\n    x1 = x;\r\n\r\n    // Taylor series.\r\n    // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n    // where x = (y - 1)/(y + 1)    (|x| < 1)\r\n    sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);\r\n    x2 = finalise(x.times(x), wpr, 1);\r\n    denominator = 3;\r\n\r\n    for (;;) {\r\n      numerator = finalise(numerator.times(x2), wpr, 1);\r\n      t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));\r\n\r\n      if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n        sum = sum.times(2);\r\n\r\n        // Reverse the argument reduction. Check that e is not 0 because, besides preventing an\r\n        // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.\r\n        if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n        sum = divide(sum, new Ctor(n), wpr, 1);\r\n\r\n        // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has\r\n        // been repeated previously) and the first 4 rounding digits 9999?\r\n        // If so, restart the summation with a higher precision, otherwise\r\n        // e.g. with precision: 12, rounding: 1\r\n        // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.\r\n        // `wpr - guard` is the index of first rounding digit.\r\n        if (sd == null) {\r\n          if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n            Ctor.precision = wpr += guard;\r\n            t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);\r\n            x2 = finalise(x.times(x), wpr, 1);\r\n            denominator = rep = 1;\r\n          } else {\r\n            return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n          }\r\n        } else {\r\n          Ctor.precision = pr;\r\n          return sum;\r\n        }\r\n      }\r\n\r\n      sum = t;\r\n      denominator += 2;\r\n    }\r\n  }\r\n\r\n\r\n  // ±Infinity, NaN.\r\n  function nonFiniteToString(x) {\r\n    // Unsigned.\r\n    return String(x.s * x.s / 0);\r\n  }\r\n\r\n\r\n  /*\r\n   * Parse the value of a new Decimal `x` from string `str`.\r\n   */\r\n  function parseDecimal(x, str) {\r\n    var e, i, len;\r\n\r\n    // Decimal point?\r\n    if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n    // Exponential form?\r\n    if ((i = str.search(/e/i)) > 0) {\r\n\r\n      // Determine exponent.\r\n      if (e < 0) e = i;\r\n      e += +str.slice(i + 1);\r\n      str = str.substring(0, i);\r\n    } else if (e < 0) {\r\n\r\n      // Integer.\r\n      e = str.length;\r\n    }\r\n\r\n    // Determine leading zeros.\r\n    for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n    // Determine trailing zeros.\r\n    for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n    str = str.slice(i, len);\r\n\r\n    if (str) {\r\n      len -= i;\r\n      x.e = e = e - i - 1;\r\n      x.d = [];\r\n\r\n      // Transform base\r\n\r\n      // e is the base 10 exponent.\r\n      // i is where to slice str to get the first word of the digits array.\r\n      i = (e + 1) % LOG_BASE;\r\n      if (e < 0) i += LOG_BASE;\r\n\r\n      if (i < len) {\r\n        if (i) x.d.push(+str.slice(0, i));\r\n        for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n        str = str.slice(i);\r\n        i = LOG_BASE - str.length;\r\n      } else {\r\n        i -= len;\r\n      }\r\n\r\n      for (; i--;) str += '0';\r\n      x.d.push(+str);\r\n\r\n      if (external) {\r\n\r\n        // Overflow?\r\n        if (x.e > x.constructor.maxE) {\r\n\r\n          // Infinity.\r\n          x.d = null;\r\n          x.e = NaN;\r\n\r\n        // Underflow?\r\n        } else if (x.e < x.constructor.minE) {\r\n\r\n          // Zero.\r\n          x.e = 0;\r\n          x.d = [0];\r\n          // x.constructor.underflow = true;\r\n        } // else x.constructor.underflow = false;\r\n      }\r\n    } else {\r\n\r\n      // Zero.\r\n      x.e = 0;\r\n      x.d = [0];\r\n    }\r\n\r\n    return x;\r\n  }\r\n\r\n\r\n  /*\r\n   * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.\r\n   */\r\n  function parseOther(x, str) {\r\n    var base, Ctor, divisor, i, isFloat, len, p, xd, xe;\r\n\r\n    if (str === 'Infinity' || str === 'NaN') {\r\n      if (!+str) x.s = NaN;\r\n      x.e = NaN;\r\n      x.d = null;\r\n      return x;\r\n    }\r\n\r\n    if (isHex.test(str))  {\r\n      base = 16;\r\n      str = str.toLowerCase();\r\n    } else if (isBinary.test(str))  {\r\n      base = 2;\r\n    } else if (isOctal.test(str))  {\r\n      base = 8;\r\n    } else {\r\n      throw Error(invalidArgument + str);\r\n    }\r\n\r\n    // Is there a binary exponent part?\r\n    i = str.search(/p/i);\r\n\r\n    if (i > 0) {\r\n      p = +str.slice(i + 1);\r\n      str = str.substring(2, i);\r\n    } else {\r\n      str = str.slice(2);\r\n    }\r\n\r\n    // Convert `str` as an integer then divide the result by `base` raised to a power such that the\r\n    // fraction part will be restored.\r\n    i = str.indexOf('.');\r\n    isFloat = i >= 0;\r\n    Ctor = x.constructor;\r\n\r\n    if (isFloat) {\r\n      str = str.replace('.', '');\r\n      len = str.length;\r\n      i = len - i;\r\n\r\n      // log[10](16) = 1.2041... , log[10](88) = 1.9444....\r\n      divisor = intPow(Ctor, new Ctor(base), i, i * 2);\r\n    }\r\n\r\n    xd = convertBase(str, base, BASE);\r\n    xe = xd.length - 1;\r\n\r\n    // Remove trailing zeros.\r\n    for (i = xe; xd[i] === 0; --i) xd.pop();\r\n    if (i < 0) return new Ctor(x.s * 0);\r\n    x.e = getBase10Exponent(xd, xe);\r\n    x.d = xd;\r\n    external = false;\r\n\r\n    // At what precision to perform the division to ensure exact conversion?\r\n    // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)\r\n    // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412\r\n    // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.\r\n    // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount\r\n    // Therefore using 4 * the number of digits of str will always be enough.\r\n    if (isFloat) x = divide(x, divisor, len * 4);\r\n\r\n    // Multiply by the binary exponent part if present.\r\n    if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));\r\n    external = true;\r\n\r\n    return x;\r\n  }\r\n\r\n\r\n  /*\r\n   * sin(x) = x - x^3/3! + x^5/5! - ...\r\n   * |x| < pi/2\r\n   *\r\n   */\r\n  function sine(Ctor, x) {\r\n    var k,\r\n      len = x.d.length;\r\n\r\n    if (len < 3) return taylorSeries(Ctor, 2, x, x);\r\n\r\n    // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)\r\n    // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)\r\n    // and  sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))\r\n\r\n    // Estimate the optimum number of times to use the argument reduction.\r\n    k = 1.4 * Math.sqrt(len);\r\n    k = k > 16 ? 16 : k | 0;\r\n\r\n    x = x.times(1 / tinyPow(5, k));\r\n    x = taylorSeries(Ctor, 2, x, x);\r\n\r\n    // Reverse argument reduction\r\n    var sin2_x,\r\n      d5 = new Ctor(5),\r\n      d16 = new Ctor(16),\r\n      d20 = new Ctor(20);\r\n    for (; k--;) {\r\n      sin2_x = x.times(x);\r\n      x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));\r\n    }\r\n\r\n    return x;\r\n  }\r\n\r\n\r\n  // Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.\r\n  function taylorSeries(Ctor, n, x, y, isHyperbolic) {\r\n    var j, t, u, x2,\r\n      i = 1,\r\n      pr = Ctor.precision,\r\n      k = Math.ceil(pr / LOG_BASE);\r\n\r\n    external = false;\r\n    x2 = x.times(x);\r\n    u = new Ctor(y);\r\n\r\n    for (;;) {\r\n      t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);\r\n      u = isHyperbolic ? y.plus(t) : y.minus(t);\r\n      y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);\r\n      t = u.plus(y);\r\n\r\n      if (t.d[k] !== void 0) {\r\n        for (j = k; t.d[j] === u.d[j] && j--;);\r\n        if (j == -1) break;\r\n      }\r\n\r\n      j = u;\r\n      u = y;\r\n      y = t;\r\n      t = j;\r\n      i++;\r\n    }\r\n\r\n    external = true;\r\n    t.d.length = k + 1;\r\n\r\n    return t;\r\n  }\r\n\r\n\r\n  // Exponent e must be positive and non-zero.\r\n  function tinyPow(b, e) {\r\n    var n = b;\r\n    while (--e) n *= b;\r\n    return n;\r\n  }\r\n\r\n\r\n  // Return the absolute value of `x` reduced to less than or equal to half pi.\r\n  function toLessThanHalfPi(Ctor, x) {\r\n    var t,\r\n      isNeg = x.s < 0,\r\n      pi = getPi(Ctor, Ctor.precision, 1),\r\n      halfPi = pi.times(0.5);\r\n\r\n    x = x.abs();\r\n\r\n    if (x.lte(halfPi)) {\r\n      quadrant = isNeg ? 4 : 1;\r\n      return x;\r\n    }\r\n\r\n    t = x.divToInt(pi);\r\n\r\n    if (t.isZero()) {\r\n      quadrant = isNeg ? 3 : 2;\r\n    } else {\r\n      x = x.minus(t.times(pi));\r\n\r\n      // 0 <= x < pi\r\n      if (x.lte(halfPi)) {\r\n        quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1);\r\n        return x;\r\n      }\r\n\r\n      quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2);\r\n    }\r\n\r\n    return x.minus(pi).abs();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return the value of Decimal `x` as a string in base `baseOut`.\r\n   *\r\n   * If the optional `sd` argument is present include a binary exponent suffix.\r\n   */\r\n  function toStringBinary(x, baseOut, sd, rm) {\r\n    var base, e, i, k, len, roundUp, str, xd, y,\r\n      Ctor = x.constructor,\r\n      isExp = sd !== void 0;\r\n\r\n    if (isExp) {\r\n      checkInt32(sd, 1, MAX_DIGITS);\r\n      if (rm === void 0) rm = Ctor.rounding;\r\n      else checkInt32(rm, 0, 8);\r\n    } else {\r\n      sd = Ctor.precision;\r\n      rm = Ctor.rounding;\r\n    }\r\n\r\n    if (!x.isFinite()) {\r\n      str = nonFiniteToString(x);\r\n    } else {\r\n      str = finiteToString(x);\r\n      i = str.indexOf('.');\r\n\r\n      // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:\r\n      // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))\r\n      // minBinaryExponent = floor(decimalExponent * log[2](10))\r\n      // log[2](10) = 3.321928094887362347870319429489390175864\r\n\r\n      if (isExp) {\r\n        base = 2;\r\n        if (baseOut == 16) {\r\n          sd = sd * 4 - 3;\r\n        } else if (baseOut == 8) {\r\n          sd = sd * 3 - 2;\r\n        }\r\n      } else {\r\n        base = baseOut;\r\n      }\r\n\r\n      // Convert the number as an integer then divide the result by its base raised to a power such\r\n      // that the fraction part will be restored.\r\n\r\n      // Non-integer.\r\n      if (i >= 0) {\r\n        str = str.replace('.', '');\r\n        y = new Ctor(1);\r\n        y.e = str.length - i;\r\n        y.d = convertBase(finiteToString(y), 10, base);\r\n        y.e = y.d.length;\r\n      }\r\n\r\n      xd = convertBase(str, 10, base);\r\n      e = len = xd.length;\r\n\r\n      // Remove trailing zeros.\r\n      for (; xd[--len] == 0;) xd.pop();\r\n\r\n      if (!xd[0]) {\r\n        str = isExp ? '0p+0' : '0';\r\n      } else {\r\n        if (i < 0) {\r\n          e--;\r\n        } else {\r\n          x = new Ctor(x);\r\n          x.d = xd;\r\n          x.e = e;\r\n          x = divide(x, y, sd, rm, 0, base);\r\n          xd = x.d;\r\n          e = x.e;\r\n          roundUp = inexact;\r\n        }\r\n\r\n        // The rounding digit, i.e. the digit after the digit that may be rounded up.\r\n        i = xd[sd];\r\n        k = base / 2;\r\n        roundUp = roundUp || xd[sd + 1] !== void 0;\r\n\r\n        roundUp = rm < 4\r\n          ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2))\r\n          : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 ||\r\n            rm === (x.s < 0 ? 8 : 7));\r\n\r\n        xd.length = sd;\r\n\r\n        if (roundUp) {\r\n\r\n          // Rounding up may mean the previous digit has to be rounded up and so on.\r\n          for (; ++xd[--sd] > base - 1;) {\r\n            xd[sd] = 0;\r\n            if (!sd) {\r\n              ++e;\r\n              xd.unshift(1);\r\n            }\r\n          }\r\n        }\r\n\r\n        // Determine trailing zeros.\r\n        for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n        // E.g. [4, 11, 15] becomes 4bf.\r\n        for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n\r\n        // Add binary exponent suffix?\r\n        if (isExp) {\r\n          if (len > 1) {\r\n            if (baseOut == 16 || baseOut == 8) {\r\n              i = baseOut == 16 ? 4 : 3;\r\n              for (--len; len % i; len++) str += '0';\r\n              xd = convertBase(str, base, baseOut);\r\n              for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n              // xd[0] will always be be 1\r\n              for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n            } else {\r\n              str = str.charAt(0) + '.' + str.slice(1);\r\n            }\r\n          }\r\n\r\n          str =  str + (e < 0 ? 'p' : 'p+') + e;\r\n        } else if (e < 0) {\r\n          for (; ++e;) str = '0' + str;\r\n          str = '0.' + str;\r\n        } else {\r\n          if (++e > len) for (e -= len; e-- ;) str += '0';\r\n          else if (e < len) str = str.slice(0, e) + '.' + str.slice(e);\r\n        }\r\n      }\r\n\r\n      str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;\r\n    }\r\n\r\n    return x.s < 0 ? '-' + str : str;\r\n  }\r\n\r\n\r\n  // Does not strip trailing zeros.\r\n  function truncate(arr, len) {\r\n    if (arr.length > len) {\r\n      arr.length = len;\r\n      return true;\r\n    }\r\n  }\r\n\r\n\r\n  // Decimal methods\r\n\r\n\r\n  /*\r\n   *  abs\r\n   *  acos\r\n   *  acosh\r\n   *  add\r\n   *  asin\r\n   *  asinh\r\n   *  atan\r\n   *  atanh\r\n   *  atan2\r\n   *  cbrt\r\n   *  ceil\r\n   *  clone\r\n   *  config\r\n   *  cos\r\n   *  cosh\r\n   *  div\r\n   *  exp\r\n   *  floor\r\n   *  hypot\r\n   *  ln\r\n   *  log\r\n   *  log2\r\n   *  log10\r\n   *  max\r\n   *  min\r\n   *  mod\r\n   *  mul\r\n   *  pow\r\n   *  random\r\n   *  round\r\n   *  set\r\n   *  sign\r\n   *  sin\r\n   *  sinh\r\n   *  sqrt\r\n   *  sub\r\n   *  tan\r\n   *  tanh\r\n   *  trunc\r\n   */\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the absolute value of `x`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function abs(x) {\r\n    return new this(x).abs();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the arccosine in radians of `x`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function acos(x) {\r\n    return new this(x).acos();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to\r\n   * `precision` significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal} A value in radians.\r\n   *\r\n   */\r\n  function acosh(x) {\r\n    return new this(x).acosh();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant\r\n   * digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   * y {number|string|Decimal}\r\n   *\r\n   */\r\n  function add(x, y) {\r\n    return new this(x).plus(y);\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function asin(x) {\r\n    return new this(x).asin();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to\r\n   * `precision` significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal} A value in radians.\r\n   *\r\n   */\r\n  function asinh(x) {\r\n    return new this(x).asinh();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function atan(x) {\r\n    return new this(x).atan();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to\r\n   * `precision` significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal} A value in radians.\r\n   *\r\n   */\r\n  function atanh(x) {\r\n    return new this(x).atanh();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi\r\n   * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.\r\n   *\r\n   * Domain: [-Infinity, Infinity]\r\n   * Range: [-pi, pi]\r\n   *\r\n   * y {number|string|Decimal} The y-coordinate.\r\n   * x {number|string|Decimal} The x-coordinate.\r\n   *\r\n   * atan2(±0, -0)               = ±pi\r\n   * atan2(±0, +0)               = ±0\r\n   * atan2(±0, -x)               = ±pi for x > 0\r\n   * atan2(±0, x)                = ±0 for x > 0\r\n   * atan2(-y, ±0)               = -pi/2 for y > 0\r\n   * atan2(y, ±0)                = pi/2 for y > 0\r\n   * atan2(±y, -Infinity)        = ±pi for finite y > 0\r\n   * atan2(±y, +Infinity)        = ±0 for finite y > 0\r\n   * atan2(±Infinity, x)         = ±pi/2 for finite x\r\n   * atan2(±Infinity, -Infinity) = ±3*pi/4\r\n   * atan2(±Infinity, +Infinity) = ±pi/4\r\n   * atan2(NaN, x) = NaN\r\n   * atan2(y, NaN) = NaN\r\n   *\r\n   */\r\n  function atan2(y, x) {\r\n    y = new this(y);\r\n    x = new this(x);\r\n    var r,\r\n      pr = this.precision,\r\n      rm = this.rounding,\r\n      wpr = pr + 4;\r\n\r\n    // Either NaN\r\n    if (!y.s || !x.s) {\r\n      r = new this(NaN);\r\n\r\n    // Both ±Infinity\r\n    } else if (!y.d && !x.d) {\r\n      r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);\r\n      r.s = y.s;\r\n\r\n    // x is ±Infinity or y is ±0\r\n    } else if (!x.d || y.isZero()) {\r\n      r = x.s < 0 ? getPi(this, pr, rm) : new this(0);\r\n      r.s = y.s;\r\n\r\n    // y is ±Infinity or x is ±0\r\n    } else if (!y.d || x.isZero()) {\r\n      r = getPi(this, wpr, 1).times(0.5);\r\n      r.s = y.s;\r\n\r\n    // Both non-zero and finite\r\n    } else if (x.s < 0) {\r\n      this.precision = wpr;\r\n      this.rounding = 1;\r\n      r = this.atan(divide(y, x, wpr, 1));\r\n      x = getPi(this, wpr, 1);\r\n      this.precision = pr;\r\n      this.rounding = rm;\r\n      r = y.s < 0 ? r.minus(x) : r.plus(x);\r\n    } else {\r\n      r = this.atan(divide(y, x, wpr, 1));\r\n    }\r\n\r\n    return r;\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant\r\n   * digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function cbrt(x) {\r\n    return new this(x).cbrt();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function ceil(x) {\r\n    return finalise(x = new this(x), x.e + 1, 2);\r\n  }\r\n\r\n\r\n  /*\r\n   * Configure global settings for a Decimal constructor.\r\n   *\r\n   * `obj` is an object with one or more of the following properties,\r\n   *\r\n   *   precision  {number}\r\n   *   rounding   {number}\r\n   *   toExpNeg   {number}\r\n   *   toExpPos   {number}\r\n   *   maxE       {number}\r\n   *   minE       {number}\r\n   *   modulo     {number}\r\n   *   crypto     {boolean|number}\r\n   *   defaults   {true}\r\n   *\r\n   * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n   *\r\n   */\r\n  function config(obj) {\r\n    if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected');\r\n    var i, p, v,\r\n      useDefaults = obj.defaults === true,\r\n      ps = [\r\n        'precision', 1, MAX_DIGITS,\r\n        'rounding', 0, 8,\r\n        'toExpNeg', -EXP_LIMIT, 0,\r\n        'toExpPos', 0, EXP_LIMIT,\r\n        'maxE', 0, EXP_LIMIT,\r\n        'minE', -EXP_LIMIT, 0,\r\n        'modulo', 0, 9\r\n      ];\r\n\r\n    for (i = 0; i < ps.length; i += 3) {\r\n      if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];\r\n      if ((v = obj[p]) !== void 0) {\r\n        if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n        else throw Error(invalidArgument + p + ': ' + v);\r\n      }\r\n    }\r\n\r\n    if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];\r\n    if ((v = obj[p]) !== void 0) {\r\n      if (v === true || v === false || v === 0 || v === 1) {\r\n        if (v) {\r\n          if (typeof crypto != 'undefined' && crypto &&\r\n            (crypto.getRandomValues || crypto.randomBytes)) {\r\n            this[p] = true;\r\n          } else {\r\n            throw Error(cryptoUnavailable);\r\n          }\r\n        } else {\r\n          this[p] = false;\r\n        }\r\n      } else {\r\n        throw Error(invalidArgument + p + ': ' + v);\r\n      }\r\n    }\r\n\r\n    return this;\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant\r\n   * digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal} A value in radians.\r\n   *\r\n   */\r\n  function cos(x) {\r\n    return new this(x).cos();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal} A value in radians.\r\n   *\r\n   */\r\n  function cosh(x) {\r\n    return new this(x).cosh();\r\n  }\r\n\r\n\r\n  /*\r\n   * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n   * constructor.\r\n   *\r\n   */\r\n  function clone(obj) {\r\n    var i, p, ps;\r\n\r\n    /*\r\n     * The Decimal constructor and exported function.\r\n     * Return a new Decimal instance.\r\n     *\r\n     * v {number|string|Decimal} A numeric value.\r\n     *\r\n     */\r\n    function Decimal(v) {\r\n      var e, i, t,\r\n        x = this;\r\n\r\n      // Decimal called without new.\r\n      if (!(x instanceof Decimal)) return new Decimal(v);\r\n\r\n      // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n      // which points to Object.\r\n      x.constructor = Decimal;\r\n\r\n      // Duplicate.\r\n      if (v instanceof Decimal) {\r\n        x.s = v.s;\r\n\r\n        if (external) {\r\n          if (!v.d || v.e > Decimal.maxE) {\r\n\r\n            // Infinity.\r\n            x.e = NaN;\r\n            x.d = null;\r\n          } else if (v.e < Decimal.minE) {\r\n\r\n            // Zero.\r\n            x.e = 0;\r\n            x.d = [0];\r\n          } else {\r\n            x.e = v.e;\r\n            x.d = v.d.slice();\r\n          }\r\n        } else {\r\n          x.e = v.e;\r\n          x.d = v.d ? v.d.slice() : v.d;\r\n        }\r\n\r\n        return;\r\n      }\r\n\r\n      t = typeof v;\r\n\r\n      if (t === 'number') {\r\n        if (v === 0) {\r\n          x.s = 1 / v < 0 ? -1 : 1;\r\n          x.e = 0;\r\n          x.d = [0];\r\n          return;\r\n        }\r\n\r\n        if (v < 0) {\r\n          v = -v;\r\n          x.s = -1;\r\n        } else {\r\n          x.s = 1;\r\n        }\r\n\r\n        // Fast path for small integers.\r\n        if (v === ~~v && v < 1e7) {\r\n          for (e = 0, i = v; i >= 10; i /= 10) e++;\r\n\r\n          if (external) {\r\n            if (e > Decimal.maxE) {\r\n              x.e = NaN;\r\n              x.d = null;\r\n            } else if (e < Decimal.minE) {\r\n              x.e = 0;\r\n              x.d = [0];\r\n            } else {\r\n              x.e = e;\r\n              x.d = [v];\r\n            }\r\n          } else {\r\n            x.e = e;\r\n            x.d = [v];\r\n          }\r\n\r\n          return;\r\n\r\n        // Infinity, NaN.\r\n        } else if (v * 0 !== 0) {\r\n          if (!v) x.s = NaN;\r\n          x.e = NaN;\r\n          x.d = null;\r\n          return;\r\n        }\r\n\r\n        return parseDecimal(x, v.toString());\r\n\r\n      } else if (t !== 'string') {\r\n        throw Error(invalidArgument + v);\r\n      }\r\n\r\n      // Minus sign?\r\n      if ((i = v.charCodeAt(0)) === 45) {\r\n        v = v.slice(1);\r\n        x.s = -1;\r\n      } else {\r\n        // Plus sign?\r\n        if (i === 43) v = v.slice(1);\r\n        x.s = 1;\r\n      }\r\n\r\n      return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);\r\n    }\r\n\r\n    Decimal.prototype = P;\r\n\r\n    Decimal.ROUND_UP = 0;\r\n    Decimal.ROUND_DOWN = 1;\r\n    Decimal.ROUND_CEIL = 2;\r\n    Decimal.ROUND_FLOOR = 3;\r\n    Decimal.ROUND_HALF_UP = 4;\r\n    Decimal.ROUND_HALF_DOWN = 5;\r\n    Decimal.ROUND_HALF_EVEN = 6;\r\n    Decimal.ROUND_HALF_CEIL = 7;\r\n    Decimal.ROUND_HALF_FLOOR = 8;\r\n    Decimal.EUCLID = 9;\r\n\r\n    Decimal.config = Decimal.set = config;\r\n    Decimal.clone = clone;\r\n    Decimal.isDecimal = isDecimalInstance;\r\n\r\n    Decimal.abs = abs;\r\n    Decimal.acos = acos;\r\n    Decimal.acosh = acosh;        // ES6\r\n    Decimal.add = add;\r\n    Decimal.asin = asin;\r\n    Decimal.asinh = asinh;        // ES6\r\n    Decimal.atan = atan;\r\n    Decimal.atanh = atanh;        // ES6\r\n    Decimal.atan2 = atan2;\r\n    Decimal.cbrt = cbrt;          // ES6\r\n    Decimal.ceil = ceil;\r\n    Decimal.cos = cos;\r\n    Decimal.cosh = cosh;          // ES6\r\n    Decimal.div = div;\r\n    Decimal.exp = exp;\r\n    Decimal.floor = floor;\r\n    Decimal.hypot = hypot;        // ES6\r\n    Decimal.ln = ln;\r\n    Decimal.log = log;\r\n    Decimal.log10 = log10;        // ES6\r\n    Decimal.log2 = log2;          // ES6\r\n    Decimal.max = max;\r\n    Decimal.min = min;\r\n    Decimal.mod = mod;\r\n    Decimal.mul = mul;\r\n    Decimal.pow = pow;\r\n    Decimal.random = random;\r\n    Decimal.round = round;\r\n    Decimal.sign = sign;          // ES6\r\n    Decimal.sin = sin;\r\n    Decimal.sinh = sinh;          // ES6\r\n    Decimal.sqrt = sqrt;\r\n    Decimal.sub = sub;\r\n    Decimal.tan = tan;\r\n    Decimal.tanh = tanh;          // ES6\r\n    Decimal.trunc = trunc;        // ES6\r\n\r\n    if (obj === void 0) obj = {};\r\n    if (obj) {\r\n      if (obj.defaults !== true) {\r\n        ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];\r\n        for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n      }\r\n    }\r\n\r\n    Decimal.config(obj);\r\n\r\n    return Decimal;\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant\r\n   * digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   * y {number|string|Decimal}\r\n   *\r\n   */\r\n  function div(x, y) {\r\n    return new this(x).div(y);\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal} The power to which to raise the base of the natural log.\r\n   *\r\n   */\r\n  function exp(x) {\r\n    return new this(x).exp();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function floor(x) {\r\n    return finalise(x = new this(x), x.e + 1, 3);\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,\r\n   * rounded to `precision` significant digits using rounding mode `rounding`.\r\n   *\r\n   * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)\r\n   *\r\n   * arguments {number|string|Decimal}\r\n   *\r\n   */\r\n  function hypot() {\r\n    var i, n,\r\n      t = new this(0);\r\n\r\n    external = false;\r\n\r\n    for (i = 0; i < arguments.length;) {\r\n      n = new this(arguments[i++]);\r\n      if (!n.d) {\r\n        if (n.s) {\r\n          external = true;\r\n          return new this(1 / 0);\r\n        }\r\n        t = n;\r\n      } else if (t.d) {\r\n        t = t.plus(n.times(n));\r\n      }\r\n    }\r\n\r\n    external = true;\r\n\r\n    return t.sqrt();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),\r\n   * otherwise return false.\r\n   *\r\n   */\r\n  function isDecimalInstance(obj) {\r\n    return obj instanceof Decimal || obj && obj.name === '[object Decimal]' || false;\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function ln(x) {\r\n    return new this(x).ln();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base\r\n   * is specified, rounded to `precision` significant digits using rounding mode `rounding`.\r\n   *\r\n   * log[y](x)\r\n   *\r\n   * x {number|string|Decimal} The argument of the logarithm.\r\n   * y {number|string|Decimal} The base of the logarithm.\r\n   *\r\n   */\r\n  function log(x, y) {\r\n    return new this(x).log(y);\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function log2(x) {\r\n    return new this(x).log(2);\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function log10(x) {\r\n    return new this(x).log(10);\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the maximum of the arguments.\r\n   *\r\n   * arguments {number|string|Decimal}\r\n   *\r\n   */\r\n  function max() {\r\n    return maxOrMin(this, arguments, 'lt');\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the minimum of the arguments.\r\n   *\r\n   * arguments {number|string|Decimal}\r\n   *\r\n   */\r\n  function min() {\r\n    return maxOrMin(this, arguments, 'gt');\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits\r\n   * using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   * y {number|string|Decimal}\r\n   *\r\n   */\r\n  function mod(x, y) {\r\n    return new this(x).mod(y);\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant\r\n   * digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   * y {number|string|Decimal}\r\n   *\r\n   */\r\n  function mul(x, y) {\r\n    return new this(x).mul(y);\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal} The base.\r\n   * y {number|string|Decimal} The exponent.\r\n   *\r\n   */\r\n  function pow(x, y) {\r\n    return new this(x).pow(y);\r\n  }\r\n\r\n\r\n  /*\r\n   * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with\r\n   * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros\r\n   * are produced).\r\n   *\r\n   * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.\r\n   *\r\n   */\r\n  function random(sd) {\r\n    var d, e, k, n,\r\n      i = 0,\r\n      r = new this(1),\r\n      rd = [];\r\n\r\n    if (sd === void 0) sd = this.precision;\r\n    else checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n    k = Math.ceil(sd / LOG_BASE);\r\n\r\n    if (!this.crypto) {\r\n      for (; i < k;) rd[i++] = Math.random() * 1e7 | 0;\r\n\r\n    // Browsers supporting crypto.getRandomValues.\r\n    } else if (crypto.getRandomValues) {\r\n      d = crypto.getRandomValues(new Uint32Array(k));\r\n\r\n      for (; i < k;) {\r\n        n = d[i];\r\n\r\n        // 0 <= n < 4294967296\r\n        // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).\r\n        if (n >= 4.29e9) {\r\n          d[i] = crypto.getRandomValues(new Uint32Array(1))[0];\r\n        } else {\r\n\r\n          // 0 <= n <= 4289999999\r\n          // 0 <= (n % 1e7) <= 9999999\r\n          rd[i++] = n % 1e7;\r\n        }\r\n      }\r\n\r\n    // Node.js supporting crypto.randomBytes.\r\n    } else if (crypto.randomBytes) {\r\n\r\n      // buffer\r\n      d = crypto.randomBytes(k *= 4);\r\n\r\n      for (; i < k;) {\r\n\r\n        // 0 <= n < 2147483648\r\n        n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);\r\n\r\n        // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).\r\n        if (n >= 2.14e9) {\r\n          crypto.randomBytes(4).copy(d, i);\r\n        } else {\r\n\r\n          // 0 <= n <= 2139999999\r\n          // 0 <= (n % 1e7) <= 9999999\r\n          rd.push(n % 1e7);\r\n          i += 4;\r\n        }\r\n      }\r\n\r\n      i = k / 4;\r\n    } else {\r\n      throw Error(cryptoUnavailable);\r\n    }\r\n\r\n    k = rd[--i];\r\n    sd %= LOG_BASE;\r\n\r\n    // Convert trailing digits to zeros according to sd.\r\n    if (k && sd) {\r\n      n = mathpow(10, LOG_BASE - sd);\r\n      rd[i] = (k / n | 0) * n;\r\n    }\r\n\r\n    // Remove trailing words which are zero.\r\n    for (; rd[i] === 0; i--) rd.pop();\r\n\r\n    // Zero?\r\n    if (i < 0) {\r\n      e = 0;\r\n      rd = [0];\r\n    } else {\r\n      e = -1;\r\n\r\n      // Remove leading words which are zero and adjust exponent accordingly.\r\n      for (; rd[0] === 0; e -= LOG_BASE) rd.shift();\r\n\r\n      // Count the digits of the first word of rd to determine leading zeros.\r\n      for (k = 1, n = rd[0]; n >= 10; n /= 10) k++;\r\n\r\n      // Adjust the exponent for leading zeros of the first word of rd.\r\n      if (k < LOG_BASE) e -= LOG_BASE - k;\r\n    }\r\n\r\n    r.e = e;\r\n    r.d = rd;\r\n\r\n    return r;\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.\r\n   *\r\n   * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function round(x) {\r\n    return finalise(x = new this(x), x.e + 1, this.rounding);\r\n  }\r\n\r\n\r\n  /*\r\n   * Return\r\n   *   1    if x > 0,\r\n   *  -1    if x < 0,\r\n   *   0    if x is 0,\r\n   *  -0    if x is -0,\r\n   *   NaN  otherwise\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function sign(x) {\r\n    x = new this(x);\r\n    return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN;\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits\r\n   * using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal} A value in radians.\r\n   *\r\n   */\r\n  function sin(x) {\r\n    return new this(x).sin();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal} A value in radians.\r\n   *\r\n   */\r\n  function sinh(x) {\r\n    return new this(x).sinh();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant\r\n   * digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function sqrt(x) {\r\n    return new this(x).sqrt();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits\r\n   * using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal}\r\n   * y {number|string|Decimal}\r\n   *\r\n   */\r\n  function sub(x, y) {\r\n    return new this(x).sub(y);\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant\r\n   * digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal} A value in radians.\r\n   *\r\n   */\r\n  function tan(x) {\r\n    return new this(x).tan();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`\r\n   * significant digits using rounding mode `rounding`.\r\n   *\r\n   * x {number|string|Decimal} A value in radians.\r\n   *\r\n   */\r\n  function tanh(x) {\r\n    return new this(x).tanh();\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a new Decimal whose value is `x` truncated to an integer.\r\n   *\r\n   * x {number|string|Decimal}\r\n   *\r\n   */\r\n  function trunc(x) {\r\n    return finalise(x = new this(x), x.e + 1, 1);\r\n  }\r\n\r\n\r\n  // Create and configure initial Decimal constructor.\r\n  Decimal = clone(DEFAULTS);\r\n\r\n  Decimal['default'] = Decimal.Decimal = Decimal;\r\n\r\n  // Create the internal constants from their string values.\r\n  LN10 = new Decimal(LN10);\r\n  PI = new Decimal(PI);\r\n\r\n\r\n  // Export.\r\n\r\n\r\n  // AMD.\r\n  if (typeof define == 'function' && define.amd) {\r\n    define(function () {\r\n      return Decimal;\r\n    });\r\n\r\n  // Node and other environments that support module.exports.\r\n  } else if (typeof module != 'undefined' && module.exports) {\r\n    if (typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol') {\r\n      P[Symbol.for('nodejs.util.inspect.custom')] = P.toString;\r\n      P[Symbol.toStringTag] = 'Decimal';\r\n    }\r\n\r\n    module.exports = Decimal;\r\n\r\n  // Browser.\r\n  } else {\r\n    if (!globalScope) {\r\n      globalScope = typeof self != 'undefined' && self && self.self == self ? self : window;\r\n    }\r\n\r\n    noConflict = globalScope.Decimal;\r\n    Decimal.noConflict = function () {\r\n      globalScope.Decimal = noConflict;\r\n      return Decimal;\r\n    };\r\n\r\n    globalScope.Decimal = Decimal;\r\n  }\r\n})(this);\r\n","(function(root, factory) {\n  if (typeof define === 'function' && define.amd) {\n    define([], factory) /* global define */\n  } else if (typeof module === 'object' && module.exports) {\n    module.exports = factory()\n  } else {\n    root.moo = factory()\n  }\n}(this, function() {\n  'use strict';\n\n  var hasOwnProperty = Object.prototype.hasOwnProperty\n  var toString = Object.prototype.toString\n  var hasSticky = typeof new RegExp().sticky === 'boolean'\n\n  /***************************************************************************/\n\n  function isRegExp(o) { return o && toString.call(o) === '[object RegExp]' }\n  function isObject(o) { return o && typeof o === 'object' && !isRegExp(o) && !Array.isArray(o) }\n\n  function reEscape(s) {\n    return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&')\n  }\n  function reGroups(s) {\n    var re = new RegExp('|' + s)\n    return re.exec('').length - 1\n  }\n  function reCapture(s) {\n    return '(' + s + ')'\n  }\n  function reUnion(regexps) {\n    if (!regexps.length) return '(?!)'\n    var source =  regexps.map(function(s) {\n      return \"(?:\" + s + \")\"\n    }).join('|')\n    return \"(?:\" + source + \")\"\n  }\n\n  function regexpOrLiteral(obj) {\n    if (typeof obj === 'string') {\n      return '(?:' + reEscape(obj) + ')'\n\n    } else if (isRegExp(obj)) {\n      // TODO: consider /u support\n      if (obj.ignoreCase) throw new Error('RegExp /i flag not allowed')\n      if (obj.global) throw new Error('RegExp /g flag is implied')\n      if (obj.sticky) throw new Error('RegExp /y flag is implied')\n      if (obj.multiline) throw new Error('RegExp /m flag is implied')\n      return obj.source\n\n    } else {\n      throw new Error('Not a pattern: ' + obj)\n    }\n  }\n\n  function objectToRules(object) {\n    var keys = Object.getOwnPropertyNames(object)\n    var result = []\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i]\n      var thing = object[key]\n      var rules = [].concat(thing)\n      if (key === 'include') {\n        for (var j = 0; j < rules.length; j++) {\n          result.push({include: rules[j]})\n        }\n        continue\n      }\n      var match = []\n      rules.forEach(function(rule) {\n        if (isObject(rule)) {\n          if (match.length) result.push(ruleOptions(key, match))\n          result.push(ruleOptions(key, rule))\n          match = []\n        } else {\n          match.push(rule)\n        }\n      })\n      if (match.length) result.push(ruleOptions(key, match))\n    }\n    return result\n  }\n\n  function arrayToRules(array) {\n    var result = []\n    for (var i = 0; i < array.length; i++) {\n      var obj = array[i]\n      if (obj.include) {\n        var include = [].concat(obj.include)\n        for (var j = 0; j < include.length; j++) {\n          result.push({include: include[j]})\n        }\n        continue\n      }\n      if (!obj.type) {\n        throw new Error('Rule has no type: ' + JSON.stringify(obj))\n      }\n      result.push(ruleOptions(obj.type, obj))\n    }\n    return result\n  }\n\n  function ruleOptions(type, obj) {\n    if (!isObject(obj)) {\n      obj = { match: obj }\n    }\n    if (obj.include) {\n      throw new Error('Matching rules cannot also include states')\n    }\n\n    // nb. error and fallback imply lineBreaks\n    var options = {\n      defaultType: type,\n      lineBreaks: !!obj.error || !!obj.fallback,\n      pop: false,\n      next: null,\n      push: null,\n      error: false,\n      fallback: false,\n      value: null,\n      type: null,\n      shouldThrow: false,\n    }\n\n    // Avoid Object.assign(), so we support IE9+\n    for (var key in obj) {\n      if (hasOwnProperty.call(obj, key)) {\n        options[key] = obj[key]\n      }\n    }\n\n    // type transform cannot be a string\n    if (typeof options.type === 'string' && type !== options.type) {\n      throw new Error(\"Type transform cannot be a string (type '\" + options.type + \"' for token '\" + type + \"')\")\n    }\n\n    // convert to array\n    var match = options.match\n    options.match = Array.isArray(match) ? match : match ? [match] : []\n    options.match.sort(function(a, b) {\n      return isRegExp(a) && isRegExp(b) ? 0\n           : isRegExp(b) ? -1 : isRegExp(a) ? +1 : b.length - a.length\n    })\n    return options\n  }\n\n  function toRules(spec) {\n    return Array.isArray(spec) ? arrayToRules(spec) : objectToRules(spec)\n  }\n\n  var defaultErrorRule = ruleOptions('error', {lineBreaks: true, shouldThrow: true})\n  function compileRules(rules, hasStates) {\n    var errorRule = null\n    var fast = Object.create(null)\n    var fastAllowed = true\n    var unicodeFlag = null\n    var groups = []\n    var parts = []\n\n    // If there is a fallback rule, then disable fast matching\n    for (var i = 0; i < rules.length; i++) {\n      if (rules[i].fallback) {\n        fastAllowed = false\n      }\n    }\n\n    for (var i = 0; i < rules.length; i++) {\n      var options = rules[i]\n\n      if (options.include) {\n        // all valid inclusions are removed by states() preprocessor\n        throw new Error('Inheritance is not allowed in stateless lexers')\n      }\n\n      if (options.error || options.fallback) {\n        // errorRule can only be set once\n        if (errorRule) {\n          if (!options.fallback === !errorRule.fallback) {\n            throw new Error(\"Multiple \" + (options.fallback ? \"fallback\" : \"error\") + \" rules not allowed (for token '\" + options.defaultType + \"')\")\n          } else {\n            throw new Error(\"fallback and error are mutually exclusive (for token '\" + options.defaultType + \"')\")\n          }\n        }\n        errorRule = options\n      }\n\n      var match = options.match.slice()\n      if (fastAllowed) {\n        while (match.length && typeof match[0] === 'string' && match[0].length === 1) {\n          var word = match.shift()\n          fast[word.charCodeAt(0)] = options\n        }\n      }\n\n      // Warn about inappropriate state-switching options\n      if (options.pop || options.push || options.next) {\n        if (!hasStates) {\n          throw new Error(\"State-switching options are not allowed in stateless lexers (for token '\" + options.defaultType + \"')\")\n        }\n        if (options.fallback) {\n          throw new Error(\"State-switching options are not allowed on fallback tokens (for token '\" + options.defaultType + \"')\")\n        }\n      }\n\n      // Only rules with a .match are included in the RegExp\n      if (match.length === 0) {\n        continue\n      }\n      fastAllowed = false\n\n      groups.push(options)\n\n      // Check unicode flag is used everywhere or nowhere\n      for (var j = 0; j < match.length; j++) {\n        var obj = match[j]\n        if (!isRegExp(obj)) {\n          continue\n        }\n\n        if (unicodeFlag === null) {\n          unicodeFlag = obj.unicode\n        } else if (unicodeFlag !== obj.unicode && options.fallback === false) {\n          throw new Error('If one rule is /u then all must be')\n        }\n      }\n\n      // convert to RegExp\n      var pat = reUnion(match.map(regexpOrLiteral))\n\n      // validate\n      var regexp = new RegExp(pat)\n      if (regexp.test(\"\")) {\n        throw new Error(\"RegExp matches empty string: \" + regexp)\n      }\n      var groupCount = reGroups(pat)\n      if (groupCount > 0) {\n        throw new Error(\"RegExp has capture groups: \" + regexp + \"\\nUse (?: … ) instead\")\n      }\n\n      // try and detect rules matching newlines\n      if (!options.lineBreaks && regexp.test('\\n')) {\n        throw new Error('Rule should declare lineBreaks: ' + regexp)\n      }\n\n      // store regex\n      parts.push(reCapture(pat))\n    }\n\n\n    // If there's no fallback rule, use the sticky flag so we only look for\n    // matches at the current index.\n    //\n    // If we don't support the sticky flag, then fake it using an irrefutable\n    // match (i.e. an empty pattern).\n    var fallbackRule = errorRule && errorRule.fallback\n    var flags = hasSticky && !fallbackRule ? 'ym' : 'gm'\n    var suffix = hasSticky || fallbackRule ? '' : '|'\n\n    if (unicodeFlag === true) flags += \"u\"\n    var combined = new RegExp(reUnion(parts) + suffix, flags)\n    return {regexp: combined, groups: groups, fast: fast, error: errorRule || defaultErrorRule}\n  }\n\n  function compile(rules) {\n    var result = compileRules(toRules(rules))\n    return new Lexer({start: result}, 'start')\n  }\n\n  function checkStateGroup(g, name, map) {\n    var state = g && (g.push || g.next)\n    if (state && !map[state]) {\n      throw new Error(\"Missing state '\" + state + \"' (in token '\" + g.defaultType + \"' of state '\" + name + \"')\")\n    }\n    if (g && g.pop && +g.pop !== 1) {\n      throw new Error(\"pop must be 1 (in token '\" + g.defaultType + \"' of state '\" + name + \"')\")\n    }\n  }\n  function compileStates(states, start) {\n    var all = states.$all ? toRules(states.$all) : []\n    delete states.$all\n\n    var keys = Object.getOwnPropertyNames(states)\n    if (!start) start = keys[0]\n\n    var ruleMap = Object.create(null)\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i]\n      ruleMap[key] = toRules(states[key]).concat(all)\n    }\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i]\n      var rules = ruleMap[key]\n      var included = Object.create(null)\n      for (var j = 0; j < rules.length; j++) {\n        var rule = rules[j]\n        if (!rule.include) continue\n        var splice = [j, 1]\n        if (rule.include !== key && !included[rule.include]) {\n          included[rule.include] = true\n          var newRules = ruleMap[rule.include]\n          if (!newRules) {\n            throw new Error(\"Cannot include nonexistent state '\" + rule.include + \"' (in state '\" + key + \"')\")\n          }\n          for (var k = 0; k < newRules.length; k++) {\n            var newRule = newRules[k]\n            if (rules.indexOf(newRule) !== -1) continue\n            splice.push(newRule)\n          }\n        }\n        rules.splice.apply(rules, splice)\n        j--\n      }\n    }\n\n    var map = Object.create(null)\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i]\n      map[key] = compileRules(ruleMap[key], true)\n    }\n\n    for (var i = 0; i < keys.length; i++) {\n      var name = keys[i]\n      var state = map[name]\n      var groups = state.groups\n      for (var j = 0; j < groups.length; j++) {\n        checkStateGroup(groups[j], name, map)\n      }\n      var fastKeys = Object.getOwnPropertyNames(state.fast)\n      for (var j = 0; j < fastKeys.length; j++) {\n        checkStateGroup(state.fast[fastKeys[j]], name, map)\n      }\n    }\n\n    return new Lexer(map, start)\n  }\n\n  function keywordTransform(map) {\n    var reverseMap = Object.create(null)\n    var byLength = Object.create(null)\n    var types = Object.getOwnPropertyNames(map)\n    for (var i = 0; i < types.length; i++) {\n      var tokenType = types[i]\n      var item = map[tokenType]\n      var keywordList = Array.isArray(item) ? item : [item]\n      keywordList.forEach(function(keyword) {\n        (byLength[keyword.length] = byLength[keyword.length] || []).push(keyword)\n        if (typeof keyword !== 'string') {\n          throw new Error(\"keyword must be string (in keyword '\" + tokenType + \"')\")\n        }\n        reverseMap[keyword] = tokenType\n      })\n    }\n\n    // fast string lookup\n    // https://jsperf.com/string-lookups\n    function str(x) { return JSON.stringify(x) }\n    var source = ''\n    source += 'switch (value.length) {\\n'\n    for (var length in byLength) {\n      var keywords = byLength[length]\n      source += 'case ' + length + ':\\n'\n      source += 'switch (value) {\\n'\n      keywords.forEach(function(keyword) {\n        var tokenType = reverseMap[keyword]\n        source += 'case ' + str(keyword) + ': return ' + str(tokenType) + '\\n'\n      })\n      source += '}\\n'\n    }\n    source += '}\\n'\n    return Function('value', source) // type\n  }\n\n  /***************************************************************************/\n\n  var Lexer = function(states, state) {\n    this.startState = state\n    this.states = states\n    this.buffer = ''\n    this.stack = []\n    this.reset()\n  }\n\n  Lexer.prototype.reset = function(data, info) {\n    this.buffer = data || ''\n    this.index = 0\n    this.line = info ? info.line : 1\n    this.col = info ? info.col : 1\n    this.queuedToken = info ? info.queuedToken : null\n    this.queuedThrow = info ? info.queuedThrow : null\n    this.setState(info ? info.state : this.startState)\n    this.stack = info && info.stack ? info.stack.slice() : []\n    return this\n  }\n\n  Lexer.prototype.save = function() {\n    return {\n      line: this.line,\n      col: this.col,\n      state: this.state,\n      stack: this.stack.slice(),\n      queuedToken: this.queuedToken,\n      queuedThrow: this.queuedThrow,\n    }\n  }\n\n  Lexer.prototype.setState = function(state) {\n    if (!state || this.state === state) return\n    this.state = state\n    var info = this.states[state]\n    this.groups = info.groups\n    this.error = info.error\n    this.re = info.regexp\n    this.fast = info.fast\n  }\n\n  Lexer.prototype.popState = function() {\n    this.setState(this.stack.pop())\n  }\n\n  Lexer.prototype.pushState = function(state) {\n    this.stack.push(this.state)\n    this.setState(state)\n  }\n\n  var eat = hasSticky ? function(re, buffer) { // assume re is /y\n    return re.exec(buffer)\n  } : function(re, buffer) { // assume re is /g\n    var match = re.exec(buffer)\n    // will always match, since we used the |(?:) trick\n    if (match[0].length === 0) {\n      return null\n    }\n    return match\n  }\n\n  Lexer.prototype._getGroup = function(match) {\n    var groupCount = this.groups.length\n    for (var i = 0; i < groupCount; i++) {\n      if (match[i + 1] !== undefined) {\n        return this.groups[i]\n      }\n    }\n    throw new Error('Cannot find token type for matched text')\n  }\n\n  function tokenToString() {\n    return this.value\n  }\n\n  Lexer.prototype.next = function() {\n    var index = this.index\n\n    // If a fallback token matched, we don't need to re-run the RegExp\n    if (this.queuedGroup) {\n      var token = this._token(this.queuedGroup, this.queuedText, index)\n      this.queuedGroup = null\n      this.queuedText = \"\"\n      return token\n    }\n\n    var buffer = this.buffer\n    if (index === buffer.length) {\n      return // EOF\n    }\n\n    // Fast matching for single characters\n    var group = this.fast[buffer.charCodeAt(index)]\n    if (group) {\n      return this._token(group, buffer.charAt(index), index)\n    }\n\n    // Execute RegExp\n    var re = this.re\n    re.lastIndex = index\n    var match = eat(re, buffer)\n\n    // Error tokens match the remaining buffer\n    var error = this.error\n    if (match == null) {\n      return this._token(error, buffer.slice(index, buffer.length), index)\n    }\n\n    var group = this._getGroup(match)\n    var text = match[0]\n\n    if (error.fallback && match.index !== index) {\n      this.queuedGroup = group\n      this.queuedText = text\n\n      // Fallback tokens contain the unmatched portion of the buffer\n      return this._token(error, buffer.slice(index, match.index), index)\n    }\n\n    return this._token(group, text, index)\n  }\n\n  Lexer.prototype._token = function(group, text, offset) {\n    // count line breaks\n    var lineBreaks = 0\n    if (group.lineBreaks) {\n      var matchNL = /\\n/g\n      var nl = 1\n      if (text === '\\n') {\n        lineBreaks = 1\n      } else {\n        while (matchNL.exec(text)) { lineBreaks++; nl = matchNL.lastIndex }\n      }\n    }\n\n    var token = {\n      type: (typeof group.type === 'function' && group.type(text)) || group.defaultType,\n      value: typeof group.value === 'function' ? group.value(text) : text,\n      text: text,\n      toString: tokenToString,\n      offset: offset,\n      lineBreaks: lineBreaks,\n      line: this.line,\n      col: this.col,\n    }\n    // nb. adding more props to token object will make V8 sad!\n\n    var size = text.length\n    this.index += size\n    this.line += lineBreaks\n    if (lineBreaks !== 0) {\n      this.col = size - nl + 1\n    } else {\n      this.col += size\n    }\n\n    // throw, if no rule with {error: true}\n    if (group.shouldThrow) {\n      throw new Error(this.formatError(token, \"invalid syntax\"))\n    }\n\n    if (group.pop) this.popState()\n    else if (group.push) this.pushState(group.push)\n    else if (group.next) this.setState(group.next)\n\n    return token\n  }\n\n  if (typeof Symbol !== 'undefined' && Symbol.iterator) {\n    var LexerIterator = function(lexer) {\n      this.lexer = lexer\n    }\n\n    LexerIterator.prototype.next = function() {\n      var token = this.lexer.next()\n      return {value: token, done: !token}\n    }\n\n    LexerIterator.prototype[Symbol.iterator] = function() {\n      return this\n    }\n\n    Lexer.prototype[Symbol.iterator] = function() {\n      return new LexerIterator(this)\n    }\n  }\n\n  Lexer.prototype.formatError = function(token, message) {\n    if (token == null) {\n      // An undefined token indicates EOF\n      var text = this.buffer.slice(this.index)\n      var token = {\n        text: text,\n        offset: this.index,\n        lineBreaks: text.indexOf('\\n') === -1 ? 0 : 1,\n        line: this.line,\n        col: this.col,\n      }\n    }\n    var start = Math.max(0, token.offset - token.col + 1)\n    var eol = token.lineBreaks ? token.text.indexOf('\\n') : token.text.length\n    var firstLine = this.buffer.substring(start, token.offset + eol)\n    message += \" at line \" + token.line + \" col \" + token.col + \":\\n\\n\"\n    message += \"  \" + firstLine + \"\\n\"\n    message += \"  \" + Array(token.col).join(\" \") + \"^\"\n    return message\n  }\n\n  Lexer.prototype.clone = function() {\n    return new Lexer(this.states, this.state)\n  }\n\n  Lexer.prototype.has = function(tokenType) {\n    return true\n  }\n\n\n  return {\n    compile: compile,\n    states: compileStates,\n    error: Object.freeze({error: true}),\n    fallback: Object.freeze({fallback: true}),\n    keywords: keywordTransform,\n  }\n\n}));\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n  \"use strict\";\n\n  var Op = Object.prototype;\n  var hasOwn = Op.hasOwnProperty;\n  var undefined; // More compressible than void 0.\n  var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n  var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n  var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n  var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n  function wrap(innerFn, outerFn, self, tryLocsList) {\n    // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n    var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n    var generator = Object.create(protoGenerator.prototype);\n    var context = new Context(tryLocsList || []);\n\n    // The ._invoke method unifies the implementations of the .next,\n    // .throw, and .return methods.\n    generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n    return generator;\n  }\n  exports.wrap = wrap;\n\n  // Try/catch helper to minimize deoptimizations. Returns a completion\n  // record like context.tryEntries[i].completion. This interface could\n  // have been (and was previously) designed to take a closure to be\n  // invoked without arguments, but in all the cases we care about we\n  // already have an existing method we want to call, so there's no need\n  // to create a new function object. We can even get away with assuming\n  // the method takes exactly one argument, since that happens to be true\n  // in every case, so we don't have to touch the arguments object. The\n  // only additional allocation required is the completion record, which\n  // has a stable shape and so hopefully should be cheap to allocate.\n  function tryCatch(fn, obj, arg) {\n    try {\n      return { type: \"normal\", arg: fn.call(obj, arg) };\n    } catch (err) {\n      return { type: \"throw\", arg: err };\n    }\n  }\n\n  var GenStateSuspendedStart = \"suspendedStart\";\n  var GenStateSuspendedYield = \"suspendedYield\";\n  var GenStateExecuting = \"executing\";\n  var GenStateCompleted = \"completed\";\n\n  // Returning this object from the innerFn has the same effect as\n  // breaking out of the dispatch switch statement.\n  var ContinueSentinel = {};\n\n  // Dummy constructor functions that we use as the .constructor and\n  // .constructor.prototype properties for functions that return Generator\n  // objects. For full spec compliance, you may wish to configure your\n  // minifier not to mangle the names of these two functions.\n  function Generator() {}\n  function GeneratorFunction() {}\n  function GeneratorFunctionPrototype() {}\n\n  // This is a polyfill for %IteratorPrototype% for environments that\n  // don't natively support it.\n  var IteratorPrototype = {};\n  IteratorPrototype[iteratorSymbol] = function () {\n    return this;\n  };\n\n  var getProto = Object.getPrototypeOf;\n  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n  if (NativeIteratorPrototype &&\n      NativeIteratorPrototype !== Op &&\n      hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n    // This environment has a native %IteratorPrototype%; use it instead\n    // of the polyfill.\n    IteratorPrototype = NativeIteratorPrototype;\n  }\n\n  var Gp = GeneratorFunctionPrototype.prototype =\n    Generator.prototype = Object.create(IteratorPrototype);\n  GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n  GeneratorFunctionPrototype.constructor = GeneratorFunction;\n  GeneratorFunctionPrototype[toStringTagSymbol] =\n    GeneratorFunction.displayName = \"GeneratorFunction\";\n\n  // Helper for defining the .next, .throw, and .return methods of the\n  // Iterator interface in terms of a single ._invoke method.\n  function defineIteratorMethods(prototype) {\n    [\"next\", \"throw\", \"return\"].forEach(function(method) {\n      prototype[method] = function(arg) {\n        return this._invoke(method, arg);\n      };\n    });\n  }\n\n  exports.isGeneratorFunction = function(genFun) {\n    var ctor = typeof genFun === \"function\" && genFun.constructor;\n    return ctor\n      ? ctor === GeneratorFunction ||\n        // For the native GeneratorFunction constructor, the best we can\n        // do is to check its .name property.\n        (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n      : false;\n  };\n\n  exports.mark = function(genFun) {\n    if (Object.setPrototypeOf) {\n      Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n    } else {\n      genFun.__proto__ = GeneratorFunctionPrototype;\n      if (!(toStringTagSymbol in genFun)) {\n        genFun[toStringTagSymbol] = \"GeneratorFunction\";\n      }\n    }\n    genFun.prototype = Object.create(Gp);\n    return genFun;\n  };\n\n  // Within the body of any async function, `await x` is transformed to\n  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n  // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n  // meant to be awaited.\n  exports.awrap = function(arg) {\n    return { __await: arg };\n  };\n\n  function AsyncIterator(generator, PromiseImpl) {\n    function invoke(method, arg, resolve, reject) {\n      var record = tryCatch(generator[method], generator, arg);\n      if (record.type === \"throw\") {\n        reject(record.arg);\n      } else {\n        var result = record.arg;\n        var value = result.value;\n        if (value &&\n            typeof value === \"object\" &&\n            hasOwn.call(value, \"__await\")) {\n          return PromiseImpl.resolve(value.__await).then(function(value) {\n            invoke(\"next\", value, resolve, reject);\n          }, function(err) {\n            invoke(\"throw\", err, resolve, reject);\n          });\n        }\n\n        return PromiseImpl.resolve(value).then(function(unwrapped) {\n          // When a yielded Promise is resolved, its final value becomes\n          // the .value of the Promise<{value,done}> result for the\n          // current iteration.\n          result.value = unwrapped;\n          resolve(result);\n        }, function(error) {\n          // If a rejected Promise was yielded, throw the rejection back\n          // into the async generator function so it can be handled there.\n          return invoke(\"throw\", error, resolve, reject);\n        });\n      }\n    }\n\n    var previousPromise;\n\n    function enqueue(method, arg) {\n      function callInvokeWithMethodAndArg() {\n        return new PromiseImpl(function(resolve, reject) {\n          invoke(method, arg, resolve, reject);\n        });\n      }\n\n      return previousPromise =\n        // If enqueue has been called before, then we want to wait until\n        // all previous Promises have been resolved before calling invoke,\n        // so that results are always delivered in the correct order. If\n        // enqueue has not been called before, then it is important to\n        // call invoke immediately, without waiting on a callback to fire,\n        // so that the async generator function has the opportunity to do\n        // any necessary setup in a predictable way. This predictability\n        // is why the Promise constructor synchronously invokes its\n        // executor callback, and why async functions synchronously\n        // execute code before the first await. Since we implement simple\n        // async functions in terms of async generators, it is especially\n        // important to get this right, even though it requires care.\n        previousPromise ? previousPromise.then(\n          callInvokeWithMethodAndArg,\n          // Avoid propagating failures to Promises returned by later\n          // invocations of the iterator.\n          callInvokeWithMethodAndArg\n        ) : callInvokeWithMethodAndArg();\n    }\n\n    // Define the unified helper method that is used to implement .next,\n    // .throw, and .return (see defineIteratorMethods).\n    this._invoke = enqueue;\n  }\n\n  defineIteratorMethods(AsyncIterator.prototype);\n  AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n    return this;\n  };\n  exports.AsyncIterator = AsyncIterator;\n\n  // Note that simple async functions are implemented on top of\n  // AsyncIterator objects; they just return a Promise for the value of\n  // the final result produced by the iterator.\n  exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n    if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n    var iter = new AsyncIterator(\n      wrap(innerFn, outerFn, self, tryLocsList),\n      PromiseImpl\n    );\n\n    return exports.isGeneratorFunction(outerFn)\n      ? iter // If outerFn is a generator, return the full iterator.\n      : iter.next().then(function(result) {\n          return result.done ? result.value : iter.next();\n        });\n  };\n\n  function makeInvokeMethod(innerFn, self, context) {\n    var state = GenStateSuspendedStart;\n\n    return function invoke(method, arg) {\n      if (state === GenStateExecuting) {\n        throw new Error(\"Generator is already running\");\n      }\n\n      if (state === GenStateCompleted) {\n        if (method === \"throw\") {\n          throw arg;\n        }\n\n        // Be forgiving, per 25.3.3.3.3 of the spec:\n        // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n        return doneResult();\n      }\n\n      context.method = method;\n      context.arg = arg;\n\n      while (true) {\n        var delegate = context.delegate;\n        if (delegate) {\n          var delegateResult = maybeInvokeDelegate(delegate, context);\n          if (delegateResult) {\n            if (delegateResult === ContinueSentinel) continue;\n            return delegateResult;\n          }\n        }\n\n        if (context.method === \"next\") {\n          // Setting context._sent for legacy support of Babel's\n          // function.sent implementation.\n          context.sent = context._sent = context.arg;\n\n        } else if (context.method === \"throw\") {\n          if (state === GenStateSuspendedStart) {\n            state = GenStateCompleted;\n            throw context.arg;\n          }\n\n          context.dispatchException(context.arg);\n\n        } else if (context.method === \"return\") {\n          context.abrupt(\"return\", context.arg);\n        }\n\n        state = GenStateExecuting;\n\n        var record = tryCatch(innerFn, self, context);\n        if (record.type === \"normal\") {\n          // If an exception is thrown from innerFn, we leave state ===\n          // GenStateExecuting and loop back for another invocation.\n          state = context.done\n            ? GenStateCompleted\n            : GenStateSuspendedYield;\n\n          if (record.arg === ContinueSentinel) {\n            continue;\n          }\n\n          return {\n            value: record.arg,\n            done: context.done\n          };\n\n        } else if (record.type === \"throw\") {\n          state = GenStateCompleted;\n          // Dispatch the exception by looping back around to the\n          // context.dispatchException(context.arg) call above.\n          context.method = \"throw\";\n          context.arg = record.arg;\n        }\n      }\n    };\n  }\n\n  // Call delegate.iterator[context.method](context.arg) and handle the\n  // result, either by returning a { value, done } result from the\n  // delegate iterator, or by modifying context.method and context.arg,\n  // setting context.delegate to null, and returning the ContinueSentinel.\n  function maybeInvokeDelegate(delegate, context) {\n    var method = delegate.iterator[context.method];\n    if (method === undefined) {\n      // A .throw or .return when the delegate iterator has no .throw\n      // method always terminates the yield* loop.\n      context.delegate = null;\n\n      if (context.method === \"throw\") {\n        // Note: [\"return\"] must be used for ES3 parsing compatibility.\n        if (delegate.iterator[\"return\"]) {\n          // If the delegate iterator has a return method, give it a\n          // chance to clean up.\n          context.method = \"return\";\n          context.arg = undefined;\n          maybeInvokeDelegate(delegate, context);\n\n          if (context.method === \"throw\") {\n            // If maybeInvokeDelegate(context) changed context.method from\n            // \"return\" to \"throw\", let that override the TypeError below.\n            return ContinueSentinel;\n          }\n        }\n\n        context.method = \"throw\";\n        context.arg = new TypeError(\n          \"The iterator does not provide a 'throw' method\");\n      }\n\n      return ContinueSentinel;\n    }\n\n    var record = tryCatch(method, delegate.iterator, context.arg);\n\n    if (record.type === \"throw\") {\n      context.method = \"throw\";\n      context.arg = record.arg;\n      context.delegate = null;\n      return ContinueSentinel;\n    }\n\n    var info = record.arg;\n\n    if (! info) {\n      context.method = \"throw\";\n      context.arg = new TypeError(\"iterator result is not an object\");\n      context.delegate = null;\n      return ContinueSentinel;\n    }\n\n    if (info.done) {\n      // Assign the result of the finished delegate to the temporary\n      // variable specified by delegate.resultName (see delegateYield).\n      context[delegate.resultName] = info.value;\n\n      // Resume execution at the desired location (see delegateYield).\n      context.next = delegate.nextLoc;\n\n      // If context.method was \"throw\" but the delegate handled the\n      // exception, let the outer generator proceed normally. If\n      // context.method was \"next\", forget context.arg since it has been\n      // \"consumed\" by the delegate iterator. If context.method was\n      // \"return\", allow the original .return call to continue in the\n      // outer generator.\n      if (context.method !== \"return\") {\n        context.method = \"next\";\n        context.arg = undefined;\n      }\n\n    } else {\n      // Re-yield the result returned by the delegate method.\n      return info;\n    }\n\n    // The delegate iterator is finished, so forget it and continue with\n    // the outer generator.\n    context.delegate = null;\n    return ContinueSentinel;\n  }\n\n  // Define Generator.prototype.{next,throw,return} in terms of the\n  // unified ._invoke helper method.\n  defineIteratorMethods(Gp);\n\n  Gp[toStringTagSymbol] = \"Generator\";\n\n  // A Generator should always return itself as the iterator object when the\n  // @@iterator function is called on it. Some browsers' implementations of the\n  // iterator prototype chain incorrectly implement this, causing the Generator\n  // object to not be returned from this call. This ensures that doesn't happen.\n  // See https://github.com/facebook/regenerator/issues/274 for more details.\n  Gp[iteratorSymbol] = function() {\n    return this;\n  };\n\n  Gp.toString = function() {\n    return \"[object Generator]\";\n  };\n\n  function pushTryEntry(locs) {\n    var entry = { tryLoc: locs[0] };\n\n    if (1 in locs) {\n      entry.catchLoc = locs[1];\n    }\n\n    if (2 in locs) {\n      entry.finallyLoc = locs[2];\n      entry.afterLoc = locs[3];\n    }\n\n    this.tryEntries.push(entry);\n  }\n\n  function resetTryEntry(entry) {\n    var record = entry.completion || {};\n    record.type = \"normal\";\n    delete record.arg;\n    entry.completion = record;\n  }\n\n  function Context(tryLocsList) {\n    // The root entry object (effectively a try statement without a catch\n    // or a finally block) gives us a place to store values thrown from\n    // locations where there is no enclosing try statement.\n    this.tryEntries = [{ tryLoc: \"root\" }];\n    tryLocsList.forEach(pushTryEntry, this);\n    this.reset(true);\n  }\n\n  exports.keys = function(object) {\n    var keys = [];\n    for (var key in object) {\n      keys.push(key);\n    }\n    keys.reverse();\n\n    // Rather than returning an object with a next method, we keep\n    // things simple and return the next function itself.\n    return function next() {\n      while (keys.length) {\n        var key = keys.pop();\n        if (key in object) {\n          next.value = key;\n          next.done = false;\n          return next;\n        }\n      }\n\n      // To avoid creating an additional object, we just hang the .value\n      // and .done properties off the next function object itself. This\n      // also ensures that the minifier will not anonymize the function.\n      next.done = true;\n      return next;\n    };\n  };\n\n  function values(iterable) {\n    if (iterable) {\n      var iteratorMethod = iterable[iteratorSymbol];\n      if (iteratorMethod) {\n        return iteratorMethod.call(iterable);\n      }\n\n      if (typeof iterable.next === \"function\") {\n        return iterable;\n      }\n\n      if (!isNaN(iterable.length)) {\n        var i = -1, next = function next() {\n          while (++i < iterable.length) {\n            if (hasOwn.call(iterable, i)) {\n              next.value = iterable[i];\n              next.done = false;\n              return next;\n            }\n          }\n\n          next.value = undefined;\n          next.done = true;\n\n          return next;\n        };\n\n        return next.next = next;\n      }\n    }\n\n    // Return an iterator with no values.\n    return { next: doneResult };\n  }\n  exports.values = values;\n\n  function doneResult() {\n    return { value: undefined, done: true };\n  }\n\n  Context.prototype = {\n    constructor: Context,\n\n    reset: function(skipTempReset) {\n      this.prev = 0;\n      this.next = 0;\n      // Resetting context._sent for legacy support of Babel's\n      // function.sent implementation.\n      this.sent = this._sent = undefined;\n      this.done = false;\n      this.delegate = null;\n\n      this.method = \"next\";\n      this.arg = undefined;\n\n      this.tryEntries.forEach(resetTryEntry);\n\n      if (!skipTempReset) {\n        for (var name in this) {\n          // Not sure about the optimal order of these conditions:\n          if (name.charAt(0) === \"t\" &&\n              hasOwn.call(this, name) &&\n              !isNaN(+name.slice(1))) {\n            this[name] = undefined;\n          }\n        }\n      }\n    },\n\n    stop: function() {\n      this.done = true;\n\n      var rootEntry = this.tryEntries[0];\n      var rootRecord = rootEntry.completion;\n      if (rootRecord.type === \"throw\") {\n        throw rootRecord.arg;\n      }\n\n      return this.rval;\n    },\n\n    dispatchException: function(exception) {\n      if (this.done) {\n        throw exception;\n      }\n\n      var context = this;\n      function handle(loc, caught) {\n        record.type = \"throw\";\n        record.arg = exception;\n        context.next = loc;\n\n        if (caught) {\n          // If the dispatched exception was caught by a catch block,\n          // then let that catch block handle the exception normally.\n          context.method = \"next\";\n          context.arg = undefined;\n        }\n\n        return !! caught;\n      }\n\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        var record = entry.completion;\n\n        if (entry.tryLoc === \"root\") {\n          // Exception thrown outside of any try block that could handle\n          // it, so set the completion value of the entire function to\n          // throw the exception.\n          return handle(\"end\");\n        }\n\n        if (entry.tryLoc <= this.prev) {\n          var hasCatch = hasOwn.call(entry, \"catchLoc\");\n          var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n          if (hasCatch && hasFinally) {\n            if (this.prev < entry.catchLoc) {\n              return handle(entry.catchLoc, true);\n            } else if (this.prev < entry.finallyLoc) {\n              return handle(entry.finallyLoc);\n            }\n\n          } else if (hasCatch) {\n            if (this.prev < entry.catchLoc) {\n              return handle(entry.catchLoc, true);\n            }\n\n          } else if (hasFinally) {\n            if (this.prev < entry.finallyLoc) {\n              return handle(entry.finallyLoc);\n            }\n\n          } else {\n            throw new Error(\"try statement without catch or finally\");\n          }\n        }\n      }\n    },\n\n    abrupt: function(type, arg) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.tryLoc <= this.prev &&\n            hasOwn.call(entry, \"finallyLoc\") &&\n            this.prev < entry.finallyLoc) {\n          var finallyEntry = entry;\n          break;\n        }\n      }\n\n      if (finallyEntry &&\n          (type === \"break\" ||\n           type === \"continue\") &&\n          finallyEntry.tryLoc <= arg &&\n          arg <= finallyEntry.finallyLoc) {\n        // Ignore the finally entry if control is not jumping to a\n        // location outside the try/catch block.\n        finallyEntry = null;\n      }\n\n      var record = finallyEntry ? finallyEntry.completion : {};\n      record.type = type;\n      record.arg = arg;\n\n      if (finallyEntry) {\n        this.method = \"next\";\n        this.next = finallyEntry.finallyLoc;\n        return ContinueSentinel;\n      }\n\n      return this.complete(record);\n    },\n\n    complete: function(record, afterLoc) {\n      if (record.type === \"throw\") {\n        throw record.arg;\n      }\n\n      if (record.type === \"break\" ||\n          record.type === \"continue\") {\n        this.next = record.arg;\n      } else if (record.type === \"return\") {\n        this.rval = this.arg = record.arg;\n        this.method = \"return\";\n        this.next = \"end\";\n      } else if (record.type === \"normal\" && afterLoc) {\n        this.next = afterLoc;\n      }\n\n      return ContinueSentinel;\n    },\n\n    finish: function(finallyLoc) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.finallyLoc === finallyLoc) {\n          this.complete(entry.completion, entry.afterLoc);\n          resetTryEntry(entry);\n          return ContinueSentinel;\n        }\n      }\n    },\n\n    \"catch\": function(tryLoc) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.tryLoc === tryLoc) {\n          var record = entry.completion;\n          if (record.type === \"throw\") {\n            var thrown = record.arg;\n            resetTryEntry(entry);\n          }\n          return thrown;\n        }\n      }\n\n      // The context.catch method must only be called with a location\n      // argument that corresponds to a known catch block.\n      throw new Error(\"illegal catch attempt\");\n    },\n\n    delegateYield: function(iterable, resultName, nextLoc) {\n      this.delegate = {\n        iterator: values(iterable),\n        resultName: resultName,\n        nextLoc: nextLoc\n      };\n\n      if (this.method === \"next\") {\n        // Deliberately forget the last sent value so that we don't\n        // accidentally pass it on to the delegate.\n        this.arg = undefined;\n      }\n\n      return ContinueSentinel;\n    }\n  };\n\n  // Regardless of whether this script is executing as a CommonJS module\n  // or not, return the runtime object so that we can declare the variable\n  // regeneratorRuntime in the outer scope, which allows this module to be\n  // injected easily by `bin/regenerator --include-runtime script.js`.\n  return exports;\n\n}(\n  // If this script is executing as a CommonJS module, use module.exports\n  // as the regeneratorRuntime namespace. Otherwise create a new empty\n  // object. Either way, the resulting object will be used to initialize\n  // the regeneratorRuntime variable at the top of this file.\n  typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n  regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n  // This module should not be running in strict mode, so the above\n  // assignment should always work unless something is misconfigured. Just\n  // in case runtime.js accidentally runs in strict mode, we can escape\n  // strict mode using a global Function call. This could conceivably fail\n  // if a Content Security Policy forbids using Function, but in that case\n  // the proper solution is to fix the accidental strict mode problem. If\n  // you've misconfigured your bundler to force strict mode and applied a\n  // CSP to forbid Function, and you're not willing to fix either of those\n  // problems, please detail your unique predicament in a GitHub issue.\n  Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export var StringTypes;\n(function (StringTypes) {\n    StringTypes[\"ERROR\"] = \"error\";\n    StringTypes[\"MESSAGE\"] = \"message\";\n    StringTypes[\"UI\"] = \"ui\";\n})(StringTypes || (StringTypes = {}));\n","interface ConfigInterface {\n  [id: string]: unknown;\n}\n\nclass ConfigObject implements ConfigInterface {\n  public decimalPlaces: number;\n  public intConvertRoundMode: number;\n  public default_lang: string;\n  public enable_type_casting: boolean;\n  public idle_input_interval: number;\n  public suspend_threshold: number;\n  public max_instruction_count: number;\n  public activity_programming_type: Map<string, string>;\n  public activity_functions: Map<string, boolean>;\n  public activity_datatypes: Map<string, boolean>;\n  public activity_commands: Map<string, boolean>;\n  public activity_filter: Map<string, boolean>;\n  [id: string]: unknown;\n\n  constructor () {\n    this.decimalPlaces = 8;\n    this.intConvertRoundMode = 2;\n    this.default_lang = \"pt\";\n    this.enable_type_casting = true;\n    this.idle_input_interval = 5000;\n    this.suspend_threshold = 1000;\n    // this.max_instruction_count = 350250; - automated evaluation limit\n    this.max_instruction_count = Number.MAX_SAFE_INTEGER;\n    this.activity_programming_type = new Map<string, string>();\n    this.activity_functions = new Map<string, boolean>();\n    this.activity_datatypes = new Map<string, boolean>();\n    this.activity_commands = new Map<string, boolean>();\n    this.activity_filter = new Map<string, boolean>();\n  }\n\n  setConfig (opts: object): void {\n    const otherConfig = opts as ConfigInterface;\n    for (const key in otherConfig) {\n      if (Object.prototype.hasOwnProperty.call(this, key)) {\n        this[key] = otherConfig[key];\n      }\n    }\n  }\n}\n\nconst config = new ConfigObject();\nexport const Config = config;\n","var LanguageService = /** @class */ (function () {\n    function LanguageService(lsKey, defaultLang) {\n        if (defaultLang === void 0) { defaultLang = 'pt'; }\n        this.lsKey = lsKey;\n        this.defaultLang = defaultLang;\n        this.listeners = [];\n        this.document = document;\n        this.setupListener();\n    }\n    LanguageService.prototype.setupListener = function () {\n        var _this = this;\n        if (this.document !== null) {\n            this.document.addEventListener(\"storage\", (function (event) {\n                var e = event;\n                if (e.key === _this.lsKey) {\n                    _this.listeners.forEach(function (l) { return l(); });\n                }\n            }));\n        }\n    };\n    LanguageService.prototype.getLang = function () {\n        var lang = localStorage.getItem(this.lsKey);\n        if (lang === null || lang === undefined) {\n            console.warn(\"Internal Error: User language information has not been set. Returning default...\");\n            return this.getDefaultLang();\n        }\n        return lang;\n    };\n    LanguageService.prototype.getDefaultLang = function () {\n        return this.defaultLang;\n    };\n    LanguageService.prototype.registerLanguageChangeListener = function (listener) {\n        this.listeners.push(listener);\n    };\n    return LanguageService;\n}());\nexport { LanguageService };\n","import { StringTypes } from \"./StringTypes\";\nvar LocalizedStrings = /** @class */ (function () {\n    function LocalizedStrings(service, i18nData, listenToChange) {\n        var _this = this;\n        if (listenToChange === void 0) { listenToChange = false; }\n        this.service = service;\n        this.i18nData = i18nData;\n        this.listenToChange = listenToChange;\n        this.document = document;\n        if (this.listenToChange) {\n            service.registerLanguageChangeListener(function () {\n                _this.updateTagText();\n            });\n        }\n    }\n    LocalizedStrings.prototype.getString = function (id, type) {\n        var i18nObj = this.i18nData[this.service.getLang()];\n        if (!i18nObj) {\n            console.warn(\"Internal Error. The language set at ivprog.lang is not valid: \" + this.service.getLang());\n            return this.getDefaultString(id, type);\n        }\n        if (!i18nObj[type]) {\n            return this.getDefaultString(id, type);\n        }\n        else if (!i18nObj[type][id]) {\n            return this.getDefaultString(id, type);\n        }\n        else {\n            return i18nObj[type][id];\n        }\n    };\n    LocalizedStrings.prototype.getDefaultString = function (id, type) {\n        var i18nObj = this.i18nData[this.service.getDefaultLang()];\n        if (!i18nObj[type]) {\n            return \"{MISSING_I18N_TYPE_IDENTIFIER: \" + type + \"}\";\n        }\n        else if (!i18nObj[type][id]) {\n            return \"{MISSING_I18N_IDENTIFIER: \" + id + \"}\";\n        }\n        else {\n            return i18nObj[type][id];\n        }\n    };\n    LocalizedStrings.prototype.getOR = function () {\n        return this.getUI(\"string_join_or\");\n    };\n    LocalizedStrings.prototype.getError = function (id, context) {\n        if (context === void 0) { context = []; }\n        var text = this.getString(id, StringTypes.ERROR);\n        return this.processString(text, context);\n    };\n    LocalizedStrings.prototype.getMessage = function (id, context) {\n        if (context === void 0) { context = []; }\n        var text = this.getString(id, StringTypes.MESSAGE);\n        return this.processString(text, context);\n    };\n    LocalizedStrings.prototype.getUI = function (id, context) {\n        if (context === void 0) { context = []; }\n        var text = this.getString(id, StringTypes.UI);\n        return this.processString(text, context);\n    };\n    LocalizedStrings.prototype.processString = function (text, context) {\n        for (var i = 0; i < context.length; i++) {\n            var v = context[i];\n            text = text.replace(\"$\" + i, v);\n        }\n        return text;\n    };\n    LocalizedStrings.prototype.updateTagText = function (func) {\n        var _this = this;\n        if (func === void 0) { func = null; }\n        if (this.document !== null) {\n            var list = this.document.querySelectorAll(\"data.i18n\");\n            list.forEach(function (node) {\n                if (func === null) {\n                    node.innerHTML = _this.processTagTex(node.getAttribute(\"value\"));\n                }\n                else {\n                    node.innerHTML = func(node.getAttribute(\"value\"));\n                }\n            });\n        }\n    };\n    LocalizedStrings.prototype.processTagTex = function (text) {\n        if (text === null) {\n            return \"<Invalid i18n identifier>\";\n        }\n        var opts = text.split(\":\");\n        var type = opts[0].toLowerCase();\n        var id = opts[1];\n        if (StringTypes.ERROR === type) {\n            return this.getError(id);\n        }\n        else if (StringTypes.MESSAGE === type) {\n            return this.getMessage(id);\n        }\n        else if (StringTypes.UI === type) {\n            return this.getUI(id);\n        }\n        else {\n            console.warn(\" A string has been passed to the i18n helper function that was not in the form type:id -> \" +\n                text);\n            return this.getString(id, type);\n        }\n    };\n    return LocalizedStrings;\n}());\nexport { LocalizedStrings };\n","import { LanguageService } from \"./LanguageService\";\nimport { LocalizedStrings } from \"./LocalizedStrings\";\nimport { StringTypes } from \"./StringTypes\";\nimport { LanguageServiceNoLS } from \"./LanguageServiceNoLS\";\nexport default {\n    LanguageService: LanguageService,\n    LanguageServiceNoLS: LanguageServiceNoLS,\n    LocalizedStrings: LocalizedStrings,\n    StringTypes: StringTypes\n};\n","var LanguageServiceNoLS = /** @class */ (function () {\n    function LanguageServiceNoLS(lang) {\n        this.lang = lang;\n        this.listeners = [];\n    }\n    LanguageServiceNoLS.prototype.setupListener = function () { };\n    LanguageServiceNoLS.prototype.notifyChange = function () {\n        this.listeners.forEach(function (l) { return l(); });\n    };\n    LanguageServiceNoLS.prototype.setLang = function (lang) {\n        this.lang = lang;\n        this.notifyChange();\n    };\n    LanguageServiceNoLS.prototype.getLang = function () {\n        return this.lang;\n    };\n    LanguageServiceNoLS.prototype.getDefaultLang = function () {\n        return this.lang;\n    };\n    LanguageServiceNoLS.prototype.registerLanguageChangeListener = function (listener) {\n        this.listeners.push(listener);\n    };\n    return LanguageServiceNoLS;\n}());\nexport { LanguageServiceNoLS };\n","import * as Messages from './message.csv';\nimport * as UI from './ui.csv';\nimport * as Errors from './error.csv';\n\ntype Dict =  {[id: string]: unknown};\n\nconst MessagesObj = Messages as Dict;\nconst UIObj = UI as Dict;\nconst ErrorsObj = Errors as Dict;\nconst i18n_data = {} as Dict;\n\nfor (const key in UIObj) {\n  const data = {} as Dict;\n  data['error'] = ErrorsObj[key];\n  data['message'] = MessagesObj[key];\n  data['ui'] = UIObj[key];\n  i18n_data[key] = data;\n}\n\nexport default i18n_data;\n","export function combineRegex(strings: TemplateStringsArray, ...pieces: any[]) {\n  return new RegExp(\n    strings.raw\n      .map(\n        (r, i) =>\n          r + (pieces[i] === undefined ? \"\" : \"(?:\" + pieces[i].source + \")\")\n      )\n      .join(\"\")\n  );\n}\n","import * as moo from \"moo\";\nimport { combineRegex } from \"./helper\";\n\nexport interface I18N_LEXER_TYPES {\n  RK_INTEGER: string;\n  RK_REAL: string;\n  RK_CHARACTER: string;\n  RK_STRING: string;\n  RK_BOOLEAN: string;\n}\n\nexport interface I18N_LEXER_BOOLVAL {\n  RK_FALSE: string;\n  RK_TRUE: string;\n}\n\nexport interface I18N_LEXER_LOGICOP {\n  RK_LOGICAL_NOT: string;\n  RK_LOGICAL_AND: string;\n  RK_LOGICAL_OR: string;\n}\n\nexport interface I18N_LEXER_COMMANDS {\n  RK_PROGRAM: string;\n  RK_VOID: string;\n  RK_SWITCH: string;\n  RK_CASE: string;\n  RK_DEFAULT: string;\n  RK_CONST: string;\n  RK_FUNCTION: string;\n  RK_RETURN: string;\n  RK_FOR: string;\n  RK_FOR_ALT: string;\n  RK_FOR_FROM: string;\n  RK_FOR_TO: string;\n  RK_FOR_PASS: string;\n  RK_BREAK: string;\n  RK_DO: string;\n  RK_DO_UNTIL: string;\n  RK_WHILE: string;\n  RK_WHILE_ALT: string;\n  RK_IF: string;\n  RK_ELSE: string;\n  RK_REFERENCE: string;\n}\n\nexport interface I18N_LANG_LIBS {\n  $ioLib: string;\n  $strLib: string;\n  $mathLib: string;\n  $langLib: string;\n  $arrayLib: string;\n}\n\nexport interface I18N_LANG_FUNCS {\n  main_function: string;\n  $read: string;\n  $write: string;\n  $numElements: string;\n  $matrixLines: string;\n  $matrixColumns: string;\n  $substring: string;\n  $length: string;\n  $uppercase: string;\n  $lowercase: string;\n  $charAt: string;\n  $isReal: string;\n  $isInt: string;\n  $isBool: string;\n  $castReal: string;\n  $castInt: string;\n  $castBool: string;\n  $castString: string;\n  $castChar: string;\n  $sin: string;\n  $cos: string;\n  $tan: string;\n  $sqrt: string;\n  $pow: string;\n  $log: string;\n  $abs: string;\n  $negate: string;\n  $invert: string;\n  $max: string;\n  $min: string;\n  $rand: string;\n}\n\nexport interface I18nLexer {\n  commands: I18N_LEXER_COMMANDS;\n  logicOp: I18N_LEXER_LOGICOP;\n  boolVal: I18N_LEXER_BOOLVAL;\n  types: I18N_LEXER_TYPES;\n  langLibs: I18N_LANG_LIBS;\n  langFuncs: I18N_LANG_FUNCS;\n}\n\nexport class IVProgLexer {\n  constructor (\n    private RKs: Record<string, string>,\n    public lexer: moo.Lexer,\n    private rules: I18N_LEXER_RULES,\n    private i18nLexer: I18nLexer\n  ) {}\n\n  getReservedKeys (): Record<string, string> {\n    return this.RKs;\n  }\n\n  getRules (): I18N_LEXER_RULES {\n    return this.rules;\n  }\n\n  getTypeKeys (): I18N_LEXER_TYPES {\n    return this.i18nLexer.types;\n  }\n\n  getLangLibs (): I18N_LANG_LIBS {\n    return this.i18nLexer.langLibs;\n  }\n\n  getLangFuncs (): I18N_LANG_FUNCS {\n    return this.i18nLexer.langFuncs;\n  }\n}\n\nexport interface I18N_LEXER_RULES\n  extends I18N_LEXER_TYPES,\n    I18N_LEXER_COMMANDS,\n    I18N_LEXER_BOOLVAL,\n    I18N_LEXER_LOGICOP {\n  OPEN_BRACE: string;\n  CLOSE_BRACE: string;\n  OPEN_PARENTHESIS: string;\n  CLOSE_PARENTHESIS: string;\n  OPEN_CURLY: string;\n  CLOSE_CURLY: string;\n  COMMA: string;\n  ASSIGNMENT: string;\n  REAL: string;\n  INTEGER: string;\n  SUM_OP: string;\n  MULTI_OP: string;\n  RELATIONAL_OPERATOR: string;\n  COLON: string;\n  STRING: string;\n  CHARACTER: string;\n  EOS: string;\n  WHITESPACE: string;\n  COMMENTS: string;\n  RK_REFERENCE: string;\n  ID: string;\n  DOT: string;\n  ERROR: string;\n}\n\n// General Regex Rules\nconst ID = \"[a-zA-Z_][a-zA-Z0-9_]*\";\nconst HEX_DIGIT = \"[0-9a-fA-F]\";\nconst OCTAL_DIGIT = \"[0-7]\";\nconst ESC_OCTAL = RegExp(\n  `\\\\\\\\[0-3]${OCTAL_DIGIT}${OCTAL_DIGIT}|\\\\\\\\${OCTAL_DIGIT}${OCTAL_DIGIT}|\\\\\\\\${OCTAL_DIGIT}`\n);\nconst ESC_UNICODE = RegExp(\n  `\\\\\\\\u${HEX_DIGIT}${HEX_DIGIT}${HEX_DIGIT}${HEX_DIGIT}`\n);\nconst ESC_SEQ_BASE = /\\\\[b,t,n,f,r,\",',\\\\]|/;\nconst ESC_SEQ = combineRegex`${ESC_SEQ_BASE}|${ESC_UNICODE}|${ESC_OCTAL}`;\nconst STRING_CHARACTER = combineRegex`${ESC_SEQ}|[^\"\\\\\\\\]`;\n\nexport function makeLexer (lexer: I18nLexer): IVProgLexer {\n  const RKs: Record<string, string> = {};\n  const rules: Record<string, string> = {};\n  Object.entries(lexer.types).forEach(([key, value]) => {\n    RKs[key] = value;\n    rules[key] = key;\n  });\n  Object.entries(lexer.boolVal).forEach(([key, value]) => {\n    RKs[key] = value;\n    rules[key] = key;\n  });\n  Object.entries(lexer.commands).forEach(([key, value]) => {\n    RKs[key] = value;\n    rules[key] = key;\n  });\n  RKs[\"RK_LOGICAL_AND\"] = lexer.logicOp.RK_LOGICAL_AND;\n  RKs[\"RK_LOGICAL_OR\"] = lexer.logicOp.RK_LOGICAL_OR;\n  RKs[\"RK_LOGICAL_NOT\"] = lexer.logicOp.RK_LOGICAL_NOT;\n\n  rules[\"RK_LOGICAL_AND\"] = \"RK_LOGICAL_AND\";\n  rules[\"RK_LOGICAL_OR\"] = \"RK_LOGICAL_OR\";\n  rules[\"RK_LOGICAL_NOT\"] = \"RK_LOGICAL_NOT\";\n\n  const RESERVED_KEYS = moo.keywords(RKs);\n\n  const lexerRules: moo.Rules = {\n    COMMENTS: { match: /\\/\\/[^$]*?$|\\/\\*[^$]*?\\*\\//, lineBreaks: true },\n    OPEN_BRACE: /\\[/,\n    CLOSE_BRACE: /\\]/,\n    OPEN_PARENTHESIS: /\\(/,\n    CLOSE_PARENTHESIS: /\\)/,\n    OPEN_CURLY: /\\{/,\n    CLOSE_CURLY: /\\}/,\n    COMMA: /,/,\n    ASSIGNMENT: /<-|←/,\n    REAL: /[0-9]+\\.[0-9]*[eE][+-]?[0-9]+|[0-9]+\\.[0-9]+/,\n    INTEGER: RegExp(`(?:0x|0X)${HEX_DIGIT}+|(?:0b|0B)[0-1]+|[0-9]+`),\n    SUM_OP: /[+-]/,\n    MULTI_OP: /[*/%]/,\n    RELATIONAL_OPERATOR: />=|==|<=|>|<|!=/,\n    COLON: /:/,\n    STRING: combineRegex`\"(?:${STRING_CHARACTER})*?\"`,\n    CHARACTER: combineRegex`'(?:${ESC_SEQ}|[^'\\\\\\\\])'`,\n    EOS: { match: /;\\r?\\n?|[\\r\\n]+/, lineBreaks: true },\n    WHITESPACE: /(?: |\\t)+/,\n    RK_REFERENCE: RegExp(lexer.commands.RK_REFERENCE),\n    ID: { match: RegExp(ID), type: RESERVED_KEYS },\n    DOT: /\\./,\n    ERROR: { match: /[\\$?`]/, error: true },\n  };\n  Object.entries(lexerRules).forEach(([key, _]) => (rules[key] = key));\n  const moolexer = moo.compile(lexerRules);\n  return new IVProgLexer(RKs, moolexer, rules as unknown as I18N_LEXER_RULES, lexer);\n}\n","import {\n  I18N_LEXER_TYPES,\n  I18N_LEXER_COMMANDS,\n  I18N_LEXER_BOOLVAL,\n  I18N_LEXER_LOGICOP,\n  makeLexer,\n  I18N_LANG_LIBS,\n  I18N_LANG_FUNCS,\n} from \"../lexer\";\n\n// i18n lexer strings for the language.\nconst types: I18N_LEXER_TYPES = {\n  // types\n  RK_REAL: \"real\",\n  RK_INTEGER: \"inteiro\",\n  RK_BOOLEAN: \"logico\",\n  RK_CHARACTER: \"caractere\",\n  RK_STRING: \"cadeia\",\n};\nconst commands: I18N_LEXER_COMMANDS = {\n  // RK_VOID is not formally part of Types since it doesn't have a valid value/instance\n  RK_VOID: \"vazio\",\n  // commands\n  RK_PROGRAM: \"programa\",\n  RK_SWITCH: \"escolha\",\n  RK_CASE: \"caso\",\n  RK_DEFAULT: \"contrario\",\n  RK_CONST: \"const\",\n  RK_FUNCTION: \"funcao\",\n  RK_RETURN: \"devolva\",\n  RK_FOR: \"para\",\n  RK_FOR_ALT: \"repita_para\",\n  RK_FOR_FROM: \"de\",\n  RK_FOR_TO: \"ate\",\n  RK_FOR_PASS: \"passo\",\n  RK_BREAK: \"pare\",\n  RK_DO: \"repita\",\n  RK_DO_UNTIL: \"ate_que\",\n  RK_WHILE: \"enquanto\",\n  RK_WHILE_ALT: \"repita_enquanto\",\n  RK_IF: \"se\",\n  RK_ELSE: \"senao\",\n  RK_REFERENCE: \"&\",\n};\nconst boolVal: I18N_LEXER_BOOLVAL = {\n  RK_FALSE: \"falso\",\n  RK_TRUE: \"verdadeiro\",\n};\n\nconst logicOp: I18N_LEXER_LOGICOP = {\n  RK_LOGICAL_NOT: \"nao\",\n  RK_LOGICAL_AND: \"E\",\n  RK_LOGICAL_OR: \"OU\",\n};\n\nconst langLibs: I18N_LANG_LIBS = {\n  $mathLib: \"Matematica\",\n  $ioLib: \"ES\",\n  $strLib: \"Texto\",\n  $arrayLib: \"Arranjo\",\n  $langLib: \"Conversao\",\n};\n\nconst langFuncs: I18N_LANG_FUNCS = {\n  main_function: \"inicio\",\n  $read: \"leia\",\n  $write: \"escreva\",\n  $numElements: \"total_de_elementos\",\n  $matrixLines: \"total_de_linhas\",\n  $matrixColumns: \"total_de_colunas\",\n  $substring: \"subcadeia\",\n  $length: \"comprimento\",\n  $uppercase: \"caixa_alta\",\n  $lowercase: \"caixa_baixa\",\n  $charAt: \"caractere_na_posicao\",\n  $isReal: \"e_real\",\n  $isInt: \"e_inteiro\",\n  $isBool: \"e_logico\",\n  $castReal: \"como_real\",\n  $castInt: \"como_inteiro\",\n  $castBool: \"como_logico\",\n  $castString: \"como_cadeia\",\n  $castChar: \"como_caractere\",\n  $sin: \"seno\",\n  $cos: \"cosseno\",\n  $tan: \"tangente\",\n  $sqrt: \"raiz_quadrada\",\n  $pow: \"potencia\",\n  $log: \"logaritmo\",\n  $abs: \"modulo\",\n  $negate: \"trocar_sinal\",\n  $invert: \"inverter_valor\",\n  $max: \"maximo\",\n  $min: \"minimo\",\n  $rand: \"numero_aleatorio\",\n};\n// END i18n lexer strings\nexport const ptLexer = makeLexer({\n  commands,\n  boolVal,\n  logicOp,\n  types,\n  langLibs,\n  langFuncs,\n});\n","import {\n  I18N_LEXER_TYPES,\n  I18N_LEXER_COMMANDS,\n  I18N_LEXER_BOOLVAL,\n  I18N_LEXER_LOGICOP,\n  makeLexer,\n  I18N_LANG_LIBS,\n  I18N_LANG_FUNCS,\n} from \"../lexer\";\n\n// i18n lexer strings for the language.\nconst types: I18N_LEXER_TYPES = {\n  // types\n  RK_REAL: \"real\",\n  RK_INTEGER: \"int\",\n  RK_BOOLEAN: \"bool\",\n  RK_CHARACTER: \"char\",\n  RK_STRING: \"string\",\n};\nconst commands: I18N_LEXER_COMMANDS = {\n  // RK_VOID is not formally part of Types since it doesn't have a valid value/instance\n  RK_VOID: \"vazio\",\n  // commands\n  RK_PROGRAM: \"program\",\n  RK_SWITCH: \"switch\",\n  RK_CASE: \"case\",\n  RK_DEFAULT: \"otherwise\",\n  RK_CONST: \"const\",\n  RK_FUNCTION: \"function\",\n  RK_RETURN: \"return\",\n  RK_FOR: \"for\",\n  RK_FOR_ALT: \"repeat_for\",\n  RK_FOR_FROM: \"from\",\n  RK_FOR_TO: \"to\",\n  RK_FOR_PASS: \"pass\",\n  RK_BREAK: \"break\",\n  RK_DO: \"repeat\",\n  RK_DO_UNTIL: \"until\",\n  RK_WHILE: \"while\",\n  RK_WHILE_ALT: \"repeat_while\",\n  RK_IF: \"if\",\n  RK_ELSE: \"else\",\n  RK_REFERENCE: \"&\",\n};\nconst boolVal: I18N_LEXER_BOOLVAL = {\n  RK_FALSE: \"false\",\n  RK_TRUE: \"true\",\n};\n\nconst logicOp: I18N_LEXER_LOGICOP = {\n  RK_LOGICAL_NOT: \"not\",\n  RK_LOGICAL_AND: \"AND\",\n  RK_LOGICAL_OR: \"OR\",\n};\n\nconst langLibs: I18N_LANG_LIBS = {\n  $mathLib: \"Mathematics\",\n  $ioLib: \"IO\",\n  $strLib: \"Text\",\n  $arrayLib: \"Array\",\n  $langLib: \"Conversion\",\n};\n\nconst langFuncs: I18N_LANG_FUNCS = {\n  main_function: \"main\",\n  $read: \"read\",\n  $write: \"write\",\n  $numElements: \"total_of_elements\",\n  $matrixLines: \"total_of_lines\",\n  $matrixColumns: \"total_of_columns\",\n  $substring: \"substring\",\n  $length: \"length\",\n  $uppercase: \"uppercase\",\n  $lowercase: \"lowercase\",\n  $charAt: \"char_at\",\n  $isReal: \"is_real\",\n  $isInt: \"is_integer\",\n  $isBool: \"is_logic\",\n  $castReal: \"to_real\",\n  $castInt: \"to_integer\",\n  $castBool: \"to_logic\",\n  $castString: \"to_string\",\n  $castChar: \"to_char\",\n  $sin: \"sin\",\n  $cos: \"cos\",\n  $tan: \"tan\",\n  $sqrt: \"sqrt\",\n  $pow: \"pow\",\n  $log: \"log\",\n  $abs: \"abs\",\n  $negate: \"negate\",\n  $invert: \"invert\",\n  $max: \"maximum\",\n  $min: \"minimum\",\n  $rand: \"random\",\n};\n// END i18n lexer strings\nexport const enLexer = makeLexer({\n  commands,\n  boolVal,\n  logicOp,\n  types,\n  langLibs,\n  langFuncs,\n});\n","import { ptLexer as pt } from \"./pt/ivprog\";\nimport { enLexer as en } from \"./en/ivprog\";\nimport { IVProgLexer } from \"./lexer\";\n/*import * as ES from \"./es/ivprog.g4\";\nimport ESFuncs from \"./es/langFunctions\";\nimport ESLibs from \"./es/langLibs\";*/\nconst lexers: Record<string, IVProgLexer> = {};\nlexers[\"pt\"] = pt;\nlexers[\"en\"] = en;\n\nexport default lexers;\n","declare const iLMparameters: any; // Tell Typescript iLMparameters is a global\n\nimport Lexers from \"./../../grammar/\";\nimport line_i18n from \"line-i18n\";\nimport { Config } from \"./../util/config\";\nimport {\n  IVProgLexer,\n  I18N_LANG_FUNCS,\n  I18N_LANG_LIBS,\n} from \"../../grammar/lexer\";\n\nclass LanguageServiceExtended extends line_i18n.LanguageServiceNoLS {\n  constructor () {\n    super(\n      typeof iLMparameters === \"undefined\"\n        ? Config.default_lang\n        : iLMparameters.lang\n    );\n  }\n\n  getDefaultLang (): string {\n    return \"en\";\n  }\n\n  getCurrentLexer (): IVProgLexer {\n    const langLexer = Lexers[this.getLang()];\n    if (langLexer === null || langLexer === undefined) {\n      return Lexers[this.getDefaultLang()];\n    } else {\n      return langLexer;\n    }\n  }\n\n  getCurrentLangFuncs (): I18N_LANG_FUNCS {\n    const langInfo = Lexers[this.getLang()];\n    if (langInfo === null || langInfo === undefined) {\n      return Lexers[this.getDefaultLang()].getLangFuncs();\n    } else {\n      return langInfo.getLangFuncs();\n    }\n  }\n\n  getCurrentLangLibs (): I18N_LANG_LIBS {\n    const langInfo = Lexers[this.getLang()];\n    if (langInfo === null || langInfo === undefined) {\n      return Lexers[this.getDefaultLang()].getLangLibs();\n    }\n    return langInfo.getLangLibs();\n  }\n}\n\nexport const LanguageService = new LanguageServiceExtended();\n","export class Command {\n\n  constructor () {\n    this._sourceInfo = null;\n  }\n\n  set sourceInfo (sourceInfo) {\n    this._sourceInfo = sourceInfo;\n  }\n\n  get sourceInfo () {\n    return this._sourceInfo;\n  }\n}\n","import { Command } from './command';\n\nexport class Break extends Command {\n\n  constructor () {\n    super();\n  }\n}\n","import { Command } from './command';\n\nexport class Return extends Command {\n\n  constructor(expression) {\n    super();\n    this.expression = expression;\n  }\n  \n}","import { Command } from './command';\n\nexport class Assign extends Command {\n  \n  constructor (id, expression) {\n    super();\n    this.id = id;\n    this.expression = expression;\n  }\n}","import { Assign } from './assign';\n\nexport class ArrayIndexAssign extends Assign {\n\n  constructor (id, lineExpression, columnExpression, expression) {\n    super(id, expression);\n    this.line = lineExpression;\n    this.column = columnExpression;\n  }\n}\n","import { Command } from './command';\n\nexport class Declaration extends Command {\n  \n  constructor (id, type, initial, isConst) {\n    super();\n    this.id = id;\n    this.type = type;\n    this.initial = initial;\n    this.isConst = isConst;\n  }\n}\n","import { Declaration } from './declaration';\n\nexport class ArrayDeclaration extends Declaration {\n\n  constructor (id, type, lines, columns, initial, isConst)   {\n    super(id, type, initial, isConst);\n    this.lines = lines;\n    this.columns = columns;\n  }\n\n  get isVector () {\n    return this.columns == null;\n  }\n}","import { Command } from './command';\n\nexport class While extends Command {\n\n  constructor (expression, commandBlock) {\n    super();\n    this.expression = expression;\n    this.commandBlock = commandBlock;\n  }\n\n  get commands () {\n    return this.commandBlock.commands;\n  }\n\n  get testFirst () {\n  \treturn true;\n  }\n}","import { Command } from './command';\n\nexport class For extends Command {\n\n  constructor (for_id, for_from, for_to, for_pass, commandBlock) {\n    super();\n    this.for_id = for_id;\n    this.for_from = for_from;\n    this.for_to = for_to;\n    this.for_pass = for_pass;\n    this.commandBlock = commandBlock;\n  }\n\n  get commands () {\n    return this.commandBlock.commands;\n  }\n}","import { IType } from \"./itype\";\n\nexport class Type implements IType {\n  public value: string;\n  public ord: number;\n\n  constructor (value: string, ord: number) {\n    this.value = value;\n    this.ord = ord;\n  }\n\n  stringInfo (): object[] {\n    return [{ type: this.value, dim: 0 }];\n  }\n\n  isCompatible (another: IType): boolean {\n    return this.value === another.value && this.ord === another.ord;\n  }\n}\n","import { Type } from \"./type\";\nimport { IType } from \"./itype\";\n\nexport class MultiType implements IType {\n\n  constructor (public types: Type[]) {\n  }\n\n  get value (): undefined {\n    return undefined;\n  }\n\n  get ord (): undefined {\n    return undefined;\n  }\n\n  stringInfo (): object[] {\n    let list: object[] = [];\n    for (let i = 0; i < this.types.length; i++) {\n      const t = this.types[i];\n      list = list.concat(t.stringInfo());\n    }\n    return list;\n  }\n\n  isCompatible (another: Type): boolean {\n    for (let i = 0; i < this.types.length; i++) {\n      const t = this.types[i];\n      if (another.isCompatible(t)) {\n        return true;\n      }\n    }\n    return false;\n  }\n}\n","import { Type } from \"./type\";\nimport { MultiType } from \"./multiType\";\nimport { IType } from \"./itype\";\nimport { Maybe } from \"../util/maybe\";\n\nconst INTEGER = new Type(\"integer\", 0);\nconst REAL = new Type(\"real\", 1);\nconst STRING = new Type(\"text\", 2);\nconst BOOLEAN = new Type(\"boolean\", 3);\nconst CHAR = new Type(\"char\", 4);\nconst VOID = new Type(\"void\", 5);\nconst UNDEFINED = new Type(\"undefined\", 6);\nconst ALL = new MultiType([INTEGER, REAL, STRING, CHAR, BOOLEAN]);\n\ninterface TypeMap {\n  [key: string]: IType;\n}\n\nexport const Types = Object.freeze({\n  INTEGER: INTEGER,\n  REAL: REAL,\n  STRING: STRING,\n  CHAR: CHAR,\n  BOOLEAN: BOOLEAN,\n  VOID: VOID,\n  UNDEFINED: UNDEFINED,\n  ALL: ALL\n});\n\nexport function fromOrdToType (ord: number): Maybe<IType> {\n  const typeMap = Types as TypeMap;\n  for (const t in typeMap) {\n    if (typeMap[t].ord && typeMap[t].ord === ord){\n      return Maybe.some<IType>(typeMap[t]);\n    }\n  }\n  return Maybe.none<IType>();\n}\n","import { Types } from './../../typeSystem/types';\n\nexport class Function {\n\n  /**\n   * \n   * @param {string} name \n   * @param {import('./../../typeSystem/itype').IType} returnType \n   * @param {import('./formalParameter').FormalParameter[]} formalParameters \n   * @param {import('./commandBlock').CommandBlock} commandBlock \n   */\n  constructor (name, returnType, formalParameters, commandBlock) {\n    this.name = name;\n    this.returnType = returnType;\n    this.formalParameters = formalParameters;\n    this.commandBlock = commandBlock;\n    this._sourceInfo = null;\n  }\n\n  get isMain () {\n    return this.name === null && this.returnType.isCompatible(Types.VOID);\n  }\n\n  get commands () {\n    return this.commandBlock.commands;\n  }\n\n  get variablesDeclarations () {\n    return this.commandBlock.variables;\n  }\n\n  set sourceInfo (sourceInfo) {\n\t\tthis._sourceInfo = sourceInfo;\n\t}\n\n\tget sourceInfo () {\n\t\treturn this._sourceInfo;\n  }\n  \n  hasVariadic () {\n    return this.formalParameters.some( p => p.variadic);\n  }\n}","import { Command } from './command';\n\nexport class IfThenElse extends Command {\n\n  constructor (condition, ifTrue, ifFalse) {\n    super();\n    this.condition = condition;\n    this.ifTrue = ifTrue;\n    this.ifFalse = ifFalse;\n  }\n}","export class CommandBlock {\n\t\n\tconstructor(variables, commands) {\n\t\tthis.variables = variables;\n\t\tthis.commands = commands;\n\t\tthis._sourceInfo = null;\n\t}\n\n\tset sourceInfo (sourceInfo) {\n\t\tthis._sourceInfo = sourceInfo;\n\t}\n\n\tget sourceInfo () {\n\t\treturn this._sourceInfo;\n\t}\n}","import { While } from './while';\n\nexport class RepeatUntil extends While {\n\n  constructor(condition, commandBlock) {\n    super(condition, commandBlock);\n  }\n\n  get testFirst () {\n    return false;\n  }\n  \n}","export class Expression {\n\n  constructor () {\n\t\tthis._sourceInfo = null;\n\t\tthis._parenthesis = false;\n  }\n\n  set sourceInfo (sourceInfo) {\n\t\tthis._sourceInfo = sourceInfo;\n\t}\n\n\tget sourceInfo () {\n\t\treturn this._sourceInfo;\n\t}\n\n\tset parenthesis (flag) {\n\t\tthis._parenthesis = flag;\n\t}\n\n\tget parenthesis () {\n\t\treturn this._parenthesis;\n\t}\n}","import { Command } from './command';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Expression } from '../expressions/expression';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Case } from '.';\n\nexport class Switch extends Command {\n  \n  /**\n   * \n   * @param {Expression} expression \n   * @param {Case[]} cases \n   */\n  constructor (expression, cases) {\n    super();\n    this.expression = expression;\n    this.cases = cases;\n  }\n}","import { Command } from './command';\n\nexport class Case extends Command {\n\n  constructor (expression) {\n    super();\n    this.expression = expression;\n    /**\n     * @type {Command[]}\n     */\n    this.commands = [];\n  }\n\n  /**\n   * \n   * @param {Command[]} commands \n   */\n  setCommands (commands) {\n    this.commands = commands;\n  }\n\n  get isDefault () {\n    return this.expression === null;\n  }\n}","/**\n * This class represents all the language defined functions.\n * The language processor uses the id provided here to properly execute the desired function.\n * The function is actually implemented inside the language processor.\n * All the functions can be found at: js/processor/definedFunctions.js\n */\nexport class SysCall {\n\n  constructor (langFunc) {\n    this.langFunc = langFunc;\n  }\n}","export class FormalParameter {\n\n  constructor (type, id, byRef = false, variadic = false) {\n    this.type = type;\n    this.id = id;\n    this.byRef = byRef;\n    this.variadic = variadic;\n    this._sourceInfo = null;\n  }\n\n  set sourceInfo (sourceInfo) {\n\t\tthis._sourceInfo = sourceInfo;\n\t}\n\n\tget sourceInfo () {\n\t\treturn this._sourceInfo;\n\t}\n}","import { Expression } from './expression';\nimport { LanguageDefinedFunction } from '../../processor/definedFunctions';\n\nexport class FunctionCall extends Expression {\n\n\t/**\n\t * \n\t * @param {string} id \n\t * @param {Expression[]} actualParameters \n\t */\n\tconstructor (id, actualParameters) {\n\t\tsuper();\n\t\tthis.id = id;\n\t\tthis.actualParameters = actualParameters;\n\t}\n\n\tget isMainCall () {\n\t\treturn this.id === null;\n\t}\n\n\tget parametersSize () {\n\t\treturn this.actualParameters.length;\n\t}\n\n\ttoString () {\n\t\tlet name = null;\n\t\tif(this.isMainCall) {\n\t\t\tname = LanguageDefinedFunction.getMainFunctionName();\n\t\t} else {\n\t\t\tname = LanguageDefinedFunction.getLocalName(this.id);\n\t\t}\n\t\tlet params = null;\n\t\tif(this.actualParameters.length == 0) {\n\t\t\tparams = \"()\";\n\t\t} else {\n\t\t\tconst strParams = this.actualParameters.map(v => v.toString());\n\t\t\tparams = \"(\" + strParams.join(\",\") + \")\";\n\t\t}\n\t\tif(this.parenthesis) {\n\t\t\treturn `(${name + params})`;\n\t\t} else {\n\t\t\treturn name + params;\n\t\t}\n\t}\n}","export const Modes = Object.freeze({\n  RETURN: Symbol('mode:return'),\n  BREAK: Symbol('mode:break'),\n  PAUSE: Symbol('mode:pause'),\n  RUN: Symbol('mode:run'),\n  ABORT: Symbol('mode:abort')\n});","import { LanguageService } from \"../services/languageService\";\nimport { Types } from \"./types\";\nimport Decimal from \"decimal.js\";\nimport { Config } from \"../util/config\";\n\nexport function toInt (str) {\n  return new Decimal(str);\n}\n\nexport function toString (str) {\n  let value = str.replace(/^\"/, \"\");\n  value = value.replace(/\"$/, \"\");\n  value = value.replace(/\\\\b/g, \"\\b\");\n  value = value.replace(/\\\\t/g, \"\\t\");\n  value = value.replace(/\\\\n/g, \"\\n\");\n  value = value.replace(/\\\\r/g, \"\\r\");\n  value = value.replace(/\\\\\"/g, '\"');\n  value = value.replace(/\\\\'/g, \"'\");\n  value = value.replace(/\\\\\\\\/g, \"\\\\\");\n  return value;\n}\n\nexport function toChar (str) {\n  //console.debug(str, str.length);\n  let value = str.replace(/^'/, \"\");\n  value = value.replace(/'$/, \"\");\n  value = value.replace(/\\\\b/g, \"\\b\");\n  value = value.replace(/\\\\t/g, \"\\t\");\n  value = value.replace(/\\\\n/g, \"\\n\");\n  value = value.replace(/\\\\r/g, \"\\r\");\n  value = value.replace(/\\\\\"/g, '\"');\n  value = value.replace(/\\\\'/g, \"'\");\n  value = value[0];\n  return value;\n}\n\nexport function toReal (value) {\n  return new Decimal(value);\n}\n\nexport function toBool (str) {\n  const val = str;\n  const lexer = LanguageService.getCurrentLexer();\n  if (lexer.getReservedKeys()[lexer.getRules().RK_TRUE] === val) {\n    return true;\n  } else if (lexer.getReservedKeys()[lexer.getRules().RK_FALSE] === val) {\n    return false;\n  } else {\n    // TODO: better error message\n    throw new Error(str + \"not a valid boolean\");\n  }\n}\n\nexport function convertBoolToString (bool) {\n  const lexer = LanguageService.getCurrentLexer();\n  let result = null;\n  if (bool) {\n    result = lexer.getReservedKeys()[lexer.getRules().RK_TRUE];\n  } else {\n    result = lexer.getReservedKeys()[lexer.getRules().RK_FALSE];\n  }\n  //console.debug(result)\n  return result.replace(/'/g, \"\");\n}\n\nexport function convertToString (value, type) {\n  switch (type.ord) {\n    case Types.INTEGER.ord:\n      return value.toString();\n    case Types.REAL.ord: {\n      if (value.dp() <= 0) {\n        return value.toFixed(1);\n      } else {\n        return value.toFixed(Config.decimalPlaces);\n      }\n    }\n    case Types.BOOLEAN.ord:\n      return convertBoolToString(value);\n    default:\n      return value;\n  }\n}\n\n","export class RuntimeError extends Error {\n  constructor (msg, id) {\n    super(msg);\n    this.id = id;\n    this._context = {};\n    if (Error.captureStackTrace) Error.captureStackTrace(this, RuntimeError);\n  }\n\n  get context () {\n    return this._context;\n  }\n\n  set context (contextObj) {\n    this._context = contextObj;\n  }\n}\n","export class SemanticError extends Error {\n  constructor (msg, id) {\n    super(msg);\n    this.id = id;\n    this._context = {};\n    if (Error.captureStackTrace) Error.captureStackTrace(this, SemanticError);\n  }\n\n  get context () {\n    return this._context;\n  }\n\n  set context (contextObj) {\n    this._context = contextObj;\n  }\n}\n","import { RuntimeError } from \"./runtimeError\";\nimport { SemanticError } from \"./semanticError\";\nimport * as LocalizedStringsService from \"./../../services/localizedStringsService\";\nimport { LanguageDefinedFunction } from \"../definedFunctions\";\n\nfunction createRuntimeError (i18n_id, context = []) {\n  const LocalizedStrings = LocalizedStringsService.getInstance();\n  return new RuntimeError(LocalizedStrings.getError(i18n_id, context), i18n_id);\n}\n\nfunction createSemanticError (i18n_id, context = []) {\n  const LocalizedStrings = LocalizedStringsService.getInstance();\n  return new SemanticError(\n    LocalizedStrings.getError(i18n_id, context),\n    i18n_id\n  );\n}\n\nexport const ProcessorErrorFactory = Object.freeze({\n  symbol_not_found_full: (id, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [id, sourceInfo.line, sourceInfo.column];\n      const error = createSemanticError(\"symbol_not_found_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.symbol_not_found(id);\n    }\n  },\n  symbol_not_found: (id) => {\n    const context = [id];\n    return createSemanticError(\"symbol_not_found\", context);\n  },\n  function_missing_full: (id, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [id, sourceInfo.line, sourceInfo.column];\n      const error = createSemanticError(\"function_missing_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.function_missing(id);\n    }\n  },\n  function_missing: (id) => {\n    const context = [id];\n    return createSemanticError(\"function_missing\", context);\n  },\n  main_missing: () => {\n    return createSemanticError(\"main_missing\");\n  },\n  array_dimension_not_int_full: (sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line];\n      const error = createSemanticError(\n        \"array_dimension_not_int_full\",\n        context\n      );\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.array_dimension_not_int();\n    }\n  },\n  array_dimension_not_int: () => {\n    return createSemanticError(\"array_dimension_not_int\");\n  },\n  unknown_command_full: (sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line];\n      const error = createRuntimeError(\"unknown_command_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.unknown_command();\n    }\n  },\n  unknown_command: () => {\n    return createRuntimeError(\"unknown_command\");\n  },\n  incompatible_types_full: (\n    left_type,\n    left_dim,\n    right_type,\n    right_dim,\n    exp,\n    source_info\n  ) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    if (source_info) {\n      const context = [\n        LocalizedStrings.translateType(left_type, left_dim),\n        exp,\n        source_info.line,\n        LocalizedStrings.translateType(right_type, right_dim),\n      ];\n      const error = createSemanticError(\"incompatible_types_full\", context);\n      error.context = { line: source_info.line, column: source_info.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.incompatible_types(\n        left_type,\n        left_dim,\n        right_type,\n        right_dim,\n        exp\n      );\n    }\n  },\n  incompatible_types: (left_type, left_dim, right_type, right_dim, exp) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    const context = [\n      LocalizedStrings.translateType(left_type, left_dim),\n      exp,\n      LocalizedStrings.translateType(right_type, right_dim),\n    ];\n    return createSemanticError(\"incompatible_types\", context);\n  },\n  incompatible_types_array_full: (exp, type, dim, sourceInfo) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    if (sourceInfo) {\n      const context = [\n        exp,\n        LocalizedStrings.translateType(type, dim),\n        sourceInfo.line,\n        sourceInfo.column,\n      ];\n      const error = createSemanticError(\n        \"incompatible_types_array_full\",\n        context\n      );\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.incompatible_types_array(exp, type, dim);\n    }\n  },\n  incompatible_types_array: (exp, type, dim) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    const context = [exp, LocalizedStrings.translateType(type, dim)];\n    return createSemanticError(\"incompatible_types_array\", context);\n  },\n  loop_condition_type_full: (exp, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line, sourceInfo.column, exp];\n      const error = createSemanticError(\"loop_condition_type_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.loop_condition_type(exp);\n    }\n  },\n  loop_condition_type: (exp) => {\n    const context = [exp];\n    return createSemanticError(\"loop_condition_type\", context);\n  },\n  /**\n   * @deprecated 01/10/2019\n   */\n  endless_loop_full: (sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line];\n      const error = createSemanticError(\"endless_loop_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.endless_loop();\n    }\n  },\n  endless_loop: () => {\n    return createSemanticError(\"endless_loop\");\n  },\n  if_condition_type_full: (exp, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line, sourceInfo.column, exp];\n      const error = createSemanticError(\"if_condition_type_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.if_condition_type(exp);\n    }\n  },\n  if_condition_type: (exp) => {\n    const context = [exp];\n    return createSemanticError(\"if_condition_type\", context);\n  },\n  invalid_global_var: () => {\n    return createRuntimeError(\"invalid_global_var\");\n  },\n  not_implemented: (id) => {\n    const context = [id];\n    return createRuntimeError(\"not_implemented\", context);\n  },\n  invalid_case_type_full: (exp, type, dim, sourceInfo) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    if (sourceInfo) {\n      const context = [\n        exp,\n        LocalizedStrings.translateType(type, dim),\n        sourceInfo.line,\n        sourceInfo.column,\n      ];\n      const error = createSemanticError(\"invalid_case_type_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_case_type(exp, type, dim);\n    }\n  },\n  invalid_case_type: (exp, type, dim) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    const context = [exp, LocalizedStrings.translateType(type, dim)];\n    return createSemanticError(\"invalid_case_type\", context);\n  },\n  void_in_expression_full: (id, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line, sourceInfo.column, id];\n      const error = createSemanticError(\"void_in_expression_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.void_in_expression(id);\n    }\n  },\n  void_in_expression: (id) => {\n    const context = [id];\n    return createSemanticError(\"void_in_expression\", context);\n  },\n  invalid_array_access_full: (id, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [id, sourceInfo.line, sourceInfo.column];\n      const error = createSemanticError(\"invalid_array_access_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_array_access(id);\n    }\n  },\n  invalid_array_access: (id) => {\n    const context = [id];\n    return createSemanticError(\"invalid_array_access\", context);\n  },\n  invalid_matrix_access_full: (id, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [id, sourceInfo.line, sourceInfo.column];\n      const error = createSemanticError(\"invalid_matrix_access_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_matrix_access(id);\n    }\n  },\n  invalid_matrix_access: (id) => {\n    const context = [id];\n    return createSemanticError(\"invalid_matrix_access\", context);\n  },\n  matrix_column_outbounds_full: (id, value, columns, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line, value, id, columns];\n      const error = createRuntimeError(\"matrix_column_outbounds_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.matrix_column_outbounds(id, value, columns);\n    }\n  },\n  matrix_column_outbounds: (id, value, columns) => {\n    const context = [value, id, columns];\n    return createRuntimeError(\"matrix_column_outbounds\", context);\n  },\n  matrix_line_outbounds_full: (id, value, lines, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line, value, id, lines];\n      const error = createRuntimeError(\"matrix_line_outbounds_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.matrix_line_outbounds(id, value, lines);\n    }\n  },\n  matrix_line_outbounds: (id, value, lines) => {\n    const context = [value, id, lines];\n    return createRuntimeError(\"matrix_line_outbounds\", context);\n  },\n  vector_line_outbounds_full: (id, value, lines, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line, value, id, lines];\n      const error = createRuntimeError(\"vector_line_outbounds_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.vector_line_outbounds(id, value, lines);\n    }\n  },\n  vector_line_outbounds: (id, value, lines) => {\n    const context = [value, id, lines];\n    return createRuntimeError(\"vector_line_outbounds\", context);\n  },\n  vector_not_matrix_full: (id, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line, id];\n      const error = createRuntimeError(\"vector_not_matrix_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.vector_not_matrix(id);\n    }\n  },\n  vector_not_matrix: (id) => {\n    const context = [id];\n    return createRuntimeError(\"vector_not_matrix\", context);\n  },\n  function_no_return: (id) => {\n    const context = [id];\n    return createSemanticError(\"function_no_return\", context);\n  },\n  invalid_void_return_full: (id, type, dim, sourceInfo) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    if (sourceInfo) {\n      const context = [\n        sourceInfo.line,\n        id,\n        LocalizedStrings.translateType(type, dim),\n      ];\n      const error = createSemanticError(\"invalid_void_return_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_void_return(id, type, dim);\n    }\n  },\n  invalid_void_return: (id, type, dim) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    const context = [id, LocalizedStrings.translateType(type, dim)];\n    return createSemanticError(\"invalid_void_return_full\", context);\n  },\n  invalid_return_type_full: (id, type, dim, sourceInfo) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n\n    if (sourceInfo) {\n      const context = [\n        sourceInfo.line,\n        id,\n        LocalizedStrings.translateType(type, dim),\n      ];\n      const error = createSemanticError(\"invalid_return_type_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_return_type(id, type, dim);\n    }\n  },\n  invalid_return_type: (id, type, dim) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    const context = [id, LocalizedStrings.translateType(type, dim)];\n    return createSemanticError(\"invalid_return_type\", context);\n  },\n  invalid_parameters_size_full: (id, expected, actual, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line, id, expected, actual];\n      const error = createSemanticError(\n        \"invalid_parameters_size_full\",\n        context\n      );\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_parameters_size(\n        id,\n        expected,\n        actual\n      );\n    }\n  },\n  invalid_parameters_size: (id, expected, actual) => {\n    const context = [id, expected, actual];\n    return createSemanticError(\"invalid_parameters_size\", context);\n  },\n  invalid_parameter_type_full: (fun_name, exp, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [\n        exp,\n        LanguageDefinedFunction.getLocalName(fun_name),\n        sourceInfo.line,\n      ];\n      const error = createSemanticError(\"invalid_parameter_type_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_parameter_type(fun_name, exp);\n    }\n  },\n  invalid_parameter_type: (fun_name, exp) => {\n    const context = [exp, LanguageDefinedFunction.getLocalName(fun_name)];\n    return createSemanticError(\"invalid_parameter_type_full\", context);\n  },\n  invalid_ref_full: (id, exp, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [exp, id, sourceInfo.line];\n      const error = createSemanticError(\"invalid_ref_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_ref(id, exp);\n    }\n  },\n  invalid_ref: (id, exp) => {\n    const context = [exp, id];\n    return createSemanticError(\"invalid_ref\", context);\n  },\n  unexpected_break_command_full: (sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line];\n      const error = createRuntimeError(\n        \"unexpected_break_command_full\",\n        context\n      );\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.unexpected_break_command();\n    }\n  },\n  unexpected_break_command: () => {\n    return createRuntimeError(\"unexpected_break_command\");\n  },\n  invalid_array_literal_type_full: (exp, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line, exp];\n      const error = createRuntimeError(\n        \"invalid_array_literal_type_full\",\n        context\n      );\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_array_literal_type(exp);\n    }\n  },\n  invalid_array_literal_type: (exp) => {\n    const context = [exp];\n    return createRuntimeError(\"invalid_array_literal_type\", context);\n  },\n  invalid_array_literal_line_full: (expected, actual, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line, expected, actual];\n      const error = createRuntimeError(\n        \"invalid_array_literal_line_full\",\n        context\n      );\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_array_literal_type(expected, actual);\n    }\n  },\n  invalid_array_literal_line: (expected, actual) => {\n    const context = [expected, actual];\n    return createRuntimeError(\"invalid_array_literal_line\", context);\n  },\n  invalid_array_literal_column_full: (expected, actual, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line, expected, actual];\n      const error = createRuntimeError(\n        \"invalid_array_literal_column_full\",\n        context\n      );\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_array_literal_column(\n        expected,\n        actual\n      );\n    }\n  },\n  invalid_array_literal_column: (expected, actual) => {\n    const context = [expected, actual];\n    return createRuntimeError(\"invalid_array_literal_column\", context);\n  },\n  invalid_unary_op_full: (expString, opName, type, dim, sourceInfo) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    if (sourceInfo) {\n      const context = [\n        sourceInfo.line,\n        expString,\n        LocalizedStrings.translateOp(opName),\n        LocalizedStrings.translateType(type, dim),\n      ];\n      const error = createRuntimeError(\"invalid_unary_op_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_unary_op(opName, type, dim);\n    }\n  },\n  invalid_unary_op: (expString, opName, type, dim) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    const context = [\n      expString,\n      LocalizedStrings.translateOp(opName),\n      LocalizedStrings.translateType(type, dim),\n    ];\n    return createRuntimeError(\"invalid_unary_op\", context);\n  },\n  invalid_infix_op_full: (\n    expString,\n    opName,\n    typeLeft,\n    dimLeft,\n    typeRight,\n    dimRight,\n    sourceInfo\n  ) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    if (sourceInfo) {\n      const context = [\n        sourceInfo.line,\n        expString,\n        LocalizedStrings.translateOp(opName),\n        LocalizedStrings.translateType(typeLeft, dimLeft),\n        LocalizedStrings.translateType(typeRight, dimRight),\n      ];\n      const error = createRuntimeError(\"invalid_infix_op_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_infix_op(\n        opName,\n        typeLeft,\n        dimLeft,\n        typeRight,\n        dimRight\n      );\n    }\n  },\n  invalid_infix_op: (\n    expString,\n    opName,\n    typeLeft,\n    dimLeft,\n    typeRight,\n    dimRight\n  ) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    const context = [\n      expString,\n      LocalizedStrings.translateOp(opName),\n      LocalizedStrings.translateType(typeLeft, dimLeft),\n      LocalizedStrings.translateType(typeRight, dimRight),\n    ];\n    return createRuntimeError(\"invalid_infix_op\", context);\n  },\n  array_dimension_not_positive_full: (sourceInfo) => {\n    if (sourceInfo) {\n      const context = [sourceInfo.line];\n      const error = createSemanticError(\n        \"array_dimension_not_positive_full\",\n        context\n      );\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.array_dimension_not_positive();\n    }\n  },\n  array_dimension_not_positive: () => {\n    return createSemanticError(\"array_dimension_not_positive\");\n  },\n  invalid_type_conversion: (value, type, dim) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n\n    const context = [value, LocalizedStrings.translateType(type, dim)];\n    return createRuntimeError(\"invalid_type_conversion\", context);\n  },\n  invalid_read_type: (exp, type, dim, name, source_info) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    const context = [\n      source_info.line,\n      exp,\n      LocalizedStrings.translateType(type, dim),\n      name,\n    ];\n    const error = createRuntimeError(\"invalid_read_type\", context);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  invalid_read_type_array: (\n    exp,\n    typePos,\n    dimPos,\n    name,\n    typeArray,\n    dimArray,\n    sourceInfo\n  ) => {\n    const LocalizedStrings = LocalizedStringsService.getInstance();\n    const context = [\n      sourceInfo.line,\n      exp,\n      LocalizedStrings.translateType(typePos, dimPos),\n      name,\n      LocalizedStrings.translateType(typeArray, dimArray),\n    ];\n    const error = createRuntimeError(\"invalid_read_type_array\", context);\n    error.context = { line: sourceInfo.line, column: sourceInfo.column };\n    return error;\n  },\n  invalid_const_ref_full: (fun_name, exp, sourceInfo) => {\n    if (sourceInfo) {\n      const context = [\n        exp,\n        LanguageDefinedFunction.getLocalName(fun_name),\n        sourceInfo.line,\n      ];\n      const error = createSemanticError(\"invalid_const_ref_full\", context);\n      error.context = { line: sourceInfo.line, column: sourceInfo.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_const_ref(fun_name, exp);\n    }\n  },\n  invalid_const_ref: (fun_name, exp) => {\n    const context = [exp, LanguageDefinedFunction.getLocalName(fun_name)];\n    const error = createSemanticError(\"invalid_const_ref\", context);\n    return error;\n  },\n  invalid_const_assignment_full: (var_id, source_info) => {\n    if (source_info) {\n      const context = [source_info.line, var_id];\n      const error = createSemanticError(\n        \"invalid_const_assignment_full\",\n        context\n      );\n      error.context = { line: source_info.line, column: source_info.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_const_assignment(var_id);\n    }\n  },\n  invalid_const_assignment: (var_id) => {\n    const context = [var_id];\n    return createSemanticError(\"invalid_const_assignment\", context);\n  },\n  invalid_vector_assignment_full: (\n    left_id,\n    left_size,\n    right_id,\n    right_size,\n    source_info\n  ) => {\n    if (source_info) {\n      const context = [\n        source_info.line,\n        left_id,\n        left_size,\n        right_id,\n        right_size,\n      ];\n      const error = createRuntimeError(\n        \"invalid_vector_assignment_full\",\n        context\n      );\n      error.context = { line: source_info.line, column: source_info.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_vector_assignment(\n        left_id,\n        left_size,\n        right_id,\n        right_size\n      );\n    }\n  },\n  invalid_vector_assignment: (left_id, left_size, right_id, right_size) => {\n    const context = [left_id, left_size, right_id, right_size];\n    return createRuntimeError(\"invalid_vector_assignment\", context);\n  },\n  invalid_matrix_assignment_full: (\n    left_id,\n    left_line,\n    left_column,\n    right_id,\n    right_line,\n    right_column,\n    source_info\n  ) => {\n    if (source_info) {\n      const context = [\n        source_info.line,\n        left_id,\n        left_line,\n        left_column,\n        right_id,\n        right_line,\n        right_column,\n      ];\n      const error = createRuntimeError(\n        \"invalid_matrix_assignment_full\",\n        context\n      );\n      error.context = { line: source_info.line, column: source_info.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_matrix_assignment(\n        left_id,\n        left_line,\n        left_column,\n        right_id,\n        right_line,\n        right_column\n      );\n    }\n  },\n  invalid_matrix_assignment: (\n    left_id,\n    left_line,\n    left_column,\n    right_id,\n    right_line,\n    right_column\n  ) => {\n    const context = [\n      left_id,\n      left_line,\n      left_column,\n      right_id,\n      right_line,\n      right_column,\n    ];\n    return createRuntimeError(\"invalid_matrix_assignment\", context);\n  },\n  matrix_to_vector_attr: (left_id, right_id, source_info) => {\n    // SourceInfo have to be valid...\n    const context = [source_info.line, right_id, left_id];\n    const error = createSemanticError(\"matrix_to_vector_attr\", context);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  vector_to_matrix_attr: (left_id, right_id, source_info) => {\n    // SourceInfo have to be valid...\n    const context = [source_info.line, right_id, left_id];\n    const error = createSemanticError(\"vector_to_matrix_attr\", context);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  invalid_matrix_index_assign_full: (\n    mat_id,\n    mat_line,\n    mat_size,\n    exp,\n    exp_size,\n    source_info\n  ) => {\n    if (source_info) {\n      const context = [\n        source_info.line,\n        mat_line,\n        mat_id,\n        mat_size,\n        exp,\n        exp_size,\n      ];\n      const error = createRuntimeError(\n        \"invalid_matrix_index_assign_full\",\n        context\n      );\n      error.context = { line: source_info.line, column: source_info.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.invalid_matrix_index_assign(\n        mat_id,\n        mat_line,\n        mat_size,\n        exp,\n        exp_size\n      );\n    }\n  },\n  invalid_matrix_index_assign: (mat_id, mat_line, mat_size, exp, exp_size) => {\n    const context = [mat_line, mat_id, mat_size, exp, exp_size];\n    return createRuntimeError(\"invalid_matrix_index_assign\", context);\n  },\n  invalid_number_elements_vector: (\n    expected_num,\n    exp,\n    actual_num,\n    source_info\n  ) => {\n    // SourceInfo have to be valid...\n    const context = [expected_num, source_info.line, exp, actual_num];\n    const error = createRuntimeError(\"invalid_number_elements_vector\", context);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  invalid_number_lines_matrix: (expected_num, exp, actual_num, source_info) => {\n    // SourceInfo have to be valid...\n    const context = [expected_num, source_info.line, exp, actual_num];\n    const error = createRuntimeError(\"invalid_number_lines_matrix\", context);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  divsion_by_zero_full: (exp, source_info) => {\n    if (source_info) {\n      const context = [source_info.line, exp];\n      const error = createRuntimeError(\"divsion_by_zero_full\", context);\n      error.context = { line: source_info.line, column: source_info.column };\n      return error;\n    } else {\n      return ProcessorErrorFactory.divsion_by_zero(exp);\n    }\n  },\n  divsion_by_zero: (exp) => {\n    const context = [exp];\n    return createRuntimeError(\"divsion_by_zero\", context);\n  },\n  undefined_tanget_value: (value, source_info) => {\n    const context = [source_info.line, value];\n    const error = createRuntimeError(\"undefined_tanget_value\", context);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  negative_log_value: (source_info) => {\n    const error = createRuntimeError(\"negative_log_value\", [source_info.line]);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  invalid_string_index: (index, str, source_info) => {\n    const local_fun_name = LanguageDefinedFunction.getLocalName(\"$charAt\");\n    const context = [\n      source_info.line,\n      local_fun_name,\n      index,\n      str,\n      str.length - 1,\n    ];\n    const error = createRuntimeError(\"invalid_string_index\", context);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  negative_sqrt_value: (source_info) => {\n    const error = createRuntimeError(\"negative_sqrt_value\", [source_info.line]);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  /**\n   * @deprecated 01/10/2019\n   */\n  exceeded_recursive_calls: (source_info) => {\n    const context = [source_info.line];\n    const error = createRuntimeError(\"exceeded_recursive_calls\", context);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  invalid_for_variable: (id, source_info) => {\n    const context = [source_info.line, id];\n    const error = createSemanticError(\"invalid_for_variable\", context);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  invalid_for_from: (exp, source_info) => {\n    const context = [source_info.line, exp];\n    const error = createSemanticError(\"invalid_for_from\", context);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  invalid_for_to: (exp, source_info) => {\n    const context = [source_info.line, exp];\n    const error = createSemanticError(\"invalid_for_to\", context);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  invalid_for_pass: (exp, source_info) => {\n    const context = [source_info.line, exp];\n    const error = createSemanticError(\"invalid_for_pass\", context);\n    error.context = { line: source_info.line, column: source_info.column };\n    return error;\n  },\n  exceed_max_instructions: () => {\n    return createRuntimeError(\"exceed_max_instructions\");\n  },\n});\n\n","import { IStoreValue } from \"./istore_value\";\nimport { IType } from \"../../../typeSystem/itype\";\n\nexport class StoreValue implements IStoreValue {\n  \n  public type: IType;\n  public id?: String;\n  public isConst: boolean;\n  public value: any;\n\n  constructor(type: IType, value: any, id?:String, isConst = false) {\n    this.type = type;\n    this.id = id;\n    this.isConst = isConst\n    this.value = value;\n  }\n\n  get (): any {\n    return this.value;\n  }\n\n  inStore () {\n    return this.id != null;\n  }\n\n}","import { IType } from \"./itype\";\nimport { Type } from \"./type\";\n\nexport class ArrayType implements IType {\n\n  public innerType: IType;\n\n  constructor (type: Type, public dimensions: number) {\n    this.innerType = type;\n  }\n\n  get isVector (): boolean {\n    return this.dimensions == 1;\n  }\n\n  isCompatible (another: IType): boolean {\n    if(another instanceof ArrayType){\n      if(this.dimensions !== another.dimensions) {\n        return false;\n      }\n      return this.innerType.isCompatible(another.innerType);\n    }\n    return false;\n  }\n\n  stringInfo (): object[] {\n    const list = this.innerType.stringInfo();\n    list.forEach(v => {\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      const tmp = v as any;\n      tmp.dim = this.dimensions;\n    });\n    return list;\n  }\n\n  get value (): undefined {\n    return undefined;\n  }\n\n  get ord (): undefined {\n    return undefined;\n  }\n\n  canAccept (another: IType, used_dims: number): boolean {\n    const free_dims = this.dimensions - used_dims;\n    if(another instanceof ArrayType) {\n      return free_dims == another.dimensions && this.innerType.isCompatible(another.innerType);\n    } else {\n      return free_dims == 0 && this.innerType.isCompatible(another);\n    }\n  }\n}\n","import { Expression } from './expression';\n\nexport class ArrayAccess extends Expression {\n\t\n\tconstructor (id, line, column) {\n\t\tsuper();\n\t\tthis.id = id;\n\t\tthis.line = line;\n\t\tthis.column = column;\n\t}\n\n\ttoString () {\n\t\tconst strLine = this.line.toString();\n\t\tlet strColumn = null;\n\t\tif(this.column) {\n\t\t\tstrColumn = this.column.toString();\n\t\t}\n\t\tlet text = null;\n\t\tif(strColumn) {\n\t\t\ttext = `${this.id}[${strLine}][${strColumn}]`;\n\t\t} else {\n\t\t\ttext = `${this.id}[${strLine}]`;\n\t\t}\n\t\tif(this.parenthesis ){\n\t\t\treturn `(${text})`\n\t\t} else {\n\t\t\treturn text;\n\t\t}\n\t}\n}","import { Expression } from './expression';\n\nexport class Literal extends Expression {\n  \n  constructor (type) {\n    super();\n    this.type = type;\n  }\n}","import { Literal } from './literal';\nimport { Types } from './../../typeSystem/types';\nimport { convertToString } from './../../typeSystem/parsers';\n\nexport class IntLiteral extends Literal {\n  \n  constructor (value) {\n    super(Types.INTEGER);\n    this.value = value;\n  }\n\n  toString () {\n    const text = convertToString(this.value, this.type);\n    if(this.parenthesis) {\n      return `(${text})`;\n    } else {\n      return text;\n    }\n  }\n}","import { Literal } from './literal';\nimport { Types } from './../../typeSystem/types';\nimport { convertToString } from './../../typeSystem/parsers';\n\nexport class RealLiteral extends Literal {\n  \n  constructor (value) {\n    super(Types.REAL);\n    this.value = value;\n  }\n\n  toString () {\n    const text = convertToString(this.value, this.type);\n    if (this.parenthesis) {\n      return `(${text})`;\n    } else {\n      return text;\n    }\n  }\n}","import { Literal } from './literal';\nimport { Types } from './../../typeSystem/types';\nimport { convertBoolToString } from \"./../../typeSystem/parsers\";\n\nexport class BoolLiteral extends Literal {\n  \n  constructor (value) {\n    super(Types.BOOLEAN);\n    this.value = value;\n  }\n\n  toString () {\n    const text = convertBoolToString(this.value);\n    if(this.parenthesis) {\n      return `(${text})`\n    } else {\n      return text;\n    }\n  }\n}","import { Literal } from './literal';\nimport { Types } from './../../typeSystem/types';\n\nexport class CharLiteral extends Literal {\n  \n  constructor (value) {\n    super(Types.CHAR);\n    this.value = value;\n  }\n\n  toString () {\n    const text = `'${this.value}'`;\n    if(this.parenthesis) {\n      return `(${text})`\n    } else {\n      return text;\n    }\n  }\n}","import { Literal } from './literal';\nimport { Types } from './../../typeSystem/types';\n\nexport class StringLiteral extends Literal {\n  \n  constructor (value) {\n    super(Types.STRING);\n    this.value = value;\n  }\n\n  toString () {\n    const text = '\"' + this.value + '\"';\n    if(this.parenthesis) {\n      return `(${text})`;\n    } else {\n      return text;\n    }\n  }\n}","import { Literal } from './literal';\n\nexport class ArrayLiteral extends Literal {\n  \n  /**\n   * \n   * @param {import('../../typeSystem/itype').IType} type \n   * @param {import('./expression').Expression[]} value \n   */\n  constructor(type, value) {\n    super(type);\n    this.value = value;\n  }\n\n  get subtype () {\n    const element = this.value[0];\n    if (element instanceof ArrayLiteral) {\n      return element.value[0].type;\n    } else {\n      return element.type;\n    }\n  }\n\n  get lines () {\n    return this.value.length;\n  }\n\n  get columns () {\n    const element = this.value[0];\n    if (!(element instanceof ArrayLiteral)){\n      return null;\n    } else {\n      return element.value.length;\n    }\n  }\n\n  get isVector () {\n    return this.columns === null;\n  }\n\n  get isValid () {\n    return this.validateSize() && this.validateType();\n  }\n\n  validateType () {\n    const valid = true;\n    // const subtype = this.subtype;\n    // if(this.columns !== null) {\n    //   const len = this.lines;\n    //   const len2 = this.columns;\n    //   for (let i = len - 1; i >= 0 && valid; --i) {\n    //     for (let j = len2 - 1; j >= 0 && valid; --j) {\n    //       if(!this.value[i].value[j].type.isCompatilbe(subtype)) {\n    //         valid = false;\n    //         break;\n    //       }\n    //     }\n    //   }\n    // } else {\n    //   const len = this.lines;\n    //   for (var i = len - 1; i >= 0 && valid; i--) {\n    //     if(!this.value[i].type.isCompatilbe(subtype)) {\n    //       valid = false;\n    //       break;\n    //     }\n    //   }\n    // }\n    // Cannot validate type since no information on variables literals are available\n    return valid;\n  }\n\n  validateSize () {\n    const valid = true;\n    // if(this.columns !== null) {\n    //   const equalityTest = this.value.map(v => v.value.length)\n    //     .reduce((old, next) => {\n    //       console.log(next);\n    //       if (old == null) {\n    //         return next;\n    //       } else if (old === next) {\n    //         return old\n    //       } else {\n    //         return -1;\n    //       }\n    //     }, null);\n    //   valid = equalityTest !== -1;\n    // }\n    // check is now made inside IVProgParser.parseVectorList(...)\n    return valid;\n  }\n\n  toString () {\n    const strList = this.value.map(arrayLiteral => arrayLiteral.toString());\n    const text = \"{\" + strList.join(',') + \"}\";\n    if(this.parenthesis) {\n      return `(${text})`;\n    } else {\n      return text;\n    }\n  }\n}\n","import { Literal } from './literal';\nimport { Types } from './../../typeSystem/types';\n\nexport class VariableLiteral extends Literal {\n  \n  constructor (id) {\n    super(Types.UNDEFINED);\n    this.id = id;\n  }\n\n  toString () {\n    if(this.parenthesis) {\n      return `(${this.id})`;\n    } else {\n      return this.id;\n    }\n  }\n}","import { Expression } from './expression';\n\nexport class InfixApp extends Expression {\n\n  constructor(op, left, right) {\n    super();\n    this.op = op;\n    this.left = left;\n    this.right = right;\n  }\n\n  toString () {\n    const l = this.left.toString();\n    const op = this.op.value;\n    const r = this.right.toString();\n    if(this.parenthesis) {\n      return  `(${l + op + r})`;\n    } else {\n      return l + op + r;\n    }\n  }\n}","import {InfixApp} from './infixApp';\n\nexport class UnaryApp extends InfixApp {\n  \n  constructor (op, left) {\n    super(op, left, null);\n  }\n\n  toString () {\n    const l = this.left.toString();\n    const op = this.op.value;\n    if(this.parenthesis) {\n      return `(${op + l})`;\n    } else {\n      return op + l;\n    }\n  }\n}","export class SourceInfo {\n\n  /**\n    * @param {moo.Token} token\n    *\n    * @return {SourceInfo}\n    * **/\n  static createSourceInfo (token) {\n    return new SourceInfo(token.line, token.col, token.text, token.text.length);\n  }\n\n  /**\n    * @param {moo.Token} tokenA\n    * @param {moo.Token} tokenB\n    *\n    * @return {SourceInfo}\n    * **/\n  static createSourceInfoFromList (tokenA, tokenB) {\n    const line = tokenA.line;\n    const column = tokenA.col;\n    // adapted from https://github.com/UNIVALI-LITE/Portugol-Studio/blob/master/core/src/main/java/br/univali/portugol/nucleo/analise/sintatica/Portugol.g\n    // No idea why...\n    const size = tokenB.offset + 1 - tokenA.offset\n    return new SourceInfo(line, column, \"\", size);\n  }\n\n  /**\n   * @param {number} line\n   * @param {number} column\n   * @param {string} text\n   * @param {number} size\n    * **/\n  constructor (line, column, text, size) {\n    this.line = line;\n    this.column = column;\n    this.text = text;\n    this.size = size;\n  }\n\n}\n","export type Operator = {ord: number; value: string}\n\nexport const Operators = Object.freeze({\n  ADD: {ord: 0, value: \"+\"},\n  SUB: {ord: 1, value: \"-\"},\n  MULT: {ord: 2, value: '*'},\n  DIV: {ord: 3, value: '/'},\n  MOD: {ord: 4, value: '%'},\n  GT: {ord: 5, value: '>'},\n  GE: {ord: 6, value: '>='},\n  LT: {ord: 7, value: '<'},\n  LE: {ord: 8, value: '<='},\n  EQ: {ord: 9, value: '=='},\n  NEQ: {ord: 10, value: '!='},\n  AND: {ord: 11, value: 'and'},\n  OR: {ord: 12, value: 'or'},\n  NOT: {ord: 13, value: 'not'}\n});\n\nexport function convertFromString (op: string): Operator | null  {\n  switch (op) {\n    case '+' : return Operators.ADD;\n    case '-' : return Operators.SUB;\n    case '*' : return Operators.MULT;\n    case '/' : return Operators.DIV;\n    case '%' : return Operators.MOD;\n    case '>' : return Operators.GT;\n    case '>=' : return Operators.GE;\n    case '<' : return Operators.LT;\n    case '<=' : return Operators.LE;\n    case '==' : return Operators.EQ;\n    case '!=' : return Operators.NEQ;\n    case 'and' : return Operators.AND;\n    case 'or' : return Operators.OR;\n    case 'not' : return Operators.NOT;\n  }\n  return null;\n}","export class SyntaxError extends Error {\n  constructor (msg, id) {\n    super(msg);\n    this.id = id;\n    this._context = {};\n    if (Error.captureStackTrace) Error.captureStackTrace(this, SyntaxError);\n  }\n\n  get context () {\n    return this._context;\n  }\n\n  set context (contextObj) {\n    this._context = contextObj;\n  }\n}\n","import * as LocalizedStringsService from \"./../../services/localizedStringsService\";\nimport { SyntaxError } from \"./syntaxError\";\n\nconst LocalizedStrings = LocalizedStringsService.getInstance();\n\nfunction createError (message_id, context = []) {\n  return new SyntaxError(\n    LocalizedStrings.getError(message_id, context),\n    message_id\n  );\n}\n\nexport const SyntaxErrorFactory = Object.freeze({\n  extra_lines: () => new SyntaxError(LocalizedStrings.getError(\"extra_lines\")),\n  token_missing_one: (expected, token) => {\n    const context = [expected, token.text, token.line, token.col];\n    const error = createError(\"token_missing_one\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  token_missing_list: (expectedList, token) => {\n    const line = expectedList.join(LocalizedStrings.getOR());\n    const error = SyntaxErrorFactory.token_missing_one(line, token);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  id_missing: (token) => {\n    const context = [token.text, token.line, token.col];\n    const error = createError(\"id_missing\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  eos_missing: (token) => {\n    const context = [token.line, token.col];\n    const error = createError(\"eos_missing\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  invalid_array_dimension: (typeName, token) => {\n    const context = [token.line, token.col, typeName];\n    const error = createError(\"invalid_array_dimension\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  invalid_array_size: (token) => {\n    const context = [token.line];\n    const error = createError(\"invalid_array_size\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  invalid_main_return: (name, typeName, token) => {\n    const context = [name, typeName, token.line];\n    const error = createError(\"invalid_main_return\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  invalid_var_declaration: (token) => {\n    const context = [token.line];\n    const error = createError(\"invalid_var_declaration\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  invalid_break_command: (cmdName, token) => {\n    const context = [token.line, cmdName];\n    const error = createError(\"invalid_break_command\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  invalid_terminal: (token) => {\n    const context = [token.text, token.line, token.col];\n    const error = createError(\"invalid_terminal\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  invalid_type: (list, token) => {\n    const line = list.join(LocalizedStrings.getOR());\n    const context = [token.text, token.line, token.col, line];\n    const error = createError(\"invalid_type\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  const_not_init: (token) => {\n    const context = [token.line, token.col];\n    const error = createError(\"const_not_init\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  invalid_id_format: (token) => {\n    const context = [token.text, token.line, token.col];\n    const error = createError(\"invalid_id_format\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  duplicate_function: (token) => {\n    const context = [token.text, token.line, token.col];\n    const error = createError(\"duplicate_function\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  main_parameters: () => {\n    return createError(\"main_parameters\");\n  },\n  duplicate_variable: (token) => {\n    const context = [token.text, token.line, token.col];\n    const error = createError(\"duplicate_variable\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  invalid_character: (text, line, column) => {\n    const context = [text, line];\n    const error = createError(\"invalid_character\", context);\n    error.context = { line: line, column: column };\n    return error;\n  },\n  annonymous_array_literal: (token) => {\n    const context = [token.line];\n    const error = createError(\"annonymous_array_literal\", context);\n    error.context = { line: token.line, column: token.col};\n    return error;\n  },\n  invalid_matrix_literal_line: (exp, sourceInfo) => {\n    const context = [exp, sourceInfo.line];\n    const error = createError(\"invalid_matrix_literal_line\", context);\n    error.context = { line: sourceInfo.line, column: sourceInfo.column };\n    return error;\n  },\n  cannot_infer_matrix_line: (name, sourceInfo) => {\n    const context = [name, sourceInfo.line];\n    const error = createError(\"cannot_infer_matrix_line\", context);\n    error.context = { line: sourceInfo.line, column: sourceInfo.column };\n    return error;\n  },\n  cannot_infer_matrix_column: (name, sourceInfo) => {\n    const context = [name, sourceInfo.line];\n    const error = createError(\"cannot_infer_matrix_column\", context);\n    error.context = { line: sourceInfo.line, column: sourceInfo.column };\n    return error;\n  },\n  cannot_infer_vector_size: (name, sourceInfo) => {\n    const context = [name, sourceInfo.line];\n    const error = createError(\"cannot_infer_vector_size\", context);\n    error.context = { line: sourceInfo.line, column: sourceInfo.column };\n    return error;\n  },\n  matrix_to_vector_literal_attr: (name, exp, sourceInfo) => {\n    const context = [sourceInfo.line, exp, name];\n    const error = createError(\"matrix_to_vector_literal_attr\", context);\n    error.context = { line: sourceInfo.line, column: sourceInfo.column };\n    return error;\n  },\n  vector_to_matrix_literal_attr: (name, exp, sourceInfo) => {\n    const context = [sourceInfo.line, exp, name];\n    const error = createError(\"vector_to_matrix_literal_attr\", context);\n    error.context = { line: sourceInfo.line, column: sourceInfo.column };\n    return error;\n  },\n  array_init_not_literal: (sourceInfo) => {\n    const context = [sourceInfo.line];\n    const error = createError(\"array_init_not_literal\", context);\n    error.context = { line: sourceInfo.line, column: sourceInfo.column };\n    return error;\n  },\n  array_exceeds_2d: (sourceInfo) => {\n    const context = [sourceInfo.line];\n    const error = createError(\"array_exceeds_2d\", context);\n    error.context = { line: sourceInfo.line, column: sourceInfo.column };\n    return error;\n  },\n  invalid_matrix_id_dimension: (sourceInfo) => {\n    const context = [sourceInfo.line];\n    const error = createError(\"invalid_matrix_id_dimension\", context);\n    error.context = { line: sourceInfo.line, column: sourceInfo.column };\n    return error;\n  },\n  invalid_vector_init: (sourceInfo) => {\n    const context = [sourceInfo.line];\n    const error = createError(\"invalid_vector_init\", context);\n    error.context = { line: sourceInfo.line, column: sourceInfo.column };\n    return error;\n  },\n  invalid_matrix_init: (sourceInfo) => {\n    const context = [sourceInfo.line];\n    const error = createError(\"invalid_matrix_init\", context);\n    error.context = { line: sourceInfo.line, column: sourceInfo.column };\n    return error;\n  },\n  invalid_syntax: (text, line, column) => {\n    const context = [text, line];\n    const error = createError(\"invalid_syntax\", context);\n    error.context = { line: line, column: column };\n    return error;\n  }\n});\n","import * as Expressions from \"./expressions\";\nimport * as Commands from \"./commands\";\nimport * as Parsers from \"../typeSystem/parsers\";\nimport { Types } from \"../typeSystem/types\";\nimport { ArrayType } from \"../typeSystem/array_type\";\nimport { SourceInfo } from \"./sourceInfo\";\nimport { convertFromString } from \"./operators\";\nimport { SyntaxErrorFactory } from \"./error/syntaxErrorFactory\";\nimport { LanguageDefinedFunction } from \"../processor/definedFunctions\";\nimport { LanguageService } from \"../services/languageService\";\n\nexport class IVProgParser {\n  static createParser (input, fill = true) {\n    const lexer = LanguageService.getCurrentLexer();\n    const parser = new IVProgParser(input, lexer);\n    if (fill) {\n      parser.fill();\n    }\n    return parser;\n  }\n\n  // <BEGIN scope consts>\n  static get BASE () {\n    return 0;\n  }\n  static get FUNCTION () {\n    return 1;\n  }\n  static get COMMAND () {\n    return 2;\n  }\n  static get BREAKABLE () {\n    return 4;\n  }\n  // </ END scope consts>\n  //\n  static get EOF_TOKEN () {\n    return {\n      text: null,\n      line: -1,\n      col: -1,\n      value: null,\n      offset: -1,\n      lineBreaks: false,\n      type: \"EOF\",\n    };\n  }\n\n  /**\n   * @param {string} input\n   * @param {IVProgLexer} ivprogLexer\n   **/\n  constructor (input, ivprogLexer) {\n    this.ivprogLexer = ivprogLexer;\n    this.inputStream = input;\n    this.lexer = ivprogLexer.lexer;\n    this.tokenStream = [];\n    this.pos = 0;\n    this.ruleNames = ivprogLexer.getRules();\n    this.variableTypes = Object.entries(this.ivprogLexer.getTypeKeys()).map(\n      ([key, _]) => key\n    );\n    this.functionTypes = this.variableTypes.concat(this.ruleNames.RK_VOID);\n\n    this.parsingArrayDimension = 0;\n    this.scope = [];\n    this.langFuncs = this.ivprogLexer.getLangFuncs();\n    this.definedFuncsNameList = [];\n    this.definedVariablesStack = [];\n  }\n\n  fill (stream = null) {\n    if (stream) {\n      this.tokenStream = stream;\n      return;\n    }\n    this.tokenStream = Array.from(this.lexer.reset(this.inputStream));\n    this.tokenStream = this.tokenStream.filter((token) => {\n      // Throws an exception in case of invalid syntax\n      if (token.type === this.ruleNames.ERROR) {\n        let text = token.text;\n        const line = token.line;\n        const column = token.col;\n        throw SyntaxErrorFactory.invalid_syntax(text, line, column);\n      }\n      // remove all whitespaces token and comments\n      return (\n        token.type !== this.ruleNames.WHITESPACE &&\n        token.type !== this.ruleNames.COMMENTS\n      );\n    });\n  }\n\n  parseTree () {\n    return this.parseProgram();\n  }\n\n  /**\n   * @param {number} index\n   * @return {moo.Token}\n   * */\n  getToken (index = this.pos) {\n    // if(index === null)\n    //   index = this.pos;\n    if (index >= this.tokenStream.length) {\n      return IVProgParser.EOF_TOKEN;\n    }\n    return this.tokenStream[index];\n  }\n\n  insideScope (scope) {\n    if (this.scope.length <= 0) {\n      return IVProgParser.BASE === scope;\n    } else {\n      return this.scope[this.scope.length - 1] === scope;\n    }\n  }\n\n  pushScope (scope) {\n    this.scope.push(scope);\n  }\n\n  pushVariableStack () {\n    this.definedVariablesStack.push([]);\n  }\n\n  popScope () {\n    return this.scope.pop();\n  }\n\n  popVariableStack () {\n    return this.definedVariablesStack.pop();\n  }\n\n  getCurrentVariableStack () {\n    return this.definedVariablesStack[this.definedVariablesStack.length - 1];\n  }\n\n  isEOF () {\n    return this.getToken(this.pos).type === IVProgParser.EOF_TOKEN.type;\n  }\n\n  parseProgram () {\n    this.consumeNewLines();\n    const token = this.getToken();\n    let globalVars = [];\n    let functions = [];\n\n    if (this.ruleNames.RK_PROGRAM === token.type) {\n      this.pos++;\n      this.consumeNewLines();\n      this.checkOpenCurly();\n      this.pos++;\n      this.pushVariableStack();\n      for (;;) {\n        this.consumeNewLines();\n        const token = this.getToken();\n        if (\n          token.type === this.ruleNames.RK_CONST ||\n          this.isVariableType(token)\n        ) {\n          globalVars = globalVars.concat(this.parseGlobalVariables());\n        } else if (token.type === this.ruleNames.RK_FUNCTION) {\n          this.pushVariableStack();\n          functions = functions.concat(this.parseFunction());\n          this.popVariableStack();\n        } else {\n          break;\n        }\n      }\n      this.consumeNewLines();\n      this.checkCloseCurly();\n      this.pos++;\n      this.consumeNewLines();\n      if (!this.isEOF()) {\n        console.log(this.getToken());\n        throw SyntaxErrorFactory.extra_lines();\n      }\n      this.popVariableStack();\n      return { global: globalVars, functions: functions };\n    } else {\n      throw SyntaxErrorFactory.token_missing_one(\n        this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_PROGRAM],\n        token\n      );\n    }\n  }\n\n  checkOpenCurly (attempt = false) {\n    const token = this.getToken();\n    if (this.ruleNames.OPEN_CURLY !== token.type) {\n      if (!attempt) throw SyntaxErrorFactory.token_missing_one(\"{\", token);\n      else return false;\n    }\n    return true;\n  }\n\n  checkCloseCurly (attempt = false) {\n    const token = this.getToken();\n    if (this.ruleNames.CLOSE_CURLY !== token.type) {\n      if (!attempt) throw SyntaxErrorFactory.token_missing_one(\"}\", token);\n      else return false;\n    }\n    return true;\n  }\n\n  /* It checks if the current token at position pos is a ']'.\n   * As a check function it doesn't increment pos.\n   *\n   * @params bool:attempt, indicates that the token is optional. Defaults: false\n   *\n   * @returns true if the attempt is true and current token is '[',\n   *   false is attempt is true and current token is not '['\n   **/\n  checkOpenBrace (attempt = false) {\n    const token = this.getToken();\n    if (this.ruleNames.OPEN_BRACE !== token.type) {\n      if (!attempt) {\n        throw SyntaxErrorFactory.token_missing_one(\"[\", token);\n      } else {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  checkCloseBrace (attempt = false) {\n    const token = this.getToken();\n    if (this.ruleNames.CLOSE_BRACE !== token.type) {\n      if (!attempt) {\n        throw SyntaxErrorFactory.token_missing_one(\"]\", token);\n      } else {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  checkOpenParenthesis (attempt = false) {\n    const token = this.getToken();\n    if (this.ruleNames.OPEN_PARENTHESIS !== token.type) {\n      if (!attempt) {\n        throw SyntaxErrorFactory.token_missing_one(\"(\", token);\n      } else {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  checkCloseParenthesis (attempt = false) {\n    const token = this.getToken();\n    if (this.ruleNames.CLOSE_PARENTHESIS !== token.type) {\n      if (!attempt) {\n        throw SyntaxErrorFactory.token_missing_one(\")\", token);\n      } else {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  checkEOS (attempt = false) {\n    const eosToken = this.getToken();\n    if (eosToken.type !== this.ruleNames.EOS) {\n      if (!attempt) throw SyntaxErrorFactory.eos_missing(eosToken);\n      else return false;\n    }\n    return true;\n  }\n\n  checkFunctionDuplicate (functionID, funcIDToken) {\n    const id = functionID === null ? \"$main\" : functionID;\n    const index = this.definedFuncsNameList.indexOf(id);\n    if (index !== -1) {\n      throw SyntaxErrorFactory.duplicate_function(funcIDToken);\n    }\n    this.definedFuncsNameList.push(id);\n  }\n  checkVariableDuplicate (variableID, sourceInfo) {\n    const index = this.getCurrentVariableStack().indexOf(variableID);\n    if (index !== -1) {\n      throw SyntaxErrorFactory.duplicate_variable(sourceInfo);\n    }\n    this.getCurrentVariableStack().push(variableID);\n  }\n\n  consumeForSemiColon () {\n    const eosToken = this.getToken();\n    if (eosToken.type === this.ruleNames.EOS && eosToken.text.match(\"^;$\")) {\n      this.pos++;\n      return;\n    }\n    throw SyntaxErrorFactory.token_missing_one(\";\", eosToken);\n  }\n\n  parseGlobalVariables () {\n    const decl = this.parseMaybeConst();\n    this.checkEOS();\n    this.pos++;\n    return decl;\n  }\n\n  /*\n   * Checks if the next token is PR_CONST. It's only available\n   * at global variables declaration level\n   * @returns Declararion(const, type, id, initVal?)\n   **/\n  parseMaybeConst () {\n    const constToken = this.getToken();\n    if (constToken.type === this.ruleNames.RK_CONST) {\n      this.pos++;\n      const typeString = this.parseType();\n      return this.parseDeclaration(typeString, true);\n    } else if (this.isVariableType(constToken)) {\n      const typeString = this.parseType();\n      return this.parseDeclaration(typeString);\n    } else {\n      throw SyntaxErrorFactory.token_missing_list(\n        [this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_CONST]].concat(\n          this.getTypeArray()\n        ),\n        constToken\n      );\n    }\n  }\n\n  /**\n   * Parses a declarion of the form: type --- id --- (= --- EAnd)?\n   * @return {Commands.Declartion[]} a list of Declararion(const, type, id, initVal?)\n   **/\n  parseDeclaration (typeString, isConst = false) {\n    let initial = null;\n    let dim1 = null;\n    let dim2 = null;\n    let dimensions = 0;\n    const sourceInfo = SourceInfo.createSourceInfo(this.getToken());\n    const idString = this.parseID();\n    this.checkVariableDuplicate(idString, sourceInfo);\n    // Check for array or vector\n    // ID[int/IDi?][int/IDj?]\n    if (this.checkOpenBrace(true)) {\n      this.pos += 1;\n      this.consumeNewLines();\n      dim1 = this.parseArrayDimension();\n      this.consumeNewLines();\n      this.checkCloseBrace();\n      this.pos += 1;\n      dimensions += 1;\n      if (this.checkOpenBrace(true)) {\n        this.pos += 1;\n        this.consumeNewLines();\n        dim2 = this.parseArrayDimension();\n        this.consumeNewLines();\n        this.checkCloseBrace();\n        this.pos += 1;\n        dimensions += 1;\n      }\n      return this.parseArrayDeclaration(\n        typeString,\n        isConst,\n        idString,\n        sourceInfo,\n        dimensions,\n        dim1,\n        dim2\n      );\n    } else {\n      const assignmentToken = this.getToken();\n      if (isConst && assignmentToken.type !== this.ruleNames.ASSIGNMENT) {\n        throw SyntaxErrorFactory.const_not_init(sourceInfo);\n      }\n      if (assignmentToken.type === this.ruleNames.ASSIGNMENT) {\n        this.pos++;\n        initial = this.parseExpressionOR();\n      }\n      const declaration = new Commands.Declaration(\n        idString,\n        typeString,\n        initial,\n        isConst\n      );\n      declaration.sourceInfo = sourceInfo;\n      const commaToken = this.getToken();\n      if (commaToken.type === this.ruleNames.COMMA) {\n        this.pos++;\n        this.consumeNewLines();\n        return [declaration].concat(this.parseDeclaration(typeString, isConst));\n      } else {\n        return [declaration];\n      }\n    }\n  }\n\n  parseArrayDeclaration (\n    typeString,\n    isConst,\n    idString,\n    sourceInfo,\n    dimensions,\n    dim1,\n    dim2\n  ) {\n    const assignmentToken = this.getToken();\n    let n_lines = dim1;\n    let n_columns = dim2;\n    let initial = null;\n    let dim_is_id = false;\n    if (\n      dim1 instanceof Expressions.VariableLiteral ||\n      dim2 instanceof Expressions.VariableLiteral\n    ) {\n      dim_is_id = true;\n      if (dimensions > 1 && (dim1 == null || dim2 == null)) {\n        throw SyntaxErrorFactory.invalid_matrix_id_dimension(\n          SourceInfo.createSourceInfo(assignmentToken)\n        );\n      }\n    }\n    if (isConst && assignmentToken.type !== this.ruleNames.ASSIGNMENT) {\n      throw SyntaxErrorFactory.const_not_init(sourceInfo);\n    }\n    if (assignmentToken.type === this.ruleNames.ASSIGNMENT) {\n      if (dim_is_id) {\n        if (dimensions == 1) {\n          throw SyntaxErrorFactory.invalid_vector_init(\n            SourceInfo.createSourceInfo(assignmentToken)\n          );\n        } else {\n          throw SyntaxErrorFactory.invalid_matrix_init(\n            SourceInfo.createSourceInfo(assignmentToken)\n          );\n        }\n      }\n      this.pos += 1;\n      initial = this.parseArrayLiteral(typeString);\n    }\n    if (initial == null && dim1 == null) {\n      if (dimensions > 1) {\n        throw SyntaxErrorFactory.cannot_infer_matrix_line(idString, sourceInfo);\n      }\n      throw SyntaxErrorFactory.cannot_infer_vector_size(idString, sourceInfo);\n    }\n    if (dimensions > 1) {\n      if (initial == null && dim2 == null) {\n        throw SyntaxErrorFactory.cannot_infer_matrix_column(\n          idString,\n          sourceInfo\n        );\n      }\n    }\n\n    if (dimensions === 1 && initial != null && !initial.isVector) {\n      const expString = initial.toString();\n      throw SyntaxErrorFactory.matrix_to_vector_literal_attr(\n        idString,\n        expString,\n        initial.sourceInfo\n      );\n    } else if (dimensions > 1 && initial != null && initial.isVector) {\n      const expString = initial.toString();\n      throw SyntaxErrorFactory.vector_to_matrix_literal_attr(\n        idString,\n        expString,\n        initial.sourceInfo\n      );\n    }\n\n    if (dim1 == null) {\n      n_lines = new Expressions.IntLiteral(Parsers.toInt(initial.lines));\n      n_lines.sourceInfo = sourceInfo;\n    }\n\n    if (dimensions > 1) {\n      if (dim2 == null) {\n        n_columns = new Expressions.IntLiteral(Parsers.toInt(initial.columns));\n        n_columns.sourceInfo = sourceInfo;\n      }\n    }\n    const declaration = new Commands.ArrayDeclaration(\n      idString,\n      new ArrayType(typeString, dimensions),\n      n_lines,\n      n_columns,\n      initial,\n      isConst\n    );\n    declaration.sourceInfo = sourceInfo;\n    const commaToken = this.getToken();\n    if (commaToken.type === this.ruleNames.COMMA) {\n      this.pos++;\n      this.consumeNewLines();\n      return [declaration].concat(this.parseDeclaration(typeString, isConst));\n    } else {\n      return [declaration];\n    }\n  }\n\n  consumeNewLines () {\n    let token = this.getToken();\n    while (\n      token &&\n      token.type === this.ruleNames.EOS &&\n      token.text.match(\"^[\\r\\n]+$\")\n    ) {\n      this.pos++;\n      token = this.getToken();\n    }\n  }\n\n  isVariableType (token) {\n    return this.variableTypes.find((v) => v === token.type);\n  }\n\n  /**\n   * Reads the next token of the stream to check if it is a Integer or an ID.\n   * @returns Integer | ID\n   **/\n  parseArrayDimension () {\n    const dimToken = this.getToken();\n    if (dimToken.type === this.ruleNames.INTEGER) {\n      //parse as int literal\n      this.pos++;\n      return this.getIntLiteral(dimToken);\n    } else if (dimToken.type === this.ruleNames.ID) {\n      //parse as variable\n      this.pos++;\n      return this.parseVariable(dimToken);\n    } else if (dimToken.type === this.ruleNames.CLOSE_BRACE) {\n      return null;\n    } else {\n      throw SyntaxErrorFactory.invalid_array_dimension(\n        this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_INTEGER],\n        dimToken\n      );\n    }\n  }\n\n  /**\n   * Returns an object {type: 'int', value: value}.\n   * It checks for binary and hexadecimal integers.\n   * @param {moo.Token} token\n   * @return {Object} object with fields type and value\n   **/\n  getIntLiteral (token) {\n    const text = token.text;\n    const sourceInfo = SourceInfo.createSourceInfo(token);\n    const exp = new Expressions.IntLiteral(Parsers.toInt(text));\n    exp.sourceInfo = sourceInfo;\n    return exp;\n  }\n\n  getRealLiteral (token) {\n    const sourceInfo = SourceInfo.createSourceInfo(token);\n    const exp = new Expressions.RealLiteral(Parsers.toReal(token.text));\n    exp.sourceInfo = sourceInfo;\n    return exp;\n  }\n\n  getStringLiteral (token) {\n    const text = token.text;\n    const sourceInfo = SourceInfo.createSourceInfo(token);\n    const exp = new Expressions.StringLiteral(Parsers.toString(text));\n    exp.sourceInfo = sourceInfo;\n    return exp;\n  }\n\n  getCharLiteral (token) {\n    const text = token.text;\n    const exp = new Expressions.CharLiteral(Parsers.toChar(text));\n    exp.sourceInfo = SourceInfo.createSourceInfo(token);\n    return exp;\n  }\n\n  getBoolLiteral (token) {\n    const val = Parsers.toBool(token.text);\n    const exp = new Expressions.BoolLiteral(val);\n    exp.sourceInfo = SourceInfo.createSourceInfo(token);\n    return exp;\n  }\n\n  parseArrayLiteral (typeString) {\n    const openCurly = this.checkOpenCurly(true);\n    if (!openCurly) {\n      const invalid_token = this.getToken();\n      throw SyntaxErrorFactory.array_init_not_literal(\n        SourceInfo.createSourceInfo(invalid_token)\n      );\n    }\n    const beginArray = this.getToken();\n    if (this.parsingArrayDimension >= 2) {\n      throw SyntaxErrorFactory.array_exceeds_2d(\n        SourceInfo.createSourceInfo(beginArray)\n      );\n    }\n    this.pos += 1;\n    this.parsingArrayDimension += 1;\n    this.consumeNewLines();\n    let data = null;\n    const maybeCurlyOpen = this.checkOpenCurly(true);\n    if (maybeCurlyOpen) {\n      // This is potentially a list of vectors\n      data = this.parseVectorList(typeString);\n    } else {\n      data = this.parseExpressionList();\n    }\n    this.consumeNewLines();\n    this.checkCloseCurly();\n    const endArray = this.getToken();\n    this.pos += 1;\n    this.parsingArrayDimension -= 1;\n    const sourceInfo = SourceInfo.createSourceInfoFromList(\n      beginArray,\n      endArray\n    );\n    let dataDim = 1;\n    if (data[0] instanceof Expressions.ArrayLiteral) {\n      dataDim += 1;\n    } else if (data.length == 1) {\n      console.log(\"Talvez uma variável seja uma melhor opção\");\n    }\n    const type = new ArrayType(typeString, dataDim);\n    const exp = new Expressions.ArrayLiteral(type, data);\n    exp.sourceInfo = sourceInfo;\n    return exp;\n  }\n\n  /**\n   * Returns a list of ArrayLiterals. Helper function for parsing matrices\n   */\n  parseVectorList (typeString) {\n    const list = [];\n    let lastSize = null;\n    for (;;) {\n      this.checkOpenCurly();\n      const beginArray = this.getToken();\n      if (this.parsingArrayDimension >= 2) {\n        throw SyntaxErrorFactory.array_exceeds_2d(\n          SourceInfo.createSourceInfo(beginArray)\n        );\n      }\n      this.pos += 1;\n      this.parsingArrayDimension += 1;\n      this.consumeNewLines();\n      const data = this.parseExpressionList();\n      this.consumeNewLines();\n      this.checkCloseCurly();\n      const endArray = this.getToken();\n      this.pos += 1;\n      this.parsingArrayDimension -= 1;\n      const sourceInfo = SourceInfo.createSourceInfoFromList(\n        beginArray,\n        endArray\n      );\n      if (lastSize == null) {\n        lastSize = data.length;\n      } else if (lastSize !== data.length) {\n        const expString = this.inputStream.substring(\n          beginArray.offset,\n          endArray.offset + endArray.text.length\n        );\n        throw SyntaxErrorFactory.invalid_matrix_literal_line(\n          expString,\n          sourceInfo\n        );\n      }\n      const type = new ArrayType(typeString, 1);\n      const exp = new Expressions.ArrayLiteral(type, data);\n      exp.sourceInfo = sourceInfo;\n      list.push(exp);\n      const commaToken = this.getToken();\n      if (commaToken.type !== this.ruleNames.COMMA) {\n        break;\n      }\n      this.pos += 1;\n      this.consumeNewLines();\n    }\n    if (list.length == 1) {\n      console.log(\"Talvez um vetor seja uma melhor opção\");\n    }\n    return list;\n  }\n\n  /*\n   * Returns an object {type: 'variable', value: value}.\n   * @returns object with fields type and value\n   **/\n  parseVariable (token) {\n    const sourceInfo = SourceInfo.createSourceInfo(token);\n    const exp = new Expressions.VariableLiteral(token.text);\n    exp.sourceInfo = sourceInfo;\n    return exp;\n  }\n\n  /*\n   * Returns an object representing a function. It has\n   * four attributes: returnType, id, formalParams and block.\n   * The block object has two attributes: declarations and commands\n   **/\n  parseFunction () {\n    this.pushScope(IVProgParser.FUNCTION);\n    let formalParams = [];\n    const token = this.getToken();\n    if (token.type !== this.ruleNames.RK_FUNCTION) {\n      //throw SyntaxError.createError(this.lexer.literalNames[this.lexerClass.PR_FUNCAO], token);\n      return null;\n    }\n    this.pos++;\n    const funType = this.parseType();\n    let dimensions = 0;\n    if (this.checkOpenBrace(true)) {\n      this.pos++;\n      this.checkCloseBrace();\n      this.pos++;\n      dimensions++;\n      if (this.checkOpenBrace(true)) {\n        this.pos++;\n        this.checkCloseBrace();\n        this.pos++;\n        dimensions++;\n      }\n    }\n    const funcIDToken = this.getToken();\n    const functionID = this.parseID();\n    this.checkFunctionDuplicate(functionID, funcIDToken);\n    this.checkOpenParenthesis();\n    this.pos++;\n    this.consumeNewLines();\n    if (!this.checkCloseParenthesis(true)) {\n      formalParams = this.parseFormalParameters(); // formal parameters\n      this.consumeNewLines();\n      this.checkCloseParenthesis();\n      this.pos++;\n    } else {\n      this.pos++;\n    }\n    this.consumeNewLines();\n    const commandsBlock = this.parseCommandBlock();\n    let returnType = funType;\n    if (dimensions > 0) {\n      returnType = new ArrayType(funType, dimensions);\n    }\n    const func = new Commands.Function(\n      functionID,\n      returnType,\n      formalParams,\n      commandsBlock\n    );\n    if (functionID === null && !func.isMain) {\n      throw SyntaxErrorFactory.invalid_main_return(\n        LanguageDefinedFunction.getMainFunctionName(),\n        this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_VOID],\n        token.line\n      );\n    } else if (func.isMain && formalParams.length !== 0) {\n      throw SyntaxErrorFactory.main_parameters();\n    }\n    this.popScope();\n    func.sourceInfo = SourceInfo.createSourceInfo(funcIDToken);\n    return func;\n  }\n\n  /*\n   * Parse the formal parameters of a function.\n   * @returns a list of objects with the following attributes: type, id and dimensions.\n   **/\n  parseFormalParameters () {\n    const list = [];\n    for (;;) {\n      let dimensions = 0;\n      let reference = false;\n      const typeString = this.parseType();\n      let maybeIDToken = this.getToken();\n      if (maybeIDToken.type === this.ruleNames.RK_REFERENCE) {\n        reference = true;\n        this.pos += 1;\n        maybeIDToken = this.getToken();\n      }\n      const idString = this.parseID();\n      this.checkVariableDuplicate(idString, maybeIDToken);\n      if (this.checkOpenBrace(true)) {\n        this.pos += 1;\n        dimensions += 1;\n        this.checkCloseBrace();\n        this.pos += 1;\n        if (this.checkOpenBrace(true)) {\n          this.pos += 1;\n          dimensions += 1;\n          this.checkCloseBrace();\n          this.pos += 1;\n        }\n      }\n      let type = null;\n      if (dimensions > 0) {\n        type = new ArrayType(typeString, dimensions);\n      } else {\n        type = typeString;\n      }\n      const parameter = new Commands.FormalParameter(type, idString, reference);\n      parameter.sourceInfo = SourceInfo.createSourceInfo(maybeIDToken);\n      list.push(parameter);\n      const commaToken = this.getToken();\n      if (commaToken.type !== this.ruleNames.COMMA) break;\n      this.pos++;\n      this.consumeNewLines();\n    }\n    return list;\n  }\n\n  parseID () {\n    const token = this.getToken();\n    if (token.type !== this.ruleNames.ID) {\n      throw SyntaxErrorFactory.id_missing(token);\n    }\n    this.pos++;\n    if (this.insideScope(IVProgParser.FUNCTION)) {\n      if (token.text === LanguageDefinedFunction.getMainFunctionName()) {\n        return null;\n      }\n    }\n    return token.text;\n  }\n\n  /**\n   * @return {string}\n   **/\n  parseMaybeLibID () {\n    const token = this.getToken();\n    if (token.type !== this.ruleNames.ID) {\n      throw SyntaxErrorFactory.id_missing(token);\n    }\n    const maybeDOT = this.getToken(this.pos + 1);\n    if (maybeDOT.type === this.ruleNames.DOT) {\n      this.pos += 2;\n      const anotherID = this.getToken();\n      if (anotherID.type !== this.ruleNames.ID) {\n        throw SyntaxErrorFactory.id_missing(anotherID);\n      }\n      this.pos++;\n      return `${token.text}.${anotherID.text}`;\n    }\n    this.pos++;\n    return token.text;\n  }\n\n  parseType () {\n    const token = this.getToken();\n    if (\n      token.type === this.ruleNames.ID &&\n      this.insideScope(IVProgParser.FUNCTION)\n    ) {\n      return Types.VOID;\n    } else if (\n      token.type === this.ruleNames.RK_VOID &&\n      this.insideScope(IVProgParser.FUNCTION)\n    ) {\n      this.pos++;\n      return Types.VOID;\n    } else if (this.isVariableType(token)) {\n      this.pos++;\n      switch (token.type) {\n        case this.ruleNames.RK_INTEGER:\n          return Types.INTEGER;\n        case this.ruleNames.RK_BOOLEAN:\n          return Types.BOOLEAN;\n        case this.ruleNames.RK_REAL:\n          return Types.REAL;\n        case this.ruleNames.RK_STRING:\n          return Types.STRING;\n        case this.ruleNames.RK_CHARACTER:\n          return Types.CHAR;\n        default:\n          break;\n      }\n    }\n\n    throw SyntaxErrorFactory.invalid_type(this.getTypeArray(), token);\n  }\n\n  parseCommandBlock (optionalCurly = false) {\n    let variablesDecl = [];\n    const commands = [];\n    let hasOpen = false;\n    if (this.checkOpenCurly(optionalCurly)) {\n      this.pos++;\n      hasOpen = true;\n    }\n    this.consumeNewLines();\n    let parsedCommand = false;\n    for (;;) {\n      const cmd = this.parseCommand();\n      if (cmd === null) break;\n      if (cmd !== -1) {\n        if (cmd instanceof Array) {\n          if (parsedCommand) {\n            const lastToken = this.getToken(this.pos - 1);\n            throw SyntaxErrorFactory.invalid_var_declaration(lastToken);\n          }\n          variablesDecl = variablesDecl.concat(cmd);\n        } else {\n          parsedCommand = true;\n          commands.push(cmd);\n        }\n      }\n    }\n    this.consumeNewLines();\n    if (hasOpen) {\n      this.checkCloseCurly();\n      this.pos++;\n      this.consumeNewLines();\n    }\n    return new Commands.CommandBlock(variablesDecl, commands);\n  }\n\n  parseCommand () {\n    const token = this.getToken();\n    if (this.isVariableType(token)) {\n      if (!this.insideScope(IVProgParser.FUNCTION)) {\n        throw SyntaxErrorFactory.invalid_var_declaration(token);\n      }\n      this.pushScope(IVProgParser.BASE);\n      const varType = this.parseType();\n      this.popScope();\n      const cmd = this.parseDeclaration(varType);\n      this.checkEOS();\n      this.pos++;\n      return cmd;\n    } else if (token.type === this.ruleNames.ID) {\n      return this.parseIDCommand();\n    } else if (token.type === this.ruleNames.DOT) {\n      // TODO Check if this is relevant since DOT is a replacement for antlr4 LIB_ID :=> ID . ID\n      throw SyntaxErrorFactory.invalid_syntax(\n        token.text,\n        token.line,\n        token.col\n      );\n    } else if (token.type === this.ruleNames.RK_RETURN) {\n      return this.parseReturn();\n    } else if (\n      token.type === this.ruleNames.RK_WHILE ||\n      token.type === this.ruleNames.RK_WHILE_ALT\n    ) {\n      return this.parseWhile();\n    } else if (\n      token.type === this.ruleNames.RK_FOR ||\n      token.type === this.ruleNames.RK_FOR_ALT\n    ) {\n      return this.parseFor();\n    } else if (token.type === this.ruleNames.RK_BREAK) {\n      if (!this.insideScope(IVProgParser.BREAKABLE)) {\n        throw SyntaxErrorFactory.invalid_break_command(\n          this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_BREAK],\n          token\n        );\n      }\n      return this.parseBreak();\n    } else if (token.type === this.ruleNames.RK_SWITCH) {\n      return this.parseSwitchCase();\n    } else if (token.type === this.ruleNames.RK_DO) {\n      return this.parseRepeatUntil();\n    } else if (token.type === this.ruleNames.RK_IF) {\n      return this.parseIfThenElse();\n    } else if (this.checkEOS(true)) {\n      this.pos++;\n      return -1;\n    } else {\n      return null;\n    }\n  }\n\n  parseSwitchCase () {\n    const token = this.getToken();\n    this.pushScope(IVProgParser.BREAKABLE);\n    this.pos++;\n    this.checkOpenParenthesis();\n    this.pos++;\n    this.consumeNewLines();\n    const exp = this.parseExpressionOR();\n    this.consumeNewLines();\n    this.checkCloseParenthesis();\n    this.pos++;\n    this.consumeNewLines();\n    this.checkOpenCurly();\n    this.pos++;\n    this.consumeNewLines();\n    const casesList = this.parseCases();\n    this.consumeNewLines();\n    this.checkCloseCurly();\n    this.pos++;\n    this.consumeNewLines();\n\n    this.popScope();\n    const command = new Commands.Switch(exp, casesList);\n    command.sourceInfo = SourceInfo.createSourceInfo(token);\n    return command;\n  }\n\n  parseRepeatUntil () {\n    const token = this.getToken();\n    this.pos++;\n    this.consumeNewLines();\n    this.pushScope(IVProgParser.BREAKABLE);\n    const commandsBlock = this.parseCommandBlock();\n    this.consumeNewLines(); //Maybe not...\n    const whileToken = this.getToken();\n    if (whileToken.type !== this.ruleNames.RK_DO_UNTIL) {\n      throw SyntaxErrorFactory.token_missing_one(\n        this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_DO_UNTIL],\n        whileToken\n      );\n    }\n    this.pos++;\n    this.checkOpenParenthesis();\n    this.pos++;\n    this.consumeNewLines();\n    const condition = this.parseExpressionOR();\n    this.consumeNewLines();\n    this.checkCloseParenthesis();\n    this.pos++;\n    this.checkEOS();\n    this.popScope();\n    const command = new Commands.RepeatUntil(condition, commandsBlock);\n    command.sourceInfo = SourceInfo.createSourceInfo(token);\n    return command;\n  }\n\n  parseIfThenElse () {\n    if (this.insideScope(IVProgParser.BREAKABLE)) {\n      this.pushScope(IVProgParser.BREAKABLE);\n    } else {\n      this.pushScope(IVProgParser.COMMAND);\n    }\n    const token = this.getToken();\n    this.pos++;\n    this.checkOpenParenthesis();\n    this.pos++;\n    this.consumeNewLines();\n    const logicalExpression = this.parseExpressionOR();\n    this.consumeNewLines();\n    this.checkCloseParenthesis();\n    this.pos++;\n    this.consumeNewLines();\n    const cmdBlocks = this.parseCommandBlock();\n\n    const maybeElse = this.getToken();\n    if (maybeElse.type === this.ruleNames.RK_ELSE) {\n      this.pos++;\n      this.consumeNewLines();\n      const maybeIf = this.getToken();\n      let elseBlock = null;\n      if (this.checkOpenCurly(true)) {\n        elseBlock = this.parseCommandBlock();\n      } else if (maybeIf.type === this.ruleNames.RK_IF) {\n        elseBlock = this.parseIfThenElse();\n      } else {\n        throw SyntaxErrorFactory.token_missing_list(\n          [this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_IF], \"{\"],\n          maybeIf\n        );\n      }\n      this.popScope();\n      const cmd = new Commands.IfThenElse(\n        logicalExpression,\n        cmdBlocks,\n        elseBlock\n      );\n      cmd.sourceInfo = SourceInfo.createSourceInfo(token);\n      return cmd;\n    }\n    this.popScope();\n\n    const cmd = new Commands.IfThenElse(logicalExpression, cmdBlocks, null);\n    cmd.sourceInfo = SourceInfo.createSourceInfo(token);\n    return cmd;\n  }\n\n  parseFor () {\n    this.pushScope(IVProgParser.BREAKABLE);\n    const for_token = this.getToken();\n    this.pos += 1;\n    // parse ID\n    const id_token = this.getToken();\n    const id = this.parseID();\n    const for_id = new Expressions.VariableLiteral(id);\n    for_id.sourceInfo = SourceInfo.createSourceInfo(id_token);\n    // END parse ID\n    const for_from = this.parseForParameters(this.ruleNames.RK_FOR_FROM);\n    const for_to = this.parseForParameters(this.ruleNames.RK_FOR_TO);\n    const maybePass = this.parseForParameters(this.ruleNames.RK_FOR_PASS);\n    this.consumeNewLines();\n    const commandsBlock = this.parseCommandBlock();\n    this.popScope();\n    const cmd = new Commands.For(\n      for_id,\n      for_from,\n      for_to,\n      maybePass,\n      commandsBlock\n    );\n    cmd.sourceInfo = SourceInfo.createSourceInfo(for_token);\n    return cmd;\n  }\n\n  parseWhile () {\n    this.pushScope(IVProgParser.BREAKABLE);\n    const token = this.getToken();\n    this.pos++;\n    this.checkOpenParenthesis();\n    this.pos++;\n    this.consumeNewLines();\n    const logicalExpression = this.parseExpressionOR();\n    this.consumeNewLines();\n    this.checkCloseParenthesis();\n    this.pos++;\n    this.consumeNewLines();\n    const cmdBlocks = this.parseCommandBlock();\n    this.popScope();\n    const cmd = new Commands.While(logicalExpression, cmdBlocks);\n    cmd.sourceInfo = SourceInfo.createSourceInfo(token);\n    return cmd;\n  }\n\n  parseBreak () {\n    const token = this.getToken();\n    this.pos++;\n    this.checkEOS();\n    this.pos++;\n    const command = new Commands.Break();\n    command.sourceInfo = SourceInfo.createSourceInfo(token);\n    return command;\n  }\n\n  parseReturn () {\n    const token = this.getToken();\n    this.pos++;\n    let exp = null;\n    if (!this.checkEOS(true)) {\n      exp = this.parseExpressionOR();\n      this.checkEOS();\n    }\n    this.pos++;\n    const returnCommand = new Commands.Return(exp);\n    returnCommand.sourceInfo = SourceInfo.createSourceInfo(token);\n    return returnCommand;\n  }\n\n  parseIDCommand () {\n    const refToken = this.getToken();\n    const id = this.parseMaybeLibID();\n    const isID = id.indexOf(\".\") === -1;\n    if (this.checkOpenBrace(true)) {\n      this.pos++;\n      let lineExpression = null;\n      let columnExpression = null;\n      this.consumeNewLines();\n      lineExpression = this.parseExpression();\n      this.consumeNewLines();\n      this.checkCloseBrace();\n      this.pos++;\n      if (this.checkOpenBrace(true)) {\n        this.pos++;\n        this.consumeNewLines();\n        columnExpression = this.parseExpression();\n        this.consumeNewLines();\n        this.checkCloseBrace();\n        this.pos++;\n      }\n      const assignmentToken = this.getToken();\n      if (assignmentToken.type !== this.ruleNames.ASSIGNMENT) {\n        // TODO BETTER MESSAGE\n        throw SyntaxErrorFactory.token_missing_one(\"<-\", assignmentToken);\n      }\n      this.pos++;\n      const exp = this.parseExpressionOR();\n      this.checkEOS();\n      this.pos++;\n      const cmd = new Commands.ArrayIndexAssign(\n        id,\n        lineExpression,\n        columnExpression,\n        exp\n      );\n      cmd.sourceInfo = SourceInfo.createSourceInfo(assignmentToken);\n      return cmd;\n    }\n    const assignmentOrParenthesis = this.getToken();\n    if (isID && assignmentOrParenthesis.type === this.ruleNames.ASSIGNMENT) {\n      this.pos++;\n      const exp = this.parseExpressionOR();\n      this.checkEOS();\n      this.pos++;\n      const cmd = new Commands.Assign(id, exp);\n      cmd.sourceInfo = SourceInfo.createSourceInfo(assignmentOrParenthesis);\n      return cmd;\n    } else if (\n      assignmentOrParenthesis.type === this.ruleNames.OPEN_PARENTHESIS\n    ) {\n      const funcCall = this.parseFunctionCallCommand(id);\n      this.checkEOS();\n      this.pos++;\n      return funcCall;\n    } else if (isID) {\n      throw SyntaxErrorFactory.token_missing_list(\n        [\"<-\", \"(\"],\n        assignmentOrParenthesis\n      );\n    } else {\n      throw SyntaxErrorFactory.invalid_id_format(refToken);\n    }\n  }\n\n  parseForParameters (keyword_code) {\n    if (keyword_code === this.ruleNames.RK_FOR_PASS) {\n      if (this.checkOpenCurly(true)) {\n        return null;\n      }\n    }\n    const from_token = this.getToken();\n    if (from_token.type !== keyword_code) {\n      // TODO better error message\n      const keyword = this.ivprogLexer.getReservedKeys()[keyword_code];\n      throw new Error(\n        \"Error de sintaxe no comando repita_para: esperava-se \" +\n          keyword +\n          \" mas encontrou \" +\n          from_token.text\n      );\n    }\n    this.pos += 1;\n    let int_or_id = this.getToken();\n    let is_unary_op = false;\n    let op = null;\n    if (int_or_id.type === this.ruleNames.SUM_OP) {\n      is_unary_op = true;\n      op = int_or_id.text;\n      this.pos += 1;\n      int_or_id = this.getToken();\n    }\n    let for_from = null;\n    if (int_or_id.type === this.ruleNames.ID) {\n      for_from = new Expressions.VariableLiteral(this.parseID());\n      for_from.sourceInfo = SourceInfo.createSourceInfo(int_or_id);\n    } else if (int_or_id.type === this.ruleNames.INTEGER) {\n      this.pos += 1;\n      for_from = this.getIntLiteral(int_or_id);\n    }\n    if (for_from == null) {\n      // TODO better error message\n      const keyword = this.ivprogLexer.getReservedKeys()[keyword_code];\n      throw new Error(\n        \"Error de sintaxe no comando repeita_para: \" +\n          int_or_id.text +\n          \" não é compativel com o esperado para o paramentro \" +\n          keyword +\n          \". O valor deve ser um inteiro ou variável.\"\n      );\n    }\n    if (is_unary_op) {\n      for_from = new Expressions.UnaryApp(convertFromString(op), for_from);\n    }\n    return for_from;\n  }\n\n  parseCases () {\n    const token = this.getToken();\n    if (token.type !== this.ruleNames.RK_CASE) {\n      throw SyntaxErrorFactory.token_missing_one(\n        this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_CASE],\n        token\n      );\n    }\n    this.pos++;\n    const nextToken = this.getToken();\n    if (nextToken.type === this.ruleNames.RK_DEFAULT) {\n      this.pos++;\n      const colonToken = this.getToken();\n      if (colonToken.type !== this.ruleNames.COLON) {\n        throw SyntaxErrorFactory.token_missing_one(\":\", colonToken);\n      }\n      this.pos++;\n      this.consumeNewLines();\n      const block = this.parseCommandBlock(true);\n      const defaultCase = new Commands.Case(null);\n      defaultCase.sourceInfo = SourceInfo.createSourceInfo(token);\n      defaultCase.setCommands(block.commands);\n      return [defaultCase];\n    } else {\n      const exp = this.parseExpressionOR();\n      const colonToken = this.getToken();\n      if (colonToken.type !== this.ruleNames.COLON) {\n        throw SyntaxErrorFactory.token_missing_one(\":\", colonToken);\n      }\n      this.pos++;\n      this.consumeNewLines();\n      const block = this.parseCommandBlock(true);\n      const aCase = new Commands.Case(exp);\n      aCase.sourceInfo = SourceInfo.createSourceInfo(token);\n      aCase.setCommands(block.commands);\n      const caseToken = this.getToken();\n      if (caseToken.type === this.ruleNames.RK_CASE) {\n        return [aCase].concat(this.parseCases());\n      } else {\n        return [aCase];\n      }\n    }\n  }\n\n  /*\n   * Parses an Expression following the structure:\n   *\n   * EOR  => EAnd ( 'or' EOR)? #expression and\n   *\n   * EAnd   => ENot ('and' EAnd)? #expression or\n   *\n   * ENot  => 'not'? ER #expression not\n   *\n   * ER    => E ((>=, <=, ==, >, <) ER)? #expression relational\n   *\n   * E     => factor ((+, -) E)? #expression\n   *\n   * factor=> term ((*, /, %) factor)?\n   *\n   * term  => literal || arrayAccess || FuncCall || ID || '('EOR')'\n   **/\n  parseExpressionOR () {\n    let exp1 = this.parseExpressionAND();\n    while (this.getToken().type === this.ruleNames.RK_LOGICAL_OR) {\n      const opToken = this.getToken();\n      this.pos++;\n      const or = convertFromString(\"or\");\n      this.consumeNewLines();\n      const exp2 = this.parseExpressionAND();\n      const finalExp = new Expressions.InfixApp(or, exp1, exp2);\n      finalExp.sourceInfo = SourceInfo.createSourceInfo(opToken);\n      exp1 = finalExp;\n    }\n    return exp1;\n  }\n\n  parseExpressionAND () {\n    let exp1 = this.parseExpressionNot();\n    while (this.getToken().type === this.ruleNames.RK_LOGICAL_AND) {\n      const opToken = this.getToken();\n      this.pos++;\n      const and = convertFromString(\"and\");\n      this.consumeNewLines();\n      const exp2 = this.parseExpressionNot();\n      const finalExp = new Expressions.InfixApp(and, exp1, exp2);\n      finalExp.sourceInfo = SourceInfo.createSourceInfo(opToken);\n      exp1 = finalExp;\n    }\n    return exp1;\n  }\n\n  parseExpressionNot () {\n    const maybeNotToken = this.getToken();\n    if (maybeNotToken.type === this.ruleNames.RK_LOGICAL_NOT) {\n      const opToken = this.getToken();\n      this.pos++;\n      const not = convertFromString(\"not\");\n      const exp1 = this.parseExpressionRel();\n      const finalExp = new Expressions.UnaryApp(not, exp1);\n      finalExp.sourceInfo = SourceInfo.createSourceInfo(opToken);\n      return finalExp;\n    } else {\n      return this.parseExpressionRel();\n    }\n  }\n\n  parseExpressionRel () {\n    let exp1 = this.parseExpression();\n    while (this.getToken().type === this.ruleNames.RELATIONAL_OPERATOR) {\n      const relToken = this.getToken();\n      this.pos++;\n      const rel = convertFromString(relToken.text);\n      const exp2 = this.parseExpression();\n      const finalExp = new Expressions.InfixApp(rel, exp1, exp2);\n      finalExp.sourceInfo = SourceInfo.createSourceInfo(relToken);\n      exp1 = finalExp;\n    }\n    return exp1;\n  }\n\n  parseExpression () {\n    let factor = this.parseFactor();\n    while (this.getToken().type === this.ruleNames.SUM_OP) {\n      const sumOpToken = this.getToken();\n      this.pos++;\n      const op = convertFromString(sumOpToken.text);\n      const factor2 = this.parseFactor();\n      const finalExp = new Expressions.InfixApp(op, factor, factor2);\n      finalExp.sourceInfo = SourceInfo.createSourceInfo(sumOpToken);\n      factor = finalExp;\n    }\n    return factor;\n  }\n\n  parseFactor () {\n    let term = this.parseTerm();\n    while (this.getToken().type === this.ruleNames.MULTI_OP) {\n      const multOpToken = this.getToken();\n      this.pos++;\n      const op = convertFromString(multOpToken.text);\n      const term2 = this.parseTerm();\n      const finalExp = new Expressions.InfixApp(op, term, term2);\n      finalExp.sourceInfo = SourceInfo.createSourceInfo(multOpToken);\n      term = finalExp;\n    }\n    return term;\n  }\n\n  parseTerm () {\n    const token = this.getToken();\n    let sourceInfo = null;\n    let exp = null;\n    switch (token.type) {\n      case this.ruleNames.SUM_OP:\n        this.pos++;\n        sourceInfo = SourceInfo.createSourceInfo(token);\n        exp = new Expressions.UnaryApp(\n          convertFromString(token.text),\n          this.parseTerm()\n        );\n        exp.sourceInfo = sourceInfo;\n        return exp;\n      case this.ruleNames.INTEGER:\n        this.pos++;\n        return this.getIntLiteral(token);\n      case this.ruleNames.REAL:\n        this.pos++;\n        return this.getRealLiteral(token);\n      case this.ruleNames.STRING:\n        this.pos++;\n        return this.getStringLiteral(token);\n      case this.ruleNames.CHARACTER:\n        this.pos++;\n        return this.getCharLiteral(token);\n      case this.ruleNames.RK_TRUE:\n      case this.ruleNames.RK_FALSE:\n        this.pos++;\n        return this.getBoolLiteral(token);\n      case this.ruleNames.OPEN_CURLY:\n        // No more annonymous array\n        // return this.parseArrayLiteral();\n        throw SyntaxErrorFactory.annonymous_array_literal(token);\n      case this.ruleNames.ID:\n        return this.parseIDTerm();\n      case this.ruleNames.OPEN_PARENTHESIS:\n        return this.parseParenthesisExp();\n      default:\n        throw SyntaxErrorFactory.invalid_terminal(token);\n    }\n  }\n\n  parseIDTerm () {\n    const tokenA = this.getToken();\n    const id = this.parseMaybeLibID();\n    const isID = id.indexOf(\".\") === -1;\n    if (isID && this.checkOpenBrace(true)) {\n      let tokenB = null;\n      this.pos++;\n      const firstIndex = this.parseExpression();\n      let secondIndex = null;\n      this.consumeNewLines();\n      this.checkCloseBrace();\n      tokenB = this.getToken();\n      this.pos++;\n      if (this.checkOpenBrace(true)) {\n        this.pos++;\n        secondIndex = this.parseExpression();\n        this.consumeNewLines();\n        this.checkCloseBrace();\n        tokenB = this.getToken();\n        this.pos++;\n      }\n      const sourceInfo = SourceInfo.createSourceInfoFromList(tokenA, tokenB);\n      const exp = new Expressions.ArrayAccess(id, firstIndex, secondIndex);\n      exp.sourceInfo = sourceInfo;\n      return exp;\n    } else if (this.checkOpenParenthesis(true)) {\n      return this.parseFunctionCallExpression(id);\n    } else if (isID) {\n      const sourceInfo = SourceInfo.createSourceInfo(tokenA);\n      const exp = new Expressions.VariableLiteral(id);\n      exp.sourceInfo = sourceInfo;\n      return exp;\n    } else {\n      throw SyntaxErrorFactory.invalid_id_format(tokenA);\n    }\n  }\n\n  getFunctionName (id) {\n    const name = LanguageDefinedFunction.getInternalName(id);\n    if (name === null) {\n      if (id === LanguageDefinedFunction.getMainFunctionName()) {\n        return null;\n      }\n      return id;\n    } else {\n      return name;\n    }\n  }\n\n  parseFunctionCallExpression (id) {\n    const stepBack = id.indexOf(\".\") === -1 ? 1 : 3;\n    const tokenA = this.getToken(this.pos - stepBack);\n    const actualParameters = this.parseActualParameters();\n    const tokenB = this.getToken(this.pos - 1);\n    const funcName = this.getFunctionName(id);\n    const sourceInfo = SourceInfo.createSourceInfoFromList(tokenA, tokenB);\n    const cmd = new Expressions.FunctionCall(funcName, actualParameters);\n    cmd.sourceInfo = sourceInfo;\n    return cmd;\n  }\n\n  parseFunctionCallCommand (id) {\n    return this.parseFunctionCallExpression(id);\n  }\n\n  parseParenthesisExp () {\n    this.checkOpenParenthesis();\n    const tokenA = this.getToken();\n    this.pos += 1;\n    this.consumeNewLines();\n    const exp = this.parseExpressionOR();\n    this.consumeNewLines();\n    this.checkCloseParenthesis();\n    const tokenB = this.getToken();\n    this.pos += 1;\n    exp.sourceInfo = SourceInfo.createSourceInfoFromList(tokenA, tokenB);\n    exp.parenthesis = true;\n    return exp;\n  }\n\n  parseActualParameters () {\n    this.checkOpenParenthesis();\n    this.pos++;\n    if (this.checkCloseParenthesis(true)) {\n      this.pos++;\n      return [];\n    }\n    this.consumeNewLines();\n    const list = this.parseExpressionList();\n    this.consumeNewLines();\n    this.checkCloseParenthesis();\n    this.pos++;\n    return list;\n  }\n\n  parseExpressionList () {\n    const list = [];\n    for (;;) {\n      const exp = this.parseExpressionOR();\n      list.push(exp);\n      const maybeToken = this.getToken();\n      if (maybeToken.type !== this.ruleNames.COMMA) {\n        break;\n      } else {\n        this.pos++;\n        this.consumeNewLines();\n      }\n    }\n    return list;\n  }\n\n  getTypeArray () {\n    const types = this.insideScope(IVProgParser.FUNCTION)\n      ? this.functionTypes\n      : this.variableTypes;\n    return types.map((x) => this.lexer.literalNames[x]);\n  }\n}\n","import * as Commands from './../../ast/commands';\nimport { Types } from './../../typeSystem/types';\nimport * as Parsers from \"./../../typeSystem/parsers\";\nimport { Decimal } from 'decimal.js';\nimport { MultiType } from '../../typeSystem/multiType';\nimport { ArrayType } from '../../typeSystem/array_type';\nimport { Modes } from '../modes';\nimport { StoreValue } from '../store/value/store_value';\nimport { ProcessorErrorFactory } from '../error/processorErrorFactory';\n\n/**\n * sin\n * cos\n * tan\n * sqrt\n * pow\n * log\n * abs\n * negate\n * invert\n * max\n * min\n */\n\nfunction convertToRadians (degrees) {\n  return degrees.times(Decimal.acos(-1)).div(180);\n}\n\nexport function createSinFun () {\n   const sinFun = async (sto, _) => {\n     const x = sto.applyStore('x');\n     const angle = x.get().mod(360);\n     let result = null;\n     if(angle.eq(90)) {\n       result = new Decimal(1);\n     } else if (angle.eq(180)) {\n      result = new Decimal(0);\n     } else if (angle.eq(270)) {\n       result = new Decimal(-1);\n     } else {\n       result = Decimal.sin(convertToRadians(angle));\n     }\n     const temp = new StoreValue(Types.REAL, result);\n     sto.insertStore(\"$\", temp);\n     sto.mode = Modes.RETURN;\n     return sto;\n   };\n\n  const block = new Commands.CommandBlock([], [new Commands.SysCall(sinFun)]);\n  const func = new Commands.Function(\n    \"$sin\",\n    Types.REAL,\n    [\n      new Commands.FormalParameter(\n        new MultiType([Types.INTEGER, Types.REAL]),\n        \"x\",\n        false\n      )\n    ],\n    block\n  );\n  return func;\n}\n\nexport function createCosFun () {\n  const cosFun = async (sto, _) => {\n    const x = sto.applyStore('x');\n    const angle = x.get().mod(360);\n    let result = null;\n    if (angle.eq(90)) {\n      result = new Decimal(0);\n    } else if (angle.eq(180)) {\n      result = new Decimal(-1);\n    } else if (angle.eq(270)) {\n      result = new Decimal(0);\n    }\n    result = Decimal.cos(convertToRadians(angle));\n    const temp = new StoreValue(Types.REAL, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n\n  const block = new Commands.CommandBlock([], [new Commands.SysCall(cosFun)]);\n  const func = new Commands.Function(\n    \"$cos\",\n    Types.REAL,\n    [\n      new Commands.FormalParameter(\n        new MultiType([Types.INTEGER, Types.REAL]),\n        \"x\",\n        false\n      )\n    ],\n    block\n  );\n  return func;\n}\n\nexport function createTanFun () {\n  const tanFun = async function (sto, _) {\n    const x = sto.applyStore('x');\n    const angle = x.get().mod(360);\n    if(angle.eq(90) || angle.eq(270)) {\n      throw ProcessorErrorFactory.undefined_tanget_value(x.get().toNumber(),\n        this.function_call_stack.pop());\n    }\n    const result = Decimal.tan(convertToRadians(angle));\n    const temp = new StoreValue(Types.REAL, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n\n  const block = new Commands.CommandBlock([], [new Commands.SysCall(tanFun)]);\n  const func = new Commands.Function(\n    \"$tan\",\n    Types.REAL,\n    [\n      new Commands.FormalParameter(\n        new MultiType([Types.INTEGER, Types.REAL]),\n        \"x\",\n        false\n      )\n    ],\n    block\n  );\n  return func;\n}\n\nexport function createSqrtFun () {\n  const sqrtFun = async function (sto, _) {\n    const x = sto.applyStore('x');\n    if(x.get().isNeg()) {\n      return Promise.reject(ProcessorErrorFactory.negative_sqrt_value(this.function_call_stack.pop()));\n    }\n    const result = x.get().sqrt();\n    const temp = new StoreValue(Types.REAL, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n\n  const block = new Commands.CommandBlock([], [new Commands.SysCall(sqrtFun)]);\n  const func = new Commands.Function(\n    \"$sqrt\",\n    Types.REAL,\n    [\n      new Commands.FormalParameter(\n        new MultiType([Types.INTEGER, Types.REAL]),\n        \"x\",\n        false\n      )\n    ],\n    block\n  );\n  return func;\n}\n\nexport function createPowFun () {\n  const powFun = async (sto, _) => {\n    const x = sto.applyStore('x');\n    const y = sto.applyStore('y');\n    const result = x.get().pow(y.get());\n    const temp = new StoreValue(Types.REAL, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n\n  const block = new Commands.CommandBlock([], [new Commands.SysCall(powFun)]);\n  const func = new Commands.Function(\n    \"$pow\",\n    Types.REAL,\n    [\n      new Commands.FormalParameter(\n        new MultiType([Types.INTEGER, Types.REAL]),\n        \"x\",\n        false\n      ),\n      new Commands.FormalParameter(\n        new MultiType([Types.INTEGER, Types.REAL]),\n        \"y\",\n        false\n      )\n    ],\n    block\n  );\n  return func;\n}\n\nexport function createLogFun () {\n  const logFun = async function (sto, _) {\n    const x = sto.applyStore('x');\n    if (x.get().isNegative()) {\n      return Promise.reject(\n        ProcessorErrorFactory.negative_log_value(this.function_call_stack.pop())\n      );\n    }\n    const result = Decimal.log10(x.get());\n    const temp = new StoreValue(Types.REAL, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n\n  const block = new Commands.CommandBlock([], [new Commands.SysCall(logFun)]);\n  const func = new Commands.Function(\n    \"$log\",\n    Types.REAL,\n    [\n      new Commands.FormalParameter(\n        new MultiType([Types.INTEGER, Types.REAL]),\n        \"x\",\n        false\n      )\n    ],\n    block\n  );\n  return func;\n}\n\nexport function createAbsFun () {\n  const absFun = async (sto, _) => {\n    const x = sto.applyStore('x');\n    const result = x.get().abs();\n    const temp = new StoreValue(x.type, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n\n  const block = new Commands.CommandBlock([], [new Commands.SysCall(absFun)]);\n  const func = new Commands.Function(\n    \"$abs\",\n    new MultiType([Types.INTEGER, Types.REAL]),\n    [\n      new Commands.FormalParameter(\n        new MultiType([Types.INTEGER, Types.REAL]),\n        \"x\",\n        false\n      )\n    ],\n    block\n  );\n  return func;\n}\n\nexport function createNegateFun () {\n  const negateFun = async (sto, _) => {\n    const x = sto.applyStore('x');\n    const result = x.get().negated();\n    const temp = new StoreValue(x.type, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n\n  const block = new Commands.CommandBlock(\n    [],\n    [new Commands.SysCall(negateFun)]\n  );\n  const func = new Commands.Function(\n    \"$negate\",\n    new MultiType([Types.INTEGER, Types.REAL]),\n    [\n      new Commands.FormalParameter(\n        new MultiType([Types.INTEGER, Types.REAL]),\n        \"x\",\n        false\n      )\n    ],\n    block\n  );\n  return func;\n}\n\nexport function createInvertFun () {\n  const invertFun = async (sto, _) => {\n    const x = sto.applyStore('x');\n    const result = Parsers.toReal(1).dividedBy(x.get());\n    const temp = new StoreValue(Types.REAL, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n\n  const block = new Commands.CommandBlock(\n    [],\n    [new Commands.SysCall(invertFun)]\n  );\n  const func = new Commands.Function(\n    \"$invert\",\n    Types.REAL,\n    [\n      new Commands.FormalParameter(\n        new MultiType([Types.INTEGER, Types.REAL]),\n        \"x\",\n        false\n      )\n    ],\n    block\n  );\n  return func;\n}\n\nexport function createMaxFun () {\n  const maxFun = async (sto, _) => {\n    const x = sto.applyStore('x');\n    const numbers = x.get().map(sto_addrs => sto_addrs.get());\n    const result = Decimal.max(...numbers);\n    const temp = new StoreValue(x.type.innerType, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n  const paramType = new ArrayType(\n    new MultiType([Types.INTEGER, Types.REAL]),\n    1\n  );\n  const block = new Commands.CommandBlock([], [new Commands.SysCall(maxFun)]);\n  const func = new Commands.Function(\n    \"$max\",\n    new MultiType([Types.INTEGER, Types.REAL]),\n    [new Commands.FormalParameter(paramType, \"x\", false)],\n    block\n  );\n  return func;\n}\n\nexport function createMinFun () {\n  const minFun = async (sto, _) => {\n    const x = sto.applyStore('x');\n    const numbers = x.get().map(sto_addrs => sto_addrs.get());\n    const result = Decimal.min(...numbers);\n    const temp = new StoreValue(x.type.innerType, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n  const paramType = new ArrayType(\n    new MultiType([Types.INTEGER, Types.REAL]),\n    1\n  );\n  const block = new Commands.CommandBlock([], [new Commands.SysCall(minFun)]);\n  const func = new Commands.Function(\n    \"$min\",\n    new MultiType([Types.INTEGER, Types.REAL]),\n    [new Commands.FormalParameter(paramType, \"x\", false)],\n    block\n  );\n  return func;\n}\n\nlet seed = Date.now();\nexport function createRandFun () {\n  const a = 16807;\n  const m = 2147483647;\n  const c = 12345;\n  const randFun = async (sto, _) => {\n    seed = (a * seed + c) % m;\n    const val = seed / (m - 1);\n    const temp = new StoreValue(Types.REAL, new Decimal(val));\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n  const block = new Commands.CommandBlock([], [new Commands.SysCall(randFun)]);\n  const func = new Commands.Function(\"$rand\", Types.REAL, [], block);\n  return func;\n}\n\nexport function createSetSeedFun () {\n  const setSeedFun = async (sto, _) => {\n    const value = sto.applyStore(\"x\");\n    seed = value.get().toNumber();\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n  const block = new Commands.CommandBlock(\n    [],\n    [new Commands.SysCall(setSeedFun)]\n  );\n  const func = new Commands.Function(\n    \"$setSeed\",\n    Types.VOID,\n    [new Commands.FormalParameter(Types.INTEGER, \"x\", false)],\n    block\n  );\n  return func;\n}\n","import { LanguageService } from '../services/languageService';\nimport {createInputFun, createOutputFun} from './lib/io';\nimport {createLengthFun, createLowercaseFun,\n  createrCharAtFun, createSubstringFun,\n  createUppercaseFun} from './lib/strings';\nimport {createMatrixColumnsFun, createMatrixLinesFun,\n  createNumElementsFun} from './lib/arrays';\nimport {createCastBoolFun, createCastIntFun,\n  createCastRealFun, createCastStringFun,\n  createIsBoolFun, createIsIntFun,\n  createIsRealFun, createCastCharFun} from './lib/lang';\nimport {createAbsFun, createCosFun,\n  createInvertFun, createLogFun,\n  createMaxFun, createMinFun,\n  createNegateFun, createPowFun,\n  createSinFun, createSqrtFun,\n  createTanFun, createRandFun} from './lib/math';\n\nfunction valueToKey (value, object) {\n  for (const key in object) {\n    if(Object.prototype.hasOwnProperty.call(object, key)){\n      if (object[key] === value) {\n        return key;\n      }\n    }\n  }\n  return null;\n}\n\nfunction concatObjects (...objs) {\n  const result = {};\n  for (let i = 0; i < objs.length; i++) {\n    const obj = objs[i];\n    for(const key in obj) {\n      if(Object.prototype.hasOwnProperty.call(obj, key)) {\n        result[key] = obj[key];\n      }\n    }\n  }\n  return result;\n}\n\nconst libsObject = {\n  $mathLib: {\n    $sin: createSinFun(),\n    $cos: createCosFun(),\n    $tan: createTanFun(),\n    $sqrt: createSqrtFun(),\n    $pow: createPowFun(),\n    $log: createLogFun(),\n    $abs: createAbsFun(),\n    $negate: createNegateFun(),\n    $invert: createInvertFun(),\n    $max: createMaxFun(),\n    $min: createMinFun(),\n    $rand: createRandFun()\n  },\n  $ioLib: {\n    $read: createInputFun(),\n    $write: createOutputFun()\n  },\n  $strLib: {\n    $substring: createSubstringFun(),\n    $length: createLengthFun(),\n    $uppercase: createUppercaseFun(),\n    $lowercase: createLowercaseFun(),\n    $charAt: createrCharAtFun(),\n  },\n  $arrayLib: {\n    $numElements: createNumElementsFun(),\n    $matrixLines: createMatrixLinesFun(),\n    $matrixColumns: createMatrixColumnsFun()\n  },\n  $langLib: {\n    $isReal: createIsRealFun(),\n    $isInt: createIsIntFun(),\n    $isBool: createIsBoolFun(),\n    $castReal: createCastRealFun(),\n    $castInt: createCastIntFun(),\n    $castBool: createCastBoolFun(),\n    $castString: createCastStringFun(),\n    $castChar: createCastCharFun()\n  }\n}\n\nconst funcsObject = concatObjects(libsObject.$ioLib, libsObject.$langLib,\n  libsObject.$strLib, libsObject.$arrayLib);\n\nexport const LanguageDefinedFunction = Object.freeze({\n  getMainFunctionName: () => LanguageService.getCurrentLangFuncs().main_function,\n  getInternalName: (localName) => {\n    if (localName.indexOf(\".\") !== -1) {\n      const names = localName.split(\".\");\n      const lib = valueToKey(names[0], LanguageService.getCurrentLangLibs());\n      const internalName = valueToKey(names[1], LanguageService.getCurrentLangFuncs());\n      if (lib === null || internalName === null) {\n        return null;\n      }\n      return lib + \".\" + internalName;\n    }\n    const funcName = valueToKey(localName, LanguageService.getCurrentLangFuncs());\n    if(funcName !== null) {\n      if(funcsObject[funcName]) {\n        return funcName;\n      }\n    }\n    return null;\n  },\n  getFunction: (internalName) => {\n    if (internalName.indexOf(\".\") !== -1) {\n      const names = internalName.split(\".\");\n      const libName = names[0];\n      const funName = names[1];\n      return libsObject[libName][funName];\n    }\n    return funcsObject[internalName];\n  },\n  getLocalName: (internalName) => {\n    if (internalName.indexOf(\".\") !== -1) {\n      const names = internalName.split(\".\");\n      const libName = LanguageService.getCurrentLangLibs()[names[0]];\n      const funName = LanguageService.getCurrentLangFuncs()[names[1]];\n      return `${libName}.${funName}`;\n    } else if (LanguageService.getCurrentLangFuncs()[internalName]) {\n      return LanguageService.getCurrentLangFuncs()[internalName];\n    } else { \n      return internalName\n    }\n  }\n});","import * as Commands from \"./../../ast/commands\";\nimport { Modes } from \"../modes\";\nimport * as Parsers from \"./../../typeSystem/parsers\";\nimport { Types } from \"./../../typeSystem/types\";\nimport { ProcessorErrorFactory } from \"./../error/processorErrorFactory\";\nimport { StoreValue } from \"../store/value/store_value\";\n\nexport function createOutputFun () {\n  const writeFunction = async function (store, _) {\n    const totalSV = store.applyStore(\"p1.0\");\n    const total = totalSV.get();\n    for (let i = 1; i < total; i += 1) {\n      const val = store.applyStore(`p1.${i}`);\n      this.output.sendOutput(Parsers.convertToString(val.get(), val.type));\n    }\n    store.mode = Modes.RETURN;\n    return store;\n  };\n  const block = new Commands.CommandBlock(\n    [],\n    [new Commands.SysCall(writeFunction)]\n  );\n  const func = new Commands.Function(\n    \"$write\",\n    Types.VOID,\n    [new Commands.FormalParameter(Types.ALL, \"p1\", false, true)],\n    block\n  );\n  return func;\n}\n\nexport function createInputFun () {\n  const readFunction = async function (store, _) {\n    const text = await this.input.requestInput();\n    const typeToConvert = store.applyStore(\"p1\").type;\n    let type = null;\n    let result = null;\n    try {\n      if (typeToConvert.isCompatible(Types.INTEGER)) {\n        result = Parsers.toInt(text.trim()).trunc();\n        type = Types.INTEGER;\n      } else if (typeToConvert.isCompatible(Types.REAL)) {\n        result = Parsers.toReal(text.trim());\n        type = Types.REAL;\n      } else if (typeToConvert.isCompatible(Types.BOOLEAN)) {\n        result = Parsers.toBool(text.trim());\n        type = Types.BOOLEAN;\n      } else if (typeToConvert.isCompatible(Types.STRING)) {\n        result = Parsers.toString(text);\n        type = Types.STRING;\n      } else if (typeToConvert.isCompatible(Types.CHAR)) {\n        result = Parsers.toChar(text);\n        type = Types.CHAR;\n      } else {\n        throw new Error(\"!!!!Critical error: Unknown type in readFunction!!!!\");\n      }\n    } catch (_) {\n      if (this.mode == Modes.ABORT) {\n        store.mode = Modes.RETURN;\n        return store;\n      }\n      const stringInfo = typeToConvert.stringInfo()[0];\n      const realObject = store.getStoreObject(\"p1\");\n      if (realObject.getReferenceDimension() > 0) {\n        const arrayInfo = realObject.type.stringInfo()[0];\n        const dim = realObject.getReferenceDimension();\n        throw ProcessorErrorFactory.invalid_read_type_array(\n          text,\n          stringInfo.type,\n          stringInfo.dim,\n          realObject.getRefObj(),\n          arrayInfo.type,\n          dim,\n          this.function_call_stack.pop()\n        );\n      }\n      throw ProcessorErrorFactory.invalid_read_type(\n        text,\n        stringInfo.type,\n        stringInfo.dim,\n        realObject.getRefObj(),\n        this.function_call_stack.pop()\n      );\n    }\n    const stoValue = new StoreValue(type, result);\n    store.updateStore(\"p1\", stoValue);\n    store.mode = Modes.RETURN;\n    return store;\n  };\n  const block = new Commands.CommandBlock(\n    [],\n    [new Commands.SysCall(readFunction)]\n  );\n  const func = new Commands.Function(\n    \"$read\",\n    Types.VOID,\n    [new Commands.FormalParameter(Types.ALL, \"p1\", true)],\n    block\n  );\n  return func;\n}\n","import * as Commands from './../../ast/commands';\nimport { Types } from './../../typeSystem/types';\nimport { toInt } from \"./../../typeSystem/parsers\";\nimport { Modes } from '../modes';\nimport { StoreValue } from '../store/value/store_value';\nimport { ProcessorErrorFactory } from '../error/processorErrorFactory';\n\n/*\n*  substring\n*  length\n*  uppercase\n*  lowercase\n*  charAt\n**/\n\nexport function createSubstringFun () {\n  const substringFun = async (sto, _) => {\n    const str = sto.applyStore(\"str\");\n    const start = sto.applyStore(\"start\");\n    const end = sto.applyStore(\"end\");\n    const result = str.get().substring(start.get(), end.get());\n    const temp = new StoreValue(Types.STRING, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n\n  const block = new Commands.CommandBlock([],  [new Commands.SysCall(substringFun)]);\n  const func = new Commands.Function('$substring', Types.STRING,\n    [new Commands.FormalParameter(Types.STRING, 'str', false),\n    new Commands.FormalParameter(Types.INTEGER, 'start', false),\n    new Commands.FormalParameter(Types.INTEGER, 'end', false)],\n    block);\n  return func;\n}\n\nexport function createLengthFun () {\n  const lengthFun = async (sto, _) => {\n    const str = sto.applyStore(\"str\");\n    const temp = new StoreValue(Types.INTEGER, toInt(str.value.length));\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  }\n  const block = new Commands.CommandBlock([],  [new Commands.SysCall(lengthFun)]);\n  const func = new Commands.Function('$length', Types.INTEGER,\n    [new Commands.FormalParameter(Types.STRING, 'str', false)],\n    block);\n  return func;\n}\n\nexport function createUppercaseFun () {\n  const uppercaseFun = async (sto, _) => {\n    const str = sto.applyStore(\"str\");\n    const temp = new StoreValue(Types.STRING, str.get().toUpperCase());\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  }\n  const block = new Commands.CommandBlock([],  [new Commands.SysCall(uppercaseFun)]);\n  const func = new Commands.Function('$uppercase', Types.STRING,\n    [new Commands.FormalParameter(Types.STRING, 'str', false)],\n    block);\n  return func;\n}\n\nexport function createLowercaseFun () {\n  const lowercaseFun = async (sto, _) => {\n    const str = sto.applyStore(\"str\");\n    const temp = new StoreValue(Types.STRING, str.get().toLowerCase());\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  }\n  const block = new Commands.CommandBlock([],  [new Commands.SysCall(lowercaseFun)]);\n  const func = new Commands.Function('$lowercase', Types.STRING,\n    [new Commands.FormalParameter(Types.STRING, 'str', false)],\n    block);\n  return func;\n}\n\nexport function createrCharAtFun () {\n  const charAtFun = async function (sto, _) {\n    const str = sto.applyStore(\"str\");\n    const idx = sto.applyStore(\"index\");\n    if (idx.get().toNumber() < 0 || idx.get().toNumber() >= str.get().length) {\n      throw ProcessorErrorFactory.invalid_string_index(idx.get().toNumber(), str.get(),\n        this.function_call_stack.pop());\n    }\n    const temp = new StoreValue(Types.CHAR, str.get().charAt(idx.get().toNumber()));\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  }\n  const block = new Commands.CommandBlock([],  [new Commands.SysCall(charAtFun)]);\n  const func = new Commands.Function('$charAt', Types.CHAR,\n    [new Commands.FormalParameter(Types.STRING, 'str', false),\n    new Commands.FormalParameter(Types.INTEGER, 'index', false)],\n    block);\n  return func;\n}\n","import * as Commands from './../../ast/commands';\nimport { Types } from './../../typeSystem/types';\nimport { toInt } from \"./../../typeSystem/parsers\";\nimport { ArrayType } from '../../typeSystem/array_type';\nimport { Modes } from '../modes';\nimport { StoreValue } from '../store/value/store_value';\n\n/**\n * num_elements\n * matrix_lines\n * matrix_columns\n */\n\nexport function createNumElementsFun () {\n  const numElementsFun = async (sto, _) => {\n    const vector  = sto.applyStore(\"vector\");\n    const temp = new StoreValue(Types.INTEGER, toInt(vector.lines));\n    sto.mode = Modes.RETURN;\n    sto.insertStore(\"$\", temp);\n    return sto;\n  }\n\n  const block = new Commands.CommandBlock([],  [new Commands.SysCall(numElementsFun)]);\n  const func = new Commands.Function('$numElements', Types.INTEGER,\n    [new Commands.FormalParameter(new ArrayType(Types.ALL, 1), 'vector', false)],\n    block);\n  return func;\n }\n\nexport function createMatrixLinesFun () {\n  const matrixLinesFun = async (sto, _) => {\n    const matrix  = sto.applyStore(\"matrix\");\n    const temp = new StoreValue(Types.INTEGER, toInt(matrix.lines));\n    sto.mode = Modes.RETURN;\n    sto.insertStore(\"$\", temp);\n    return sto;\n  }\n\n  const block = new Commands.CommandBlock([],  [new Commands.SysCall(matrixLinesFun)]);\n  const func = new Commands.Function('$matrixLines', Types.INTEGER,\n    [new Commands.FormalParameter(new ArrayType(Types.ALL, 2), 'matrix', false)],\n    block);\n  return func;\n }\n\nexport function createMatrixColumnsFun () {\n  const matrixColumnsFun = async (sto, _) => {\n    const matrix  = sto.applyStore(\"matrix\");\n    const temp = new StoreValue(Types.INTEGER, toInt(matrix.columns));\n    sto.mode = Modes.RETURN;\n    sto.insertStore(\"$\", temp);\n    return sto;\n  }\n\n  const block = new Commands.CommandBlock([],  [new Commands.SysCall(matrixColumnsFun)]);\n  const func = new Commands.Function('$matrixColumns', Types.INTEGER,\n    [new Commands.FormalParameter(new ArrayType(Types.ALL, 2), 'matrix', false)],\n    block);\n  return func;\n }\n ","import * as Commands from \"./../../ast/commands\";\nimport { Types } from \"./../../typeSystem/types\";\nimport * as Parsers from \"./../../typeSystem/parsers\";\nimport { IVProgParser } from \"../../ast/ivprogParser\";\nimport { RealLiteral, IntLiteral, BoolLiteral } from \"../../ast/expressions\";\nimport { Modes } from \"../modes\";\nimport { MultiType } from \"../../typeSystem/multiType\";\nimport { ProcessorErrorFactory } from \"../error/processorErrorFactory\";\nimport { StoreValue } from \"../store/value/store_value\";\n\n/**\n *\n * is_real\n * is_int\n * is_bool\n * cast_real\n * cast_int\n * cast_bool\n * cast_string\n * cast_char\n */\n\nexport function createIsRealFun () {\n  const isRealFun = async (sto, _) => {\n    const str = sto.applyStore(\"str\");\n    const parser = IVProgParser.createParser(str.get());\n    let result = false;\n    try {\n      const val = parser.parseTerm();\n      if (val instanceof RealLiteral) {\n        result = true;\n      }\n    } catch (error) {\n      // ignore\n    }\n    const temp = new StoreValue(Types.BOOLEAN, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n\n  const block = new Commands.CommandBlock(\n    [],\n    [new Commands.SysCall(isRealFun)]\n  );\n  const func = new Commands.Function(\n    \"$isReal\",\n    Types.BOOLEAN,\n    [new Commands.FormalParameter(Types.STRING, \"str\", false)],\n    block\n  );\n  return func;\n}\n\nexport function createIsIntFun () {\n  const isIntFun = async (sto, _) => {\n    const str = sto.applyStore(\"str\");\n    const parser = IVProgParser.createParser(str.get());\n    let result = false;\n    try {\n      const val = parser.parseTerm();\n      if (val instanceof IntLiteral) {\n        result = true;\n      }\n    } catch {\n      // ignore\n    }\n    const temp = new StoreValue(Types.BOOLEAN, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n\n  const block = new Commands.CommandBlock([], [new Commands.SysCall(isIntFun)]);\n  const func = new Commands.Function(\n    \"$isInt\",\n    Types.BOOLEAN,\n    [new Commands.FormalParameter(Types.STRING, \"str\", false)],\n    block\n  );\n  return func;\n}\n\nexport function createIsBoolFun () {\n  const isBoolFun = (sto, _) => {\n    const str = sto.applyStore(\"str\");\n    const parser = IVProgParser.createParser(str.get());\n    let result = false;\n    try {\n      const val = parser.parseTerm();\n      if (val instanceof BoolLiteral) {\n        result = true;\n      }\n    } catch (error) {\n      // ignore\n    }\n    const temp = new StoreValue(Types.BOOLEAN, result);\n    sto.insertStore(\"$\", temp);\n    sto.mode = Modes.RETURN;\n    return sto;\n  };\n\n  const block = new Commands.CommandBlock(\n    [],\n    [new Commands.SysCall(isBoolFun)]\n  );\n  const func = new Commands.Function(\n    \"$isBool\",\n    Types.BOOLEAN,\n    [new Commands.FormalParameter(Types.STRING, \"str\", false)],\n    block\n  );\n  return func;\n}\n\nexport function createCastRealFun () {\n  const castRealFun = async (sto, _) => {\n    const val = sto.applyStore(\"val\");\n    let value = val.get();\n    switch (val.type.ord) {\n      case Types.INTEGER.ord: {\n        value = value.toNumber();\n        const temp = new StoreValue(Types.REAL, Parsers.toReal(value));\n        sto.insertStore(\"$\", temp);\n        sto.mode = Modes.RETURN;\n        return sto;\n      }\n      case Types.STRING.ord: {\n        const parser = IVProgParser.createParser(value);\n        try {\n          const result = parser.parseTerm();\n          if (result instanceof RealLiteral) {\n            const temp = new StoreValue(\n              Types.REAL,\n              Parsers.toReal(result.value)\n            );\n            sto.insertStore(\"$\", temp);\n            sto.mode = Modes.RETURN;\n            return sto;\n          }\n        } catch (error) {\n          // ignore\n        }\n      }\n    }\n    const typeStringInfoArray = Types.REAL.stringInfo();\n    const typeInfo = typeStringInfoArray[0];\n    throw ProcessorErrorFactory.invalid_type_conversion(\n      value,\n      typeInfo.type,\n      typeInfo.dim\n    );\n  };\n\n  const block = new Commands.CommandBlock(\n    [],\n    [new Commands.SysCall(castRealFun)]\n  );\n  const func = new Commands.Function(\n    \"$castReal\",\n    Types.REAL,\n    [\n      new Commands.FormalParameter(\n        new MultiType([Types.INTEGER, Types.STRING]),\n        \"val\",\n        false\n      ),\n    ],\n    block\n  );\n  return func;\n}\n\nexport function createCastIntFun () {\n  const castIntFun = async (sto, _) => {\n    const val = sto.applyStore(\"val\");\n    let value = val.get();\n    switch (val.type.ord) {\n      case Types.REAL.ord: {\n        value = value.toNumber();\n        const temp = new StoreValue(\n          Types.INTEGER,\n          Parsers.toInt(Math.floor(value))\n        );\n        sto.insertStore(\"$\", temp);\n        sto.mode = Modes.RETURN;\n        return sto;\n      }\n      case Types.CHAR.ord: {\n        const temp = new StoreValue(\n          Types.INTEGER,\n          Parsers.toInt(value.charCodeAt(0))\n        );\n        sto.insertStore(\"$\", temp);\n        sto.mode = Modes.RETURN;\n        return sto;\n      }\n      case Types.STRING.ord: {\n        const parser = IVProgParser.createParser(value);\n        try {\n          const result = parser.parseTerm();\n          if (result instanceof IntLiteral) {\n            const temp = new StoreValue(\n              Types.INTEGER,\n              Parsers.toInt(result.value)\n            );\n            sto.insertStore(\"$\", temp);\n            sto.mode = Modes.RETURN;\n            return sto;\n          }\n        } catch (error) {\n          // ignore\n        }\n      }\n    }\n    const typeStringInfoArray = Types.INTEGER.stringInfo();\n    const typeInfo = typeStringInfoArray[0];\n    throw ProcessorErrorFactory.invalid_type_conversion(\n      value,\n      typeInfo.type,\n      typeInfo.dim\n    );\n  };\n\n  const block = new Commands.CommandBlock(\n    [],\n    [new Commands.SysCall(castIntFun)]\n  );\n  const func = new Commands.Function(\n    \"$castInt\",\n    Types.INTEGER,\n    [\n      new Commands.FormalParameter(\n        new MultiType([Types.REAL, Types.STRING, Types.CHAR]),\n        \"val\",\n        false\n      ),\n    ],\n    block\n  );\n  return func;\n}\n\nexport function createCastBoolFun () {\n  const castBoolFun = async (sto, _) => {\n    const str = sto.applyStore(\"str\");\n    const value = str.get();\n    const parser = IVProgParser.createParser(value);\n    try {\n      const val = parser.parseTerm();\n      if (val instanceof BoolLiteral) {\n        const temp = new StoreValue(Types.BOOLEAN, val.value);\n        sto.insertStore(\"$\", temp);\n        sto.mode = Modes.RETURN;\n        return sto;\n      }\n    } catch (error) {\n      // ignore\n    }\n    const typeStringInfoArray = Types.BOOLEAN.stringInfo();\n    const typeInfo = typeStringInfoArray[0];\n    throw ProcessorErrorFactory.invalid_type_conversion(\n      value,\n      typeInfo.type,\n      typeInfo.dim\n    );\n  };\n\n  const block = new Commands.CommandBlock(\n    [],\n    [new Commands.SysCall(castBoolFun)]\n  );\n  const func = new Commands.Function(\n    \"$castBool\",\n    Types.BOOLEAN,\n    [new Commands.FormalParameter(Types.STRING, \"str\", false)],\n    block\n  );\n  return func;\n}\n\nexport function createCastStringFun () {\n  const castStringFun = async function (store, _) {\n    const val = store.applyStore(\"str\");\n    const result = Parsers.convertToString(val.get(), val.type);\n    const temp = new StoreValue(Types.STRING, result);\n    store.insertStore(\"$\", temp);\n    store.mode = Modes.RETURN;\n    return store;\n  };\n  const block = new Commands.CommandBlock(\n    [],\n    [new Commands.SysCall(castStringFun)]\n  );\n  const func = new Commands.Function(\n    \"$castString\",\n    Types.STRING,\n    [new Commands.FormalParameter(Types.ALL, \"str\", false)],\n    block\n  );\n  return func;\n}\n\nexport function createCastCharFun () {\n  const castCharFun = (store, _) => {\n    const valSV = store.applyStore(\"charCode\");\n    // Force the int value to the range [0, 255]\n    const value = valSV.get().toNumber() & 0xff;\n    const result = String.fromCharCode(value);\n    const temp = new StoreValue(Types.CHAR, result);\n    store.insertStore(\"$\", temp);\n    store.mode = Modes.RETURN;\n    return store;\n  };\n  const block = new Commands.CommandBlock(\n    [],\n    [new Commands.SysCall(castCharFun)]\n  );\n  const func = new Commands.Function(\n    \"$castChar\",\n    Types.CHAR,\n    [new Commands.FormalParameter(Types.INTEGER, \"charCode\", false)],\n    block\n  );\n  return func;\n}\n\n","import line_i18n from \"line-i18n\";\nimport Langs from \"./../../i18n\";\nimport { LanguageService } from \"./languageService\";\nimport { LanguageDefinedFunction } from \"./../processor/definedFunctions\";\nimport { Operators } from \"./../ast/operators\";\n\nclass IVProgLocalizedStrings extends line_i18n.LocalizedStrings {\n  constructor (langService, langsJsons, shouldListenToChange = false) {\n    super(langService, langsJsons, shouldListenToChange);\n  }\n\n  translateType (type, dim) {\n    const type_string = this.getUI(`type_${type}`);\n    switch (dim) {\n      case 0:\n        return type_string;\n      default:\n        if (dim > 1) return this.getUI(\"matrix_info_string\", [type_string]);\n        else return this.getUI(\"vector_info_string\", [type_string]);\n    }\n  }\n\n  translateOp (op) {\n    switch (op.ord) {\n      case Operators.AND.ord:\n      case Operators.OR.ord:\n      case Operators.NOT.ord:\n        return this.getUI(`logic_operator_${op.value}`);\n      default:\n        return op.value;\n    }\n  }\n\n  translateInternalFunction (name, category = null) {\n    if (category == null) {\n      return LanguageDefinedFunction.getLocalName(name);\n    } else {\n      return LanguageDefinedFunction.getLocalName(`${category}.${name}`);\n    }\n  }\n}\n\nexport const LocalizedStrings = Object.freeze(\n  new IVProgLocalizedStrings(LanguageService, Langs)\n);\n\nconst _instance = new IVProgLocalizedStrings(LanguageService, Langs);\n\nexport function getInstance () {\n  return _instance;\n}\n","import line_i18n from \"line-i18n\";\nimport { LocalizedStrings } from \"./localizedStringsService\";\n\nconst StringTypes = line_i18n.StringTypes;\n\nexport const i18nHelper = Object.freeze({\n  i18n: (identifier) => {\n    var opts = identifier.split(':');\n    var type = opts[0].toLowerCase();\n    var id = opts[1];\n    if (StringTypes.ERROR === type) {\n      return LocalizedStrings.getError(id);\n    } else if (StringTypes.MESSAGE === type) {\n      return LocalizedStrings.getMessage(id); \n    } else if (StringTypes.UI === type) {\n      return LocalizedStrings.getUI(id);\n    } else {\n      console.warn(\"A string has been passed to the i18n helper function that was not in the form type:id -> \" + identifier);\n      return LocalizedStrings.getString(identifier, type);\n    }\n  }\n});","import { LanguageService } from \"./../services/languageService\";\nimport { LocalizedStrings } from \"./../services/localizedStringsService\";\nimport { Operators } from \"./../ast/operators\";\n\n/**\n *\n * source: https://stackoverflow.com/a/16270434\n */\nexport function isElementInViewport (el) {\n  const rect = el.getBoundingClientRect();\n\n  return (\n    rect.bottom > 0 &&\n    rect.right > 0 &&\n    rect.left < (window.innerWidth || document.documentElement.clientWidth) &&\n    rect.top < (window.innerHeight || document.documentElement.clientHeight)\n  );\n}\n\nlet cacheMainList = null;\nlet cacheOp = null;\n\nfunction fillCache () {\n  if (cacheMainList == null) {\n    cacheMainList = [];\n    const mainList = [\n      \"RK_PROGRAM\",\n      \"RK_REAL\",\n      \"RK_VOID\",\n      \"RK_BOOLEAN\",\n      \"RK_STRING\",\n      \"RK_INTEGER\",\n      \"RK_CHARACTER\",\n      \"RK_SWITCH\",\n      \"RK_CASE\",\n      \"RK_DEFAULT\",\n      \"RK_CONST\",\n      \"RK_FUNCTION\",\n      \"RK_RETURN\",\n      \"RK_FOR\",\n      \"RK_BREAK\",\n      \"RK_DO\",\n      \"RK_WHILE\",\n      \"RK_IF\",\n      \"RK_ELSE\",\n      \"RK_FALSE\",\n      \"RK_TRUE\",\n    ];\n    const lexer = LanguageService.getCurrentLexer();\n    const names = lexer.getReservedKeys();\n    for (let key = 0; key < mainList.length; ++key) {\n      const word = mainList[key];\n      const keyword = names[word];\n      cacheMainList.push(keyword);\n    }\n  }\n  if (cacheOp == null) {\n    cacheOp = [];\n    const logicOpList = [\n      Operators.AND.value,\n      Operators.OR.value,\n      Operators.NOT.value,\n    ];\n    for (let op = 0; op < logicOpList.length; ++op) {\n      const lOp = `logic_operator_${logicOpList[op]}`;\n      cacheOp.push(LocalizedStrings.getUI(lOp));\n    }\n  }\n}\n\nexport function isKeyword (text) {\n  fillCache();\n  for (let key = 0; key < cacheMainList.length; ++key) {\n    const keyword = cacheMainList[key];\n    if (keyword == text) {\n      return true;\n    }\n  }\n  // not in main list, check op\n  for (let op = 0; op < cacheOp.length; op++) {\n    const lOp = cacheOp[op];\n    if (lOp == text) {\n      return true;\n    }\n  }\n  return false;\n}\n\nexport function isValidIdentifier (identifier_str) {\n  const validRegex = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);\n  return validRegex && !isKeyword(identifier_str)\n}\n\nexport function getCodeEditorModeConfig () {\n  const blockList = [\n    \"RK_SWITCH\",\n    \"RK_PROGRAM\",\n    \"RK_CASE\",\n    \"RK_DEFAULT\",\n    \"RK_FOR\",\n    \"RK_FOR_ALT\",\n    \"RK_FUNCTION\",\n    \"RK_DO\",\n    \"RK_WHILE\",\n    \"RK_WHILE_ALT\",\n    \"RK_IF\",\n    \"RK_ELSE\",\n  ];\n  const keywordsList = [\n    \"RK_CONST\",\n    \"RK_RETURN\",\n    \"RK_BREAK\",\n    \"RK_FOR_FROM\",\n    \"RK_FOR_TO\",\n    \"RK_FOR_PASS\",\n    \"RK_DO_UNTIL\",\n  ];\n  const typeList = [\n    \"RK_REAL\",\n    \"RK_VOID\",\n    \"RK_BOOLEAN\",\n    \"RK_STRING\",\n    \"RK_INTEGER\",\n    \"RK_CHARACTER\",\n  ];\n  const atomList = [\"RK_FALSE\", \"RK_TRUE\"];\n\n  const case_default = [];\n  const blocks = [];\n  const keywords = [];\n  const types = [];\n  const atoms = [];\n  let switchString = \"\";\n\n  cacheMainList = [];\n  const lexer = LanguageService.getCurrentLexer();\n  const names = lexer.getReservedKeys();\n  //console.debug(names);\n  blockList.forEach((v) => {\n    const keyword = names[v];\n    const value = keyword;\n    cacheMainList.push(value);\n    keywords.push(value);\n    blocks.push(value);\n    if (v == \"RK_SWITCH\") {\n      switchString = value;\n    } else if (v == \"RK_CASE\" || v == \"RK_DEFAULT\") {\n      case_default.push(value);\n    }\n  });\n  keywordsList.forEach((v) => {\n    const keyword = names[v];\n    const value = keyword;\n    cacheMainList.push(value);\n    keywords.push(value);\n  });\n  typeList.forEach((v) => {\n    const keyword = names[v];\n    const value = keyword;\n    cacheMainList.push(value);\n    types.push(value);\n  });\n  atomList.forEach((v) => {\n    const keyword = names[v];\n    const value = keyword;\n    cacheMainList.push(value);\n    atoms.push(value);\n  });\n\n  cacheOp = [];\n  const logicOpList = [\"NOT_OPERATOR\", \"OR_OPERATOR\", \"AND_OPERATOR\"];\n\n  logicOpList.forEach((v) => {\n    const keyword = names[v];\n    const value = keyword;\n    cacheOp.push(value);\n    keywords.push(value);\n  });\n  cacheMainList.push(lexer.getLangFuncs().main_function);\n  return {\n    case_default: case_default,\n    atoms: atoms,\n    keywords: keywords,\n    switchString: switchString,\n    types: types,\n    blocks: blocks,\n  };\n}\n\n/**\n * Source: https://gist.github.com/andrei-m/982927\n * @param {string} a\n * @param {string} b\n */\nexport function levenshteinDistance (a, b) {\n  if (a.length == 0) return b.length;\n  if (b.length == 0) return a.length;\n\n  const matrix = [];\n\n  // increment along the first column of each row\n  let i;\n  for (i = 0; i <= b.length; i++) {\n    matrix[i] = [i];\n  }\n\n  // increment each column in the first row\n  let j;\n  for (j = 0; j <= a.length; j++) {\n    matrix[0][j] = j;\n  }\n\n  // Fill in the rest of the matrix\n  for (i = 1; i <= b.length; i++) {\n    for (j = 1; j <= a.length; j++) {\n      if (b.charCodeAt(i - 1) == a.charCodeAt(j - 1)) {\n        matrix[i][j] = matrix[i - 1][j - 1];\n      } else {\n        matrix[i][j] = Math.min(\n          matrix[i - 1][j - 1] + 1, // substitution\n          Math.min(\n            matrix[i][j - 1] + 1, // insertion\n            matrix[i - 1][j] + 1\n          )\n        ); // deletion\n      }\n    }\n  }\n  return matrix[b.length][a.length];\n}\n\nlet win = null;\nexport function openAssessmentDetail (event) {\n  event.preventDefault();\n  const page_code = event.currentTarget.dataset.page;\n  if (win != null) {\n    win.close();\n  }\n  win = window.open(\"\", \"DetailWindow\", \"width=550,height=600\");\n  win.document.open();\n  win.document.write(page_code);\n  win.document.close();\n}\n\nexport function range (size, startAt = 0) {\n  return [...Array(size).keys()].map((i) => i + startAt);\n}\n\n/**\n *\n * @param {number} ms\n */\nexport async function sleep (ms) {\n  return new Promise((res, _) => setTimeout(res, ms));\n}\n","export function processData () {\n  const folderInput = document.querySelector(\"#folder\");\n  const header = [\n    \"submissionid\",\n    \"file\",\n    \"filesize\",\n    \"timestamp\",\n    \"humandate\",\n    \"grade\",\n    \"userid\",\n    \"exerciseid\",\n  ];\n\n  function generateSubCode (algorithmInIlm) {\n    window.program_obj.functions = JSON.parse(algorithmInIlm).functions;\n    window.program_obj.globals = JSON.parse(algorithmInIlm).globals;\n    return window.ivprogCore.generateCode();\n  }\n\n  function prepareData (map, submission) {\n    if (!submission) {\n      return map;\n    }\n    const exercID = submission[\"exerciseid\"];\n    const studentID = submission[\"userid\"];\n    let exercMap = null;\n    if (map.has(exercID)) {\n      exercMap = map.get(exercID);\n    } else {\n      exercMap = new Map();\n      map.set(exercID, exercMap);\n    }\n    if (exercMap.has(studentID)) {\n      exercMap.get(studentID).push(submission);\n    } else {\n      exercMap.set(studentID, [submission]);\n    }\n    return map;\n  }\n\n  folderInput.addEventListener(\"change\", async () => {\n    const files = Array.from(folderInput.files);\n    const idx = files.find((f) => f.name == \"index.csv\");\n    const folderName = idx.webkitRelativePath.replace(idx.name, \"\");\n    //console.debug(idx);\n    //console.debug(folderName);\n    const data = await idx.text();\n    //console.debug(data);\n    const csvEntries = data\n      .split(\"\\n\")\n      .slice(1)\n      .filter((line) => line.length > 0)\n      .map((line) => line.split(\",\"))\n      .map((vec) => {\n        const obj = {};\n        vec.forEach((val, i) => (obj[header[i]] = val));\n        return obj;\n      });\n    //console.debug(csvEntries);\n    const blockExercMap = csvEntries.reduce(prepareData, new Map());\n    //console.log(Array.from(blockExercMatrix.entries()));\n    const getFilePath = async function (submission) {\n      const path = `${folderName}${submission[\"file\"]}`;\n      const file = files.find((f) => f.webkitRelativePath == path);\n      const text = await file.text();\n      return text;\n    };\n    const matrix = {};\n    let counter = 0;\n    blockExercMap.forEach((studentsMap, exercID) => {\n      const column = [];\n      studentsMap.forEach(async (submissions, studentID) => {\n        submissions = submissions.sort((a, b) => {\n          return parseInt(a[\"timestamp\"]) - parseInt(b[\"timestamp\"]);\n        });\n        counter++;\n        submissions.forEach(async (submission, index, array) => {\n          counter++;\n          const student = {};\n          student[\"grade\"] = Math.max(0, parseFloat(submission[\"grade\"]));\n          student[\"timestamp\"] = parseInt(submission[\"timestamp\"]);\n          student[\"student_id\"] = studentID;\n          student[\"TES\"] = 0;\n          student[\"DES\"] = 0;\n          student[\"D/T\"] = 0;\n          let previousCode = \"\";\n          if (index > 0) {\n            student[\"TES\"] =\n              parseInt(submission[\"timestamp\"]) -\n              parseInt(array[index - 1][\"timestamp\"]);\n            const previousFile = await getFilePath(array[index - 1]);\n            const previous = window.ivprogCore\n              .prepareActivityToStudentHelper(previousFile)\n              .getOrElse(1);\n            if (previous == 1) {\n              console.error(\n                `A submission from ${studentID} to ${exercID} is invalid`\n              );\n              return;\n            }\n            previousCode = generateSubCode(previous.algorithmInIlm);\n          }\n          const currentFile = await getFilePath(submission);\n          const current = window.ivprogCore\n            .prepareActivityToStudentHelper(currentFile)\n            .getOrElse(2);\n          if (current == 2) {\n            console.error(\n              `A submission from ${studentID} to ${exercID} is invalid`\n            );\n            return;\n          }\n          const currentCode = generateSubCode(current.algorithmInIlm);\n          if (previousCode === \"\") {\n            const logs = JSON.parse(currentFile.split(\"::logs::\")[1]);\n            const event = logs[0];\n            if (event == null) {\n              // empty submission\n              student[\"TES\"] = 0;\n            } else if (event.length === 4) {\n              student[\"TES\"] =\n                parseInt(submission[\"timestamp\"]) -\n                Math.floor(parseInt(event[2]) / 1000);\n            } else {\n              student[\"TES\"] =\n                parseInt(submission[\"timestamp\"]) -\n                Math.floor(parseInt(event[1]) / 1000);\n            }\n          }\n          student[\"DES\"] = window.ivprogCore.levenshteinDistance(\n            previousCode,\n            currentCode\n          );\n          const ratio =\n            student[\"TES\"] === 0 ? 0 : student[\"DES\"] / student[\"TES\"];\n          student[\"D/T\"] = isNaN(ratio) ? 0 : ratio;\n          column.push(student);\n          counter--;\n        });\n        counter--;\n      });\n      matrix[exercID] = column;\n    });\n    function download (file, text) {\n      //creating an invisible element\n      const element = document.createElement(\"a\");\n      element.setAttribute(\n        \"href\",\n        \"data:text/plain,\" + encodeURIComponent(text)\n      );\n      element.setAttribute(\"download\", file);\n      element.innerHTML = file;\n      element.classList.add(\"ui\", \"primary\", \"button\");\n\n      // Above code is equivalent to\n      // <a href=\"path of file\" download=\"file name\">\n\n      document.querySelector(\"#downloads\").appendChild(element);\n    }\n    function getExercHeader (id) {\n      const props = [\"TES\", \"DES\", \"grade\", \"D/T\", \"timestamp\"];\n      return props.reduce((acc, prop) => acc + `${id}_${prop},`, \"\");\n    }\n    const id = setInterval(() => {\n      if (counter == 0) {\n        clearInterval(id);\n        for (const exercID in matrix) {\n          let csv = \"\";\n          let firstLine = \"student_id,\";\n          firstLine += getExercHeader(exercID);\n          for (const submission of matrix[exercID]) {\n            csv += `${submission[\"student_id\"]},`;\n            csv += `${submission[\"TES\"]},`;\n            csv += `${submission[\"DES\"]},`;\n            csv += `${submission[\"grade\"]},`;\n            csv += `${submission[\"D/T\"]},`;\n            csv += `${submission[\"timestamp\"]}`;\n            csv += \"\\n\";\n          }\n          download(`${exercID}.csv`, `${firstLine}\\n${csv}`);\n        }\n      }\n    }, 1000);\n  });\n}\n","import { IVProgParser } from \"../ast/ivprogParser\";\nimport * as Expressions from \"../ast/expressions\";\nimport { Types } from \"../typeSystem/types\";\nimport { convertBoolToString } from \"../typeSystem/parsers\";\nimport * as Commands from \"../ast/commands\";\nimport { ArrayType } from \"../typeSystem/array_type\";\nimport { Literal } from \"../ast/expressions/literal\";\n\nconst TYPES = {\n  VARIABLE: \"var\",\n  CONST: \"const\",\n  FUNCTION: \"function\",\n  RELATIONAL: \"relational\",\n  LOGIC: \"logic\",\n  ARITHMETIC: \"arithmetic\",\n};\n\nfunction translateOp (type, op) {\n  switch (type) {\n    case TYPES.ARITHMETIC:\n      return op.value;\n    case TYPES.RELATIONAL:\n      return op.value;\n    case TYPES.LOGIC: {\n      if (op.ord === 11) {\n        return \"and\";\n      } else if (op.ord === 12) {\n        return \"or\";\n      } else {\n        return \"not\";\n      }\n    }\n  }\n}\n\nfunction getOpType (op) {\n  switch (op.ord) {\n    case 0:\n    case 1:\n    case 2:\n    case 3:\n    case 4:\n      return TYPES.ARITHMETIC;\n    case 5:\n    case 6:\n    case 7:\n    case 8:\n    case 9:\n    case 10:\n      return TYPES.RELATIONAL;\n    default:\n      return TYPES.LOGIC;\n  }\n}\n\n/**\n * @param {Commands.Case} switchCase\n * */\nfunction switchCaseWalker (switchCase) {\n  const commands = switchCase.commands.map(commandWalker);\n  const expression = switchCase.isDefault\n    ? null\n    : expressionWalker(switchCase.expression);\n  return {\n    type: \"switchcase\",\n    line: switchCase.sourceInfo.line,\n    expression,\n    commands,\n  };\n}\n\n/**\n * @param {Commands.Switch} switchCommand\n * */\nfunction switchWalker (switchCommand) {\n  const expression = expressionWalker(switchCommand.expression);\n  const cases = switchCommand.cases.map(switchCaseWalker);\n  return {\n    type: \"switch\",\n    expression,\n    cases,\n  };\n}\n\n/**\n * @param {Commands.Return} returnCommand\n * */\nfunction returnWalker (returnCommand) {\n  const expression = expressionWalker(returnCommand.expression);\n  return {\n    type: \"return\",\n    expression,\n  };\n}\n\nfunction breakWalker (_) {\n  return { type: \"break\" };\n}\n\n/**\n * @param {Commands.For} forLoop\n * */\nfunction forWalker (forLoop) {\n  const var_attribution = expressionWalker(forLoop.for_id);\n  const var_initial = expressionWalker(forLoop.for_from);\n  const condition = expressionWalker(forLoop.for_to);\n  const step_expression = forLoop.for_pass\n    ? expressionWalker(forLoop.for_pass)\n    : [];\n  const commands = forLoop.commands.map(commandWalker);\n  return {\n    type: \"repeatNtimes\",\n    var_attribution,\n    var_initial,\n    condition,\n    step_expression,\n    commands,\n  };\n}\n\n/**\n * @param {Commands.While} whileLoop\n * */\nfunction whileWalker (whileLoop) {\n  const expression = expressionWalker(whileLoop.expression);\n  const commands = whileLoop.commands.map(commandWalker);\n  let type = whileLoop.testFirst ? \"whiletrue\" : \"dowhiletrue\";\n  return {\n    type,\n    expression,\n    commands,\n  };\n}\n\n/**\n * @param {Commands.IfThenElse} ifthenelse\n * */\nfunction ifThenElseWalker (ifthenelse) {\n  //ifthenelse.\n  const expression = expressionWalker(ifthenelse.condition);\n  const ifTrue = ifthenelse.ifTrue.commands.map(commandWalker);\n  let ifFalse = [];\n  if (ifthenelse.ifFalse) {\n    if (ifthenelse.ifFalse instanceof Commands.CommandBlock) {\n      ifFalse = ifthenelse.ifFalse.commands.map(commandWalker);\n    } else {\n      ifFalse = [ifThenElseWalker(ifthenelse.ifFalse)];\n    }\n  }\n  return {\n    type: \"iftrue\",\n    expression,\n    ifTrue,\n    ifFalse,\n  };\n}\n\n/**\n * @param {Commands.Assign} assingment\n * */\nfunction assignmentWalker (assingment) {\n  let variable = null;\n  if (assingment instanceof Commands.ArrayIndexAssign) {\n    const line = expressionWalker(assingment.line);\n    let arrayClass = \"vector\";\n    let column = null;\n    if (assingment.column) {\n      arrayClass = \"matrix\";\n      column = expressionWalker(assingment.column);\n    }\n    variable = [\n      {\n        instance: \"expression\",\n        type: TYPES.VARIABLE,\n        class: arrayClass,\n        column: column,\n        line: line,\n        value: assingment.id,\n      },\n    ];\n  } else {\n    variable = [\n      { instance: \"expression\", type: TYPES.VARIABLE, value: assingment.id },\n    ];\n  }\n  const expression = expressionWalker(assingment.expression);\n  return {\n    type: \"attribution\",\n    variable,\n    expression,\n  };\n}\n\n/**\n * @param {Command} command\n * */\nfunction commandWalker (command) {\n  let parsedCommand = null;\n  if (command instanceof Commands.FunctionCall) {\n    parsedCommand = functionCallWalker(command);\n  } else if (command instanceof Commands.Assign) {\n    parsedCommand = assignmentWalker(command);\n  } else if (command instanceof Commands.IfThenElse) {\n    parsedCommand = ifThenElseWalker(command);\n  } else if (command instanceof Commands.While) {\n    parsedCommand = whileWalker(command);\n  } else if (command instanceof Commands.Break) {\n    parsedCommand = breakWalker(command);\n  } else if (command instanceof Commands.Return) {\n    parsedCommand = returnWalker(command);\n  } else if (command instanceof Commands.Switch) {\n    parsedCommand = switchWalker(command);\n  } else if (command instanceof Commands.For) {\n    parsedCommand = forWalker(command);\n  } else {\n    throw new Error(\"not implemented\");\n  }\n  parsedCommand.line = command.sourceInfo.line;\n  return parsedCommand;\n}\n\n/**\n * @param {Commands.FunctionCall} functionCall\n * */\nfunction functionCallWalker (functionCall) {\n  let name = functionCall.id;\n  if (name.indexOf(\".\") !== -1) {\n    name = name.split(\".\")[1];\n  }\n  const parameters = functionCall.actualParameters.map(expressionWalker);\n  if (name === \"$write\") {\n    const lastInput = parameters[parameters.length - 1][0];\n    // if lastInput is an object with value === '\\n', newLine is true\n    const newLine = lastInput.value && lastInput.value.match(/^\\n$/) !== null;\n    const content = newLine\n      ? parameters.slice(0, parameters.length - 1)\n      : parameters;\n    return {\n      type: \"writer\",\n      newLine,\n      content,\n    };\n  }\n  if (name === \"$read\") {\n    return {\n      type: \"reader\",\n      variable: parameters[0],\n    };\n  }\n  return {\n    type: \"functioncall\",\n    parameters_list: parameters,\n    name: functionCall.id,\n  };\n}\n/**\n * @param {Commands.Function} func\n * */\nfunction functionWalker (func) {\n  const funcDeclaration = {\n    name: func.name,\n    line: func.sourceInfo.line,\n    return_type: \"\",\n    return_dimensions: 0,\n    parameters_list: [],\n    variables_list: [],\n    commands: [],\n  };\n  if (func.returnType instanceof ArrayType) {\n    funcDeclaration.return_type = func.returnType.innerType.value;\n    funcDeclaration.return_dimensions = func.returnType.dimensions;\n  } else {\n    funcDeclaration.return_type = func.returnType.value;\n  }\n  funcDeclaration.parameters_list = func.formalParameters.map(\n    functionParameterWalker\n  );\n  funcDeclaration.variables_list = func.variablesDeclarations.map(\n    variableDeclarationWalker\n  );\n  funcDeclaration.commands = func.commands.map(commandWalker);\n  return funcDeclaration;\n}\n\n/**\n * @param {Commands.FormalParameter} formalParameter\n * */\nfunction functionParameterWalker (formalParameter) {\n  const variable = {\n    name: formalParameter.id,\n    line: formalParameter.sourceInfo.line,\n    type: \"\",\n    rows: 0,\n    columns: 0,\n    dimension: 0,\n    value: 0,\n    is_const: false,\n    reference: formalParameter.byRef,\n  };\n  if (formalParameter.type instanceof ArrayType) {\n    variable.type = formalParameter.type.innerType.value;\n    variable.dimension = formalParameter.type.dimensions;\n  } else {\n    variable.type = formalParameter.type.value;\n  }\n  return variable;\n}\n\n/**\n * @param {Commands.Declaration} command\n * @param {boolean} global\n * */\nfunction variableDeclarationWalker (command, global = false) {\n  const variable = {\n    name: command.id,\n    line: command.sourceInfo.line,\n    type: \"\",\n    rows: 0,\n    columns: 0,\n    dimension: 0,\n    value: 0,\n    is_const: false,\n  };\n  variable.is_const = global && command.isConst;\n  if (command instanceof Commands.ArrayDeclaration) {\n    // array\n    const lines = expressionWalker(command.lines).pop();\n    variable.type = command.type.innerType.value;\n    if (command.isVector) {\n      variable.columns = lines.value;\n      variable.dimension = 1;\n      const values = command.initial.value.map((exp) =>\n        variableInitialWalker(exp)\n      );\n      variable.value = values;\n    } else {\n      const columns = expressionWalker(command.columns).pop();\n      variable.dimension = 2;\n      variable.rows = lines.value;\n      variable.columns = columns.value;\n      const values = command.initial.value.map((rows) =>\n        rows.value.map((exp) => variableInitialWalker(exp))\n      );\n      variable.value = values;\n    }\n  } else {\n    // atomic\n    variable.type = command.type.value;\n    variable.value = variableInitialWalker(command.initial);\n  }\n  return variable;\n}\n\n/**\n * @param {any} expression\n * */\nfunction variableInitialWalker (expression) {\n  if (expression instanceof Expressions.UnaryApp) {\n    const left = variableInitialWalker(expression.left);\n    const opType = getOpType(expression.op);\n    if (opType !== TYPES.ARITHMETIC) {\n      throw new Error(\n        \"invalid variable initial value: \" + expression.toString()\n      );\n    }\n    return `${expression.op.value}${left}`;\n  } else if (expression instanceof Expressions.BoolLiteral) {\n    const value = expression.value;\n    return convertBoolToString(value);\n  } else if (expression instanceof Literal) {\n    let value = expression.value;\n    if (expression.value.toNumber) {\n      if (\n        Types.REAL.isCompatible(expression.type) &&\n        expression.value.decimalPlaces() == 0\n      ) {\n        value = Number(expression.value.toFixed(2));\n      } else {\n        value = expression.value.toNumber();\n      }\n    }\n    return value;\n  }\n  throw new Error(\"invalid variable initial value: \" + expression.toString());\n}\n\n/**\n *\n * @return {[]}\n **/\nfunction expressionWalker (expression) {\n  let result;\n  if (expression instanceof Expressions.VariableLiteral) {\n    result = [\n      { instance: \"expression\", type: TYPES.VARIABLE, value: expression.id },\n    ];\n  } else if (expression instanceof Expressions.FunctionCall) {\n    const funcObj = {\n      instance: \"expression\",\n      type: TYPES.FUNCTION,\n      value: expression.id,\n    };\n    const paramsList = expression.actualParameters.map((e) =>\n      expressionWalker(e)\n    );\n    //const params = Array.prototype.concat.apply([], paramsList);\n    funcObj.params = paramsList;\n    result = [funcObj];\n  } else if (expression instanceof Expressions.UnaryApp) {\n    const left = expressionWalker(expression.left);\n    const opType = getOpType(expression.op);\n    const opValue = translateOp(opType, expression.op);\n    result = [{ instance: \"operator\", type: opType, value: opValue }, ...left];\n  } else if (expression instanceof Expressions.InfixApp) {\n    const left = expressionWalker(expression.left);\n    const right = expressionWalker(expression.right);\n    const opType = getOpType(expression.op);\n    const opValue = translateOp(opType, expression.op);\n    result = [\n      ...left,\n      { instance: \"operator\", type: opType, value: opValue },\n      ...right,\n    ];\n  } else if (expression instanceof Expressions.ArrayAccess) {\n    const line = expressionWalker(expression.line);\n    let arrayClass = \"vector\";\n    let column = null;\n    if (expression.column) {\n      arrayClass = \"matrix\";\n      column = expressionWalker(expression.column);\n    }\n    result = [\n      {\n        instance: \"expression\",\n        type: TYPES.VARIABLE,\n        class: arrayClass,\n        column: column,\n        line: line,\n        value: expression.id,\n      },\n    ];\n  } else if (expression instanceof Expressions.BoolLiteral) {\n    const value = expression.value;\n    result = [\n      {\n        instance: \"expression\",\n        class: \"simple\",\n        type: TYPES.CONST,\n        value: convertBoolToString(value),\n      },\n    ];\n  } else {\n    let value = expression.value;\n    if (expression.value.toNumber) {\n      if (\n        Types.REAL.isCompatible(expression.type) &&\n        expression.value.decimalPlaces() == 0\n      ) {\n        value = Number(expression.value.toFixed(2));\n      } else {\n        value = expression.value.toNumber();\n      }\n    }\n    result = [\n      {\n        instance: \"expression\",\n        class: \"simple\",\n        type: TYPES.CONST,\n        value: value,\n      },\n    ];\n  }\n  if (expression.parenthesis) return [\"(\", ...result, \")\"];\n  else return result;\n}\n\nexport function parseExpression (text) {\n  const parser = IVProgParser.createParser(text);\n  const expressionAST = parser.parseExpressionOR();\n  return expressionWalker(expressionAST);\n}\n\n/**\n * @param {string} text\n * */\nexport function parseCode (text) {\n  const parser = IVProgParser.createParser(text, false);\n  const codeLinesMap = new Map();\n  const tokens = Array.from(parser.lexer.reset(text));\n  const tokenStream = [];\n  for (const token of tokens) {\n    if (token.type === parser.ruleNames.ERROR) {\n      return null;\n    }\n    if (token.type === parser.ruleNames.COMMENTS) {\n      for (let i = 0; i <= token.lineBreaks; i++) {\n        if (codeLinesMap.has(i + token.line))\n          codeLinesMap.get(i + token.line).push(token);\n        else codeLinesMap.set(i + token.line, [token]);\n      }\n      continue;\n    }\n    if (token.type !== parser.ruleNames.WHITESPACE) {\n      tokenStream.push(token);\n    }\n  }\n  parser.fill(tokenStream);\n  try {\n    const program = parser.parseTree();\n    const globals = program.global.map((decl) =>\n      variableDeclarationWalker(decl, true)\n    );\n    const functions = program.functions.map(functionWalker);\n    return { globals, functions };\n  } catch (e) {\n    console.error(e);\n    return null;\n  }\n}\n","import { Types } from '../typeSystem/types';\nimport { IType } from '../typeSystem/itype';\nimport { Type } from '../typeSystem/type';\nimport { Operators, Operator } from '../ast/operators';\nimport { MultiType } from '../typeSystem/multiType';\nimport { Config } from '../util/config';\n\nfunction buildInfixAddTable (): IType[][] {\n  const table: IType[][] = [[], [], [], [], []]\n\n  table[Types.INTEGER.ord][Types.INTEGER.ord] = Types.INTEGER;\n  table[Types.INTEGER.ord][Types.REAL.ord] = Types.REAL;\n  table[Types.INTEGER.ord][Types.STRING.ord] = Types.STRING;\n\n  table[Types.REAL.ord][Types.INTEGER.ord] = Types.REAL;\n  table[Types.REAL.ord][Types.REAL.ord] = Types.REAL;\n  table[Types.REAL.ord][Types.STRING.ord] = Types.STRING;\n\n  table[Types.STRING.ord][Types.INTEGER.ord] = Types.STRING;\n  table[Types.STRING.ord][Types.REAL.ord] = Types.STRING;\n  table[Types.STRING.ord][Types.STRING.ord] = Types.STRING;\n  table[Types.STRING.ord][Types.BOOLEAN.ord] = Types.STRING;\n  table[Types.STRING.ord][Types.CHAR.ord] = Types.STRING;\n\n  table[Types.CHAR.ord][Types.CHAR.ord] = Types.STRING;\n  table[Types.CHAR.ord][Types.STRING.ord] = Types.STRING;\n\n  return table;\n}\n\nfunction buildInfixMultiDivSubTable (): IType[][] {\n  const table: IType[][] = [[], []];\n\n  table[Types.INTEGER.ord][Types.INTEGER.ord] = Types.INTEGER;\n  table[Types.INTEGER.ord][Types.REAL.ord] = Types.REAL;\n\n  table[Types.REAL.ord][Types.INTEGER.ord] = Types.REAL;\n  table[Types.REAL.ord][Types.REAL.ord] = Types.REAL;\n\n  return table;\n}\n\nfunction buildInfixEqualityInequalityTable (): IType[][] {\n  const table: IType[][] = [[], [], [], [], []];\n\n  table[Types.INTEGER.ord][Types.INTEGER.ord] = Types.BOOLEAN;\n\n  table[Types.REAL.ord][Types.REAL.ord] = Types.BOOLEAN;\n\n  table[Types.BOOLEAN.ord][Types.BOOLEAN.ord] = Types.BOOLEAN;\n\n  table[Types.STRING.ord][Types.STRING.ord] = Types.BOOLEAN;\n\n  table[Types.CHAR.ord][Types.CHAR.ord] = Types.BOOLEAN;\n\n  return table;\n}\n\nfunction buildInfixRelationalTable (): IType[][] {\n  const table: IType[][] = [[], [], [], [], []];\n\n  table[Types.INTEGER.ord][Types.INTEGER.ord] = Types.BOOLEAN;\n\n  table[Types.REAL.ord][Types.REAL.ord] = Types.BOOLEAN;\n\n  table[Types.STRING.ord][Types.STRING.ord] = Types.BOOLEAN;\n\n  table[Types.CHAR.ord][Types.CHAR.ord] = Types.BOOLEAN;\n\n  return table;\n}\n\nfunction buildInfixAndOrTable (): IType[][] {\n  const table: IType[][] = [[], [], [], []];\n\n  table[Types.BOOLEAN.ord][Types.BOOLEAN.ord] = Types.BOOLEAN;\n\n  return table;\n}\n\nfunction buildInfixModTable (): IType[][] {\n  const table: IType[][] = [[]];\n\n  table[Types.INTEGER.ord][Types.INTEGER.ord] = Types.INTEGER;\n\n  return table;\n}\n\nfunction buildUnarySumSubList (): IType[] {\n  const list: IType[] = [];\n\n  list[Types.INTEGER.ord] = Types.INTEGER;\n\n  list[Types.REAL.ord] = Types.REAL;\n\n  return list;\n}\n\nfunction buildUnaryNegList (): IType[] {\n  const list: IType[] = [];\n\n  list[Types.BOOLEAN.ord] = Types.BOOLEAN;\n\n  return list;\n}\n\nfunction buildInfixCompatibilityTable (): WeakMap<Operator, IType[][]> {\n  const compatibilityMap = new WeakMap();\n  compatibilityMap.set(Operators.ADD, buildInfixAddTable());\n  compatibilityMap.set(Operators.SUB, buildInfixMultiDivSubTable());\n  compatibilityMap.set(Operators.MULT, buildInfixMultiDivSubTable());\n  compatibilityMap.set(Operators.DIV, buildInfixMultiDivSubTable());\n  compatibilityMap.set(Operators.EQ, buildInfixEqualityInequalityTable());\n  compatibilityMap.set(Operators.NEQ, buildInfixEqualityInequalityTable());\n  compatibilityMap.set(Operators.GE, buildInfixRelationalTable());\n  compatibilityMap.set(Operators.GT, buildInfixRelationalTable());\n  compatibilityMap.set(Operators.LE, buildInfixRelationalTable());\n  compatibilityMap.set(Operators.LT, buildInfixRelationalTable());\n  compatibilityMap.set(Operators.OR, buildInfixAndOrTable());\n  compatibilityMap.set(Operators.AND, buildInfixAndOrTable());\n  compatibilityMap.set(Operators.MOD, buildInfixModTable());\n  return compatibilityMap;\n}\n\nfunction buildUnaryCompatibilityTable (): WeakMap<Operator, IType[]> {\n  const compatibilityMap = new WeakMap();\n  compatibilityMap.set(Operators.ADD, buildUnarySumSubList());\n  compatibilityMap.set(Operators.SUB, buildUnarySumSubList());\n  compatibilityMap.set(Operators.NOT, buildUnaryNegList());\n  return compatibilityMap;\n}\n\nconst infixMap = buildInfixCompatibilityTable();\nconst unaryMap = buildUnaryCompatibilityTable();\n\nexport function resultTypeAfterInfixOp (\n  operator: Operator,\n  leftExpressionType: IType,\n  rightExpressionType: IType\n): IType {\n  try {\n    if (leftExpressionType instanceof MultiType && rightExpressionType instanceof MultiType) {\n      let newMulti = [];\n      for (let i = 0; i < leftExpressionType.types.length; ++i) {\n        const typeA = leftExpressionType.types[i];\n        for (let j = 0; j < rightExpressionType.types.length; ++i) {\n          const typeB = rightExpressionType.types[j];\n          newMulti.push(resultTypeAfterInfixOp(operator, typeA, typeB));\n        }\n      }\n      newMulti = newMulti.filter(x => !x.isCompatible(Types.UNDEFINED));\n      if (newMulti.length <= 0) {\n        if (Config.enable_type_casting) {\n          if (leftExpressionType.isCompatible(Types.INTEGER) || leftExpressionType.isCompatible(Types.REAL)) {\n            if (rightExpressionType.isCompatible(Types.INTEGER) || rightExpressionType.isCompatible(Types.REAL)) {\n              return new MultiType([Types.INTEGER, Types.REAL]);\n            }\n          }\n        }\n        return Types.UNDEFINED;\n      } else {\n        return new MultiType(newMulti as Type[])\n      }\n    } else if (leftExpressionType instanceof MultiType) {\n      if (leftExpressionType.isCompatible(rightExpressionType as Type)) {\n        return resultTypeAfterInfixOp(operator, rightExpressionType, rightExpressionType);\n      } else {\n        if (Config.enable_type_casting) {\n          if (leftExpressionType.isCompatible(Types.INTEGER) || leftExpressionType.isCompatible(Types.REAL)) {\n            if (rightExpressionType.isCompatible(Types.INTEGER) || rightExpressionType.isCompatible(Types.REAL)) {\n              return rightExpressionType;\n            }\n          }\n        }\n        return Types.UNDEFINED;\n      }\n    } else if (rightExpressionType instanceof MultiType) {\n      if (rightExpressionType.isCompatible(leftExpressionType as Type)) {\n        return resultTypeAfterInfixOp(operator, leftExpressionType, leftExpressionType);\n      } else {\n        if (Config.enable_type_casting) {\n          if (leftExpressionType.isCompatible(Types.INTEGER) || leftExpressionType.isCompatible(Types.REAL)) {\n            if (rightExpressionType.isCompatible(Types.INTEGER) || rightExpressionType.isCompatible(Types.REAL)) {\n              return leftExpressionType;\n            }\n          }\n        }\n        return Types.UNDEFINED;\n      }\n    }\n    const resultTable = infixMap.get(operator) || [];\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    const resultType = resultTable[leftExpressionType.ord!][rightExpressionType.ord!];\n    if (resultType === null || resultType === undefined) {\n      if (Config.enable_type_casting) {\n        if (leftExpressionType.isCompatible(Types.INTEGER) || leftExpressionType.isCompatible(Types.REAL)) {\n          if (rightExpressionType.isCompatible(Types.INTEGER) || rightExpressionType.isCompatible(Types.REAL)) {\n            if (operator === Operators.MOD) {\n              return Types.INTEGER;\n            } else if (operator.ord >= 5 && operator.ord <= 10) {\n              return Types.BOOLEAN;\n            }\n          }\n        }\n      }\n      return Types.UNDEFINED\n    }\n    return resultType;\n  } catch (e) {\n    if (e instanceof TypeError) {\n      return Types.UNDEFINED;\n    } else {\n      throw e;\n    }\n  }\n}\n\nexport function resultTypeAfterUnaryOp (operator: Operator, leftExpressionType: IType): IType {\n  try {\n    if (leftExpressionType instanceof MultiType) {\n      let newMulti = [];\n      for (let i = 0; i < leftExpressionType.types.length; ++i) {\n        const type = leftExpressionType.types[i];\n        newMulti.push(resultTypeAfterUnaryOp(operator, type));\n      }\n      newMulti = newMulti.filter(x => !x.isCompatible(Types.UNDEFINED));\n      if (newMulti.length <= 0) {\n        return Types.UNDEFINED;\n      }\n      return new MultiType(newMulti as Type[]);\n    }\n    const resultTable = unaryMap.get(operator) || [];\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    const resultType = resultTable[leftExpressionType.ord!];\n    if (resultType == null) {\n      return Types.UNDEFINED;\n    }\n    return resultType;\n  } catch (e) {\n    if (e instanceof TypeError) {\n      return Types.UNDEFINED;\n    } else {\n      throw e;\n    }\n  }\n}","export class Address {\n\n  public id: number;\n  public value: unknown;\n\n  /**\n   * \n   * @param {Number} id the address id\n   * @param {never} value the value stored at this address\n   */\n  constructor (id: number, value: unknown) {\n    this.id = id;\n    this.value = value;\n  }\n}","import { Address } from \"./address\";\n\nclass LocationHolder {\n\n  public data: Address[];\n  private address_id: number\n\n  constructor () {\n    this.data = [];\n    this.address_id = 0;\n  }\n\n  /**\n   * \n   * @param {never} value the value to be allocated\n   * @returns {number} - the address id\n   */\n  allocate (value: unknown): number {\n    const id = this.address_id;\n    // console.log(\"Allocation address \"+ id);\n    const address = new Address(id, value);\n    this.data.push(address);\n    this.address_id += 1;\n    return id;\n  }\n\n  /**\n   * \n   * @param {number} id \n   */\n  deallocate (id: number): boolean {\n    const index = this.findIndex(id);\n    // console.log(\"Deallocation address \"+ id);\n    if(index !== -1) {\n      this.data.splice(index, 1);\n      return true;\n    }\n    return false;\n  }\n\n  /**\n   * \n   * @param {number} id \n   * @returns {Address} the address identified by id\n   */\n  find (id: number): Address | undefined {\n    let beg = 0\n    let end = this.data.length;\n    // console.log(\"Finding address \"+id);\n    while (beg < end) {\n      const med = Math.floor((beg + end)/2);\n      const address = this.getAddressAt(med);\n      if(address.id === id) {\n        return address;\n      } else if (id > address.id) {\n        beg = med;\n      } else {\n        end = med\n      }\n    }\n    return undefined;\n  }\n\n  getAddressAt (pos: number): Address {\n    return this.data[pos];\n  }\n\n  /**\n   * \n   * @param {number} id address id\n   * @returns {number} the index of the address identified by id\n   */\n  findIndex (id: number): number {\n    let beg = 0\n    let end = this.data.length;\n    while (beg < end) {\n      const med = Math.floor((beg + end)/2);\n      const address = this.getAddressAt(med);\n      if(address.id === id) {\n        return med;\n      } else if (id > address.id) {\n        beg = med;\n      } else {\n        end = med\n      }\n    }\n    return -1;\n  }\n\n  updateAddress (id: number, value: unknown): void {\n    const index = this.findIndex(id);\n    if(index === -1) {\n      throw new Error(\"Invalid address...\" + id);\n    }\n    this.data[index].value = value;\n  }\n\n  clear (): void {\n    for (let i = 0; i < this.data.length; i += 1) {\n      delete this.data[i];\n    }\n    this.data = [];\n    this.address_id = 0;\n  }\n}\n\nconst inner_ref = new LocationHolder();\n\nexport const Location = Object.freeze({\n  allocate: inner_ref.allocate.bind(inner_ref),\n  deallocate: inner_ref.deallocate.bind(inner_ref),\n  find: inner_ref.find.bind(inner_ref),\n  updateAddress: inner_ref.updateAddress.bind(inner_ref),\n  clear: inner_ref.clear.bind(inner_ref),\n  size: () => inner_ref.data.length\n});","import { Location } from \"../../memory/location\";\nimport { IType } from \"../../typeSystem/itype\";\nimport { IStoreValue } from \"./value/istore_value\";\n\nexport class StoreObject {\n\n  private _type: IType;\n  private _loc_address: number;\n  private _readOnly: boolean;\n  private _id?: String;\n\n  /**\n   * \n   * @param {Type} type \n   * @param {Number} loc_address \n   * @param {Boolean} readOnly \n   */\n  constructor (type: IType, loc_address: number, readOnly = false) {\n    this._loc_address = loc_address;\n    this._type = type;\n    this._readOnly = readOnly;\n    this._id = undefined;\n  }\n\n  setID (id: String) {\n    this._id = id;\n  }\n\n  get id () {\n    return this._id;\n  }\n\n  get inStore () {\n    return this.id !== null;\n  }\n\n  get type () {\n    return this._type;\n  }\n\n  /**\n   * Returns the actual value stored at the loccation address present in this object.\n   * The returned value is compatible with @prop{StoreObject.type}\n  */\n  get value () {\n    const address = Location.find(this._loc_address);\n    if (address != null) {\n      return address.value\n    } else {\n      throw new Error(\"!!!Critical Error: variable \"+this.id+\" does not have a valid address. Loc-Address \"+ this.locAddress);\n    }\n  }\n  \n  get number () {\n    throw new Error(\"DOT NOT USE THIS PROPERTY!\");\n  }\n\n  get readOnly () {\n    return this._readOnly;\n  }\n\n  set readOnly (value) {\n    this._readOnly = value;\n  }\n\n  isCompatible (another: IStoreValue) {\n    return this.type.isCompatible(another.type);\n  }\n\n  destroy () {\n    return Location.deallocate(this._loc_address);\n  }\n\n  get locAddress () {\n    return this._loc_address;\n  }\n}\n","import { StoreObject } from './storeObject';\nimport { StoreValueRef } from './value/store_value_ref';\n\nexport class StoreObjectRef extends StoreObject {\n\n  private refObj: String;\n  private reference_dimension: number;\n\n  /**\n   * \n   * @param {StoreObject} stoValue \n   */\n  constructor (stoValue: StoreValueRef) {\n    super(stoValue.type, stoValue.getRefAddress(), false);\n    this.refObj = stoValue.id!;\n    this.reference_dimension = stoValue.getReferenceDimension();\n  }\n\n  get isRef () {\n    return true;\n  }\n\n  getRefObj (): String {\n    return this.refObj;\n  }\n\n  getReferenceDimension (): number {\n    return this.reference_dimension;\n  }\n\n  destroy () {\n    return false;\n  }\n}","import { StoreValue } from \"./store_value\";\nimport { IType } from \"../../../typeSystem/itype\";\n\nexport class StoreValueAddress extends StoreValue {\n\n  constructor (type: IType, value: any, public line: number, public column?: number, id?:String, isConst = false)  {\n    super(type,value,id, isConst);\n  }\n}","import { IStoreValue } from \"./istore_value\";\nimport { ArrayType } from \"../../../typeSystem/array_type\";\nimport { IType } from \"../../../typeSystem/itype\";\nimport { Type } from \"../../../typeSystem/type\";\nimport { StoreValueAddress } from \"./store_value_address\";\n\nexport class ArrayStoreValue implements IStoreValue {\n\n  public type: IType; \n  public id?: String;\n  public isConst: boolean;\n  public lines: number;\n  public columns?: number;\n  public values: StoreValueAddress[];\n\n  constructor(type: ArrayType, values: StoreValueAddress[], lines: number, columns?: number, id?: String, isConst = false) {\n    this.type = type;\n    this.id = id;\n    this.isConst = isConst\n    this.values = values;\n    this.lines = lines;\n    this.columns = columns;\n  }\n\n  get (): StoreValueAddress[] {\n    return this.values;\n  }\n\n  /**\n   * @deprecated\n   * Potential not necessary since array access is occuring directly in the StoreObject\n   * @param line \n   * @param column \n   */\n  getAt (line: number, column?: number): IStoreValue {\n    console.log(\"Column \", column);\n    if(this.isVector()) {\n      if(column != null) {\n        throw new Error(this.id + \" is not a matrix!\");\n      }\n      column = line;\n      line = 0;\n    } else if (column == null) {\n      const values: StoreValueAddress[] = [];\n      for(let col = 0; col < this.columns!; col += 1) {\n        const index = line * this.lines + col;\n        values.push(this.values[index]);\n      }\n      const array_type = this.type as ArrayType\n      const vector_type = new ArrayType(array_type.innerType as Type, array_type.dimensions - 1);\n      return new ArrayStoreValue(vector_type, values, this.columns!, 0, this.id, this.isConst);\n    }\n    const index = line * this.lines + column;\n    console.log(\"Get at: \",index);\n    return this.values[index];\n  }\n\n  setAt (value: IStoreValue, line:number, column?: number): void {\n    let used_dims = 1;\n    if(column != null) {\n      used_dims += 1;\n    }\n    let actual_line = line;\n    let actual_column = column;\n    if(!(this.type as ArrayType).canAccept(value.type, used_dims)) {\n      throw new Error(\"!!!Internal Error: Attempting to insert an invalid value inside array \"+this.id);\n    }\n    if(this.isVector()) {\n      if(column != null) {\n        throw new Error(this.id + \" is not a matrix!\");\n      }\n      actual_column = actual_line;\n      actual_line = 0;\n    } else if (column == null) {\n      if(!(value instanceof ArrayStoreValue)) {\n        throw new Error(\"Attempting to insert a single value as a line of matrix \" + this.id);\n      }\n      const actual_values = value.get()\n      for(let i = 0; i < this.columns!; i += 1) {\n        const pos = actual_line * this.columns! + i;\n        const val = actual_values[i]\n        this.values[pos] = new StoreValueAddress(value.type, val.get(), actual_line, i, this.id, this.isConst);\n      }\n    }\n    const columns =  this.columns == null ? 0 : this.columns;\n    const pos = actual_line * columns + actual_column!;\n    this.values[pos] = new StoreValueAddress(value.type, value.get(), line, column, this.id, this.isConst);\n  }\n\n  inStore () {\n    return this.id != null;\n  }\n\n  isVector (): boolean {\n    return (this.type as ArrayType).dimensions == 1;\n  }\n}\n","import { StoreObject } from './storeObject';\nimport { ArrayType } from '../../typeSystem/array_type';\nimport { ArrayStoreValue } from './value/array_store_value';\nimport { Location } from \"../../memory/location\";\nimport { IStoreValue } from './value/istore_value';\nimport { StoreValue } from './value/store_value';\n\nexport class StoreObjectArray extends StoreObject {\n\n  constructor (type: ArrayType, private _lines:number, private _columns:number, private loc_addresses: number[], readOnly = false) {\n    super(type, -1, readOnly);\n  }\n\n  get lines () {\n    return this._lines;\n  }\n\n  get columns () {\n    return this._columns;\n  }\n\n  isCompatible (another: IStoreValue): boolean {\n    if(another instanceof ArrayStoreValue) {\n      const cols = another.columns == null ? 0 :  another.columns;\n      if(this.lines === another.lines && this.columns === cols) {\n          return super.isCompatible(another);\n      }\n    }\n    return false;\n  }\n\n  get isVector () {\n    return (this.type as ArrayType).dimensions === 1;\n  }\n\n  /**@override \n     * Returns the list of values stored by this array.\n     * All returned values are compatible with @prop{StoreObject.type}\n    */\n  get value () {\n    const values = [];\n    for(let i = 0; i < this.addresses.length; i += 1) {\n      const address = Location.find(this.addresses[i]);\n      if (address != null) {\n        values.push(address.value);\n      } else {\n        throw new Error(\"!!!Critical Error: variable \"+this.id+\" does not have a valid address. Loc-Address \"+ this.locAddress);\n      }\n    }\n    return values;\n  }\n\n  destroy () {\n    let bool =  true;\n    for(let i = 0; i < this.addresses.length; i += 1) {\n      bool = bool && Location.deallocate(this.addresses[i]);\n    }\n    return bool;\n  }\n\n  /**\n   * @override\n   * \n   * Returns the address that contains a list of all addresses of the values present in the array\n   */\n  get locAddress (): number {\n    throw new Error(\"!!!Internal Error: Cannot invoke locAddress on StoreObjectArray\");\n  }\n\n  protected get addresses (): number[] {\n    return this.loc_addresses;\n  }\n\n  getAt (line: number, column?: number): any {\n    if(this.isVector) {\n      if(column != null) {\n        throw new Error(this.id + \" is not a matrix!\");\n      }\n      column = line;\n      line = 0;\n    } else if (column == null) {\n      // this is a whole line...\n      const values = [];\n      for(let col = 0; col < this.columns; col += 1) {\n        const index = this.getIndexOf(line, col);\n        const address = Location.find(this.addresses[index])!;\n        values.push(address.value);\n      }\n      return values;\n    }\n    const index = this.getIndexOf(line, column);\n    const address = Location.find(this.addresses[index])!;\n    return address.value;\n  }\n\n  setAt (value: StoreValue, line:number, column?: number): void {\n    let used_dims = 1;\n    if(column != null) {\n      used_dims += 1;\n    }\n    if(!(this.type as ArrayType).canAccept(value.type, used_dims)) {\n      throw new Error(\"!!!Internal Error: Attempting to insert an invalid value inside array \"+this.id);\n    }\n    if(this.isVector) {\n      if(column != null) {\n        throw new Error(this.id + \" is not a matrix!\");\n      }\n      column = line;\n      line = 0;\n    } else if (column == null) {\n      throw new Error(\"!!!Internal Error: Attempting to insert a line into matrix \"+ this.id );\n    }\n    const pos = this.getIndexOf(line, column);\n    Location.updateAddress(this.addresses[pos], value.get());\n  }\n\n  protected getIndexOf (line: number, column: number): number {\n    return line * this.columns + column;\n  }\n\n  getLocAddressOf (line: number, column?: number): number | number[] {\n    if(this.isVector) {\n      if(column != null) {\n        throw new Error(this.id + \" is not a matrix!\");\n      }\n      column = line;\n      line = 0;\n    } else if (column == null) {\n      // this is a whole line...\n      const values: number[] = [];\n      for(let col = 0; col < this.columns; col += 1) {\n        const index = this.getIndexOf(line, col);\n        values.push(this.addresses[index]);\n      }\n      return values;\n    }\n    const index = this.getIndexOf(line, column);\n    return this.addresses[index];\n  }\n}\n","import { IStoreValue } from \"./istore_value\";\nimport { Type } from \"../../../typeSystem/type\";\n\nexport class StoreValueRef implements IStoreValue {\n\n  public isConst = false;\n  private reference_dimesion = 0;\n\n  constructor(public type: Type, public value: any, private loc_address: number, public id:String) {\n\n  }\n\n  get () {\n    return this.value;\n  }\n\n  getRefAddress () : number {\n    return this.loc_address;\n  }\n\n  inStore () {\n    return this.id != null;\n  }\n\n  getReferenceDimension (): number {\n    return this.reference_dimesion;\n  }\n\n  setReferenceDimension (dimension: number):void {\n    this.reference_dimesion = dimension;\n  }\n}","import { IStoreValue } from \"./istore_value\";\nimport { StoreValueAddress } from \"./store_value_address\";\nimport { ArrayType } from \"../../../typeSystem/array_type\";\n\nexport class ArrayStoreValueRef implements IStoreValue {\n\n  public isConst = false;\n\n  constructor(public type: ArrayType, private values: StoreValueAddress[],\n    private addresses: number[], public lines: number, public columns:number,\n    public id:String) { }\n\n  get () {\n    return this.values;\n  }\n\n  getAddresses (): number[] {\n    return this.addresses;\n  }\n\n  inStore () {\n    return this.id != null;\n  }\n}","import { StoreObjectArray } from \"./storeObjectArray\";\nimport { ArrayStoreValueRef } from \"./value/array_store_value_ref\";\n\nexport class StoreObjectArrayRef extends StoreObjectArray {\n\n  private refObj: String;\n\n  constructor(stoValue: ArrayStoreValueRef, lines:number, columns:number) {\n    super(stoValue.type, lines, columns, stoValue.getAddresses(), false);\n    this.refObj = stoValue.id;\n  }\n\n  get isRef () {\n    return true;\n  }\n\n  getRefObj (): String {\n    return this.refObj;\n  }\n\n  destroy () {\n    return false;\n  }\n}","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { Modes } from '../modes';\nimport { Types } from \"../../typeSystem/types\";\nimport { StoreObject } from './storeObject';\nimport { IType } from '../../typeSystem/itype';\nimport { StoreObjectRef } from './storeObjectRef';\nimport { ArrayType } from '../../typeSystem/array_type';\nimport { ArrayStoreValue } from './value/array_store_value';\nimport { Location } from '../../memory/location';\nimport { StoreObjectArray } from './storeObjectArray';\nimport { IStoreValue } from './value/istore_value';\nimport { StoreValue } from './value/store_value';\nimport { StoreValueAddress } from './value/store_value_address';\nimport { StoreValueRef } from './value/store_value_ref';\nimport { ArrayStoreValueRef } from './value/array_store_value_ref';\nimport { StoreObjectArrayRef } from './store_object_array_ref';\n\nexport class Store {\n\n  static canImplicitTypeCast (castType: IType, sourceType: IType): boolean {\n    if (castType.isCompatible(Types.INTEGER) || castType.isCompatible(Types.REAL)) {\n      if (sourceType.isCompatible(Types.INTEGER) || sourceType.isCompatible(Types.REAL)) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  static doImplicitCasting (castType: IType, stoObj: IStoreValue): IStoreValue {\n    if(!Store.canImplicitTypeCast(castType, stoObj.type)) {\n      throw new Error(\"!!!Critical error: attempted to type cast invalid types\");\n    }\n    if(castType.isCompatible(Types.INTEGER)) {\n      return new StoreValue(Types.INTEGER, stoObj.get().trunc());\n    } else {\n      return new StoreValue(Types.REAL, stoObj.get());\n    }\n  }\n\n  private store: Map<string, StoreObject>;\n  public nextStore?: Store\n  public mode: symbol;\n\n  constructor(public name: string) {\n    this.store = new Map<string, StoreObject>();\n    this.mode = Modes.RUN; \n  }\n\n  extendStore (nextStore: Store): void {\n    this.nextStore = nextStore;\n  }\n\n  applyStore (id: string): IStoreValue {\n    if (!this.store.has(id)) {\n      if (this.nextStore != null) {\n        return this.nextStore.applyStore(id);\n      } else {\n        throw new Error(`Variable ${id} not found.`);\n      }\n    }\n    const val = this.store.get(id)!;\n    let result = null\n    if (val.type instanceof ArrayType) {\n      const array = val as StoreObjectArray;\n      const array_type = array.type as ArrayType;\n      let l = 0, c = 0;\n      const values = array.value.map( v => {\n        if(array.isVector) {\n          return new StoreValueAddress(array_type.innerType, v, l++, undefined, array.id, array.readOnly);  \n        } else {\n          if(c >= array.columns) {\n            c = 0;\n            l += 1;\n          }\n          return new StoreValueAddress(array_type.innerType, v, l, c++, array.id, array.readOnly);  \n        }\n      });\n      result = new ArrayStoreValue(array_type, values, array.lines, array.columns, val.id, val.readOnly);\n    } else {\n      result = new StoreValue(val.type, val.value, val.id, val.readOnly);\n    }\n    \n    return result;\n  }\n\n  updateStore (id: string, stoValue: IStoreValue): Store {\n    if (!this.store.has(id)) {\n      if (this.nextStore != null) {\n        this.nextStore.updateStore(id, stoValue);\n        return this;\n      } else {\n        // TODO: better error message\n        throw new Error(`Variable ${id} not found.`);\n      }\n    } else {\n      const oldObj = this.store.get(id)!;\n      if (oldObj.readOnly) {\n        // TODO: better error message\n        throw new Error(\"Cannot change value of a read only variable: \" + id);\n      }\n\n      if (oldObj instanceof StoreObjectArray) {\n        const array_value = stoValue as ArrayStoreValue;\n        if(oldObj.isCompatible(array_value)) {\n          if(oldObj.isVector) {\n            array_value.get().forEach((val, index) => {\n              oldObj.setAt(val, index, undefined);\n            });\n          } else {\n            let line = 0;\n            let column = 0;\n            array_value.get().forEach((val) => {\n              oldObj.setAt(val, line, column);\n              column += 1;\n              if(column >= oldObj.columns) {\n                line += 1;\n                column = 0;\n              }\n            });\n          }\n          return this;\n        }\n      } else if (oldObj.isCompatible(stoValue)) {\n        const loc_address = oldObj.locAddress;\n        Location.updateAddress(loc_address, stoValue.get());\n        return this;\n      }\n      const oldType = oldObj.type;\n      const stoType = stoValue.type;\n      // TODO: better error message\n      throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);\n      \n    }\n  }\n\n  /**\n   * Method used to update regions of an array (vector or matrix). The should only be used when update an specific\n   * possition since it will only update the required addresses.\n   * @param {string} id the variable id to be updated\n   * @param {IStoreValue} sto_value the value to be used in the update process\n   * @param {number} line the line address of the vector/matrix\n   * @param {number} column the matrix column, which can be undefined\n   */\n  updateStoreArray (id: string, sto_value: IStoreValue, line: number, column?: number): Store {\n    if (!this.store.has(id)) {\n      if (this.nextStore != null) {\n        this.nextStore.updateStoreArray(id, sto_value, line, column);\n        return this;\n      } else {\n        // TODO: better error message\n        throw new Error(`Variable ${id} not found.`);\n      }\n    } else {\n      const oldObj = this.store.get(id)!;\n      if (oldObj.readOnly) {\n        // TODO: better error message\n        throw new Error(\"Cannot change value of a read only variable: \" + id);\n      }\n\n      if (oldObj instanceof StoreObjectArray) {\n        if(sto_value instanceof ArrayStoreValue) {\n          // this must be a vector  or matrix line update\n          const actual_values =  sto_value.get();\n          if(oldObj.isVector && sto_value.isVector()) {\n            for(let i = 0;i < sto_value.lines; i += 1) {\n              const val = actual_values[i]\n              oldObj.setAt(val, i, undefined);\n            }\n          } else if(!oldObj.isVector && column == null && sto_value.isVector()) {\n            for(let i = 0;i < oldObj.columns; i += 1) {\n              const val = actual_values[i]\n              oldObj.setAt(val, line, i);\n            }\n          } else {\n            // TODO: better error message\n            throw new Error(`Attempting to assign an invalid value to array ${id}`);\n          }\n        } else {\n          if(!oldObj.isVector && column == null) {\n            // TODO: better error message\n            throw new Error(`Attempting to assign an invalid value to array ${id}`);\n          }\n          oldObj.setAt(sto_value as StoreValue, line, column);\n        }\n      } else {\n        throw new Error(\"Cannot update a non-array variable using updateStoreArray\");\n      }\n      // const oldType = oldObj.type;\n      // const stoType = sto_value.type;\n      // // TODO: better error message\n      // throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);\n      return this;\n    }\n  }\n\n  /**\n   * Inserts a new variable into the Store. This method should be used when declaring a new variable,\n   * including the special return variable $.\n   * @param id variable id\n   * @param stoValue the value to be used as the initial value of id\n   */\n  insertStore (id: string, stoValue: IStoreValue): Store {\n    if (this.store.has(id)) {\n      // TODO: better error message\n      throw new Error(`${id} is already defined`);\n    }\n    // TODO check for array....\n    let newObj: StoreObject;\n    if(stoValue instanceof StoreValueRef) {\n      newObj = new StoreObjectRef(stoValue);\n    } else if (stoValue instanceof ArrayStoreValueRef) {\n      newObj = new StoreObjectArrayRef(stoValue, stoValue.lines, stoValue.columns);\n    } else if (stoValue instanceof ArrayStoreValue) {\n      const columns = stoValue.isVector() ? 0 : stoValue.columns!;\n      const addresses: number[] = [];\n      const all_values = stoValue.get();\n      if(all_values.length > 0) {\n        for(let i = 0; i < stoValue.get().length; i += 1) {\n          const val = all_values[i].get();\n          addresses.push(Location.allocate(val));\n        }\n      } else {\n        let total = stoValue.lines;\n        total = stoValue.isVector() ? total : total * columns;\n        for(let i = 0; i < total; i += 1) {\n          addresses.push(Location.allocate(null));\n        }\n      }\n      newObj = new StoreObjectArray(stoValue.type as ArrayType, stoValue.lines, columns, addresses, stoValue.isConst);\n    } else {\n      const loc_address = Location.allocate(stoValue.get());\n      newObj = new StoreObject(stoValue.type, loc_address, stoValue.isConst);\n    }\n    newObj.setID(id);\n    this.store.set(id, newObj);\n    return this;\n  }\n  /**\n   * Helper function similar to applyStore. But it returns the actual object in the store be it ref or not\n   * applyStore will return the refferenced object if the object in the store is a ref\n   */\n  getStoreObject (id: string): StoreObject {\n    if (!this.store.has(id)) {\n      if (this.nextStore != null) {\n        return this.nextStore.getStoreObject(id);\n      } else {\n        throw new Error(`Variable ${id} not found.`);\n      }\n    }\n    return this.store.get(id)!;\n  }\n\n  destroy (): void {\n    this.store.forEach(sto => sto.destroy(), this);\n  }\n\n  isDefined (id: string): boolean {\n    if (!this.store.has(id)) {\n      if (this.nextStore != null) {\n        return this.nextStore.isDefined(id);\n      } else {\n        return false;\n      }\n    }\n    return true;\n  }\n}","import { ProcessorErrorFactory } from \"./../error/processorErrorFactory\";\nimport { LanguageDefinedFunction } from \"./../definedFunctions\";\nimport {\n  ArrayDeclaration,\n  While,\n  For,\n  Switch,\n  Assign,\n  Break,\n  IfThenElse,\n  Return,\n  ArrayIndexAssign,\n} from \"../../ast/commands\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Expression } from \"./../../ast/expressions/expression\";\nimport {\n  InfixApp,\n  UnaryApp,\n  FunctionCall,\n  IntLiteral,\n  RealLiteral,\n  StringLiteral,\n  BoolLiteral,\n  VariableLiteral,\n  ArrayAccess,\n  CharLiteral,\n} from \"../../ast/expressions\";\nimport { Literal } from \"../../ast/expressions/literal\";\nimport {\n  resultTypeAfterInfixOp,\n  resultTypeAfterUnaryOp,\n} from \"../compatibilityTable\";\nimport { Types } from \"../../typeSystem/types\";\nimport { ArrayType } from \"../../typeSystem/array_type\";\nimport { MultiType } from \"../../typeSystem/multiType\";\nimport { Config } from \"../../util/config\";\nimport { Store } from \"../store/store\";\nimport { IVProgParser } from \"../../ast/ivprogParser\";\n\nexport class SemanticAnalyser {\n  static analyseFromSource (stringCode) {\n    const parser = IVProgParser.createParser(stringCode);\n    const semantic = new SemanticAnalyser(parser.parseTree());\n    return semantic.analyseTree();\n  }\n\n  constructor (ast) {\n    this.ast = ast;\n    this.symbolMap = null;\n    this.currentFunction = null;\n  }\n\n  pushMap () {\n    if (this.symbolMap === null) {\n      this.symbolMap = { map: {}, next: null };\n    } else {\n      const n = { map: {}, next: this.symbolMap };\n      this.symbolMap = n;\n    }\n  }\n\n  popMap () {\n    if (this.symbolMap !== null) {\n      this.symbolMap = this.symbolMap.next;\n    }\n  }\n\n  insertSymbol (id, typeInfo) {\n    this.symbolMap.map[id] = typeInfo;\n  }\n\n  findSymbol (id, symbol_map) {\n    if (!symbol_map.map[id]) {\n      if (symbol_map.next) {\n        return this.findSymbol(id, symbol_map.next);\n      }\n      return null;\n    } else {\n      return symbol_map.map[id];\n    }\n  }\n\n  getMainFunction () {\n    return this.ast.functions.find((v) => v.isMain);\n  }\n\n  findFunction (name) {\n    if (name.match(/^\\$.+$/)) {\n      const fun = LanguageDefinedFunction.getFunction(name);\n      if (!fun) {\n        throw ProcessorErrorFactory.not_implemented(name);\n      }\n      return fun;\n    } else {\n      const val = this.ast.functions.find((v) => v.name === name);\n      if (!val) {\n        return null;\n      }\n      return val;\n    }\n  }\n\n  analyseTree () {\n    const globalVars = this.ast.global;\n    this.pushMap();\n    this.assertDeclarations(globalVars);\n    const functions = this.ast.functions;\n    const mainFunc = functions.filter((f) => f.name === null);\n    if (mainFunc.length <= 0) {\n      throw ProcessorErrorFactory.main_missing();\n    }\n    for (let i = 0; i < functions.length; i++) {\n      const fun = functions[i];\n      this.assertFunction(fun);\n    }\n    return this.ast;\n  }\n\n  assertDeclarations (list) {\n    for (let i = 0; i < list.length; i++) {\n      this.assertDeclaration(list[i]);\n    }\n  }\n\n  assertDeclaration (declaration) {\n    if (declaration instanceof ArrayDeclaration) {\n      this.assertArrayDeclaration(declaration);\n      this.insertSymbol(declaration.id, {\n        id: declaration.id,\n        lines: declaration.lines,\n        columns: declaration.columns,\n        type: declaration.type,\n        isConst: declaration.isConst,\n      });\n    } else {\n      if (declaration.initial === null) {\n        this.insertSymbol(declaration.id, {\n          id: declaration.id,\n          type: declaration.type,\n          isConst: declaration.isConst,\n        });\n        return;\n      }\n      const resultType = this.evaluateExpressionType(declaration.initial);\n      if (resultType instanceof MultiType) {\n        if (!resultType.isCompatible(declaration.type)) {\n          const stringInfo = declaration.type.stringInfo();\n          const info = stringInfo[0];\n          const result_string_info = resultType.stringInfo();\n          const result_info = result_string_info[0];\n          const exp = declaration.initial;\n          throw ProcessorErrorFactory.incompatible_types_full(\n            info.type,\n            info.dim,\n            result_info.type,\n            result_info.dim,\n            exp.toString(),\n            declaration.sourceInfo\n          );\n        }\n        this.insertSymbol(declaration.id, {\n          id: declaration.id,\n          type: declaration.type,\n          isConst: declaration.isConst,\n        });\n      } else if (\n        (!declaration.type.isCompatible(resultType) &&\n          !Config.enable_type_casting) ||\n        (!declaration.type.isCompatible(resultType) &&\n          Config.enable_type_casting &&\n          !Store.canImplicitTypeCast(declaration.type, resultType))\n      ) {\n        const stringInfo = declaration.type.stringInfo();\n        const info = stringInfo[0];\n        const result_string_info = resultType.stringInfo();\n        const result_info = result_string_info[0];\n        const exp = declaration.initial;\n        throw ProcessorErrorFactory.incompatible_types_full(\n          info.type,\n          info.dim,\n          result_info.type,\n          result_info.dim,\n          exp.toString(),\n          declaration.sourceInfo\n        );\n      } else {\n        this.insertSymbol(declaration.id, {\n          id: declaration.id,\n          type: declaration.type,\n          isConst: declaration.isConst,\n        });\n      }\n    }\n  }\n\n  assertArrayDeclaration (declaration) {\n    if (declaration.initial === null) {\n      const lineType = this.evaluateExpressionType(declaration.lines);\n      if (!lineType.isCompatible(Types.INTEGER)) {\n        throw ProcessorErrorFactory.array_dimension_not_int_full(\n          declaration.sourceInfo\n        );\n      }\n      if (declaration.columns !== null) {\n        const columnType = this.evaluateExpressionType(declaration.columns);\n        if (!columnType.isCompatible(Types.INTEGER)) {\n          throw ProcessorErrorFactory.array_dimension_not_int_full(\n            declaration.sourceInfo\n          );\n        }\n      }\n    } else {\n      this.evaluateArrayLiteral(declaration);\n    }\n    this.insertSymbol(declaration.id, {\n      id: declaration.id,\n      lines: declaration.lines,\n      columns: declaration.columns,\n      type: declaration.type,\n    });\n    return;\n  }\n\n  evaluateExpressionType (expression) {\n    // TODO: Throw operator error in case type == UNDEFINED\n    if (expression instanceof UnaryApp) {\n      const op = expression.op;\n      const resultType = this.evaluateExpressionType(expression.left);\n      const finalResult = resultTypeAfterUnaryOp(op, resultType);\n      if (Types.UNDEFINED.isCompatible(finalResult)) {\n        const stringInfo = resultType.stringInfo();\n        const info = stringInfo[0];\n        const expString = expression.toString();\n        throw ProcessorErrorFactory.invalid_unary_op_full(\n          expString,\n          op,\n          info.type,\n          info.dim,\n          expression.sourceInfo\n        );\n      }\n      return finalResult;\n    } else if (expression instanceof InfixApp) {\n      const op = expression.op;\n      const resultTypeLeft = this.evaluateExpressionType(expression.left);\n      const resultTypeRight = this.evaluateExpressionType(expression.right);\n      const finalResult = resultTypeAfterInfixOp(\n        op,\n        resultTypeLeft,\n        resultTypeRight\n      );\n      if (Types.UNDEFINED.isCompatible(finalResult)) {\n        const stringInfoLeft = resultTypeLeft.stringInfo();\n        const infoLeft = stringInfoLeft[0];\n        const stringInfoRight = resultTypeRight.stringInfo();\n        const infoRight = stringInfoRight[0];\n        const expString = expression.toString();\n        throw ProcessorErrorFactory.invalid_infix_op_full(\n          expString,\n          op,\n          infoLeft.type,\n          infoLeft.dim,\n          infoRight.type,\n          infoRight.dim,\n          expression.sourceInfo\n        );\n      }\n      return finalResult;\n    } else if (expression instanceof Literal) {\n      return this.evaluateLiteralType(expression);\n    } else if (expression instanceof FunctionCall) {\n      if (expression.isMainCall) {\n        throw ProcessorErrorFactory.void_in_expression_full(\n          LanguageDefinedFunction.getMainFunctionName(),\n          expression.sourceInfo\n        );\n      }\n      const fun = this.findFunction(expression.id);\n      if (fun === null) {\n        throw ProcessorErrorFactory.function_missing_full(\n          expression.id,\n          expression.sourceInfo\n        );\n      }\n      if (fun.returnType.isCompatible(Types.VOID)) {\n        throw ProcessorErrorFactory.void_in_expression_full(\n          expression.id,\n          expression.sourceInfo\n        );\n      }\n      this.assertParameters(fun, expression.actualParameters);\n      return fun.returnType;\n    } else if (expression instanceof ArrayAccess) {\n      const arrayTypeInfo = this.findSymbol(expression.id, this.symbolMap);\n      if (arrayTypeInfo === null) {\n        throw ProcessorErrorFactory.symbol_not_found_full(\n          expression.id,\n          expression.sourceInfo\n        );\n      }\n      if (!(arrayTypeInfo.type instanceof ArrayType)) {\n        throw ProcessorErrorFactory.invalid_array_access_full(\n          expression.id,\n          expression.sourceInfo\n        );\n      }\n      const lineType = this.evaluateExpressionType(expression.line);\n      if (!lineType.isCompatible(Types.INTEGER)) {\n        throw ProcessorErrorFactory.array_dimension_not_int_full(\n          expression.sourceInfo\n        );\n      }\n      if (expression.column !== null) {\n        if (arrayTypeInfo.columns === null) {\n          throw ProcessorErrorFactory.invalid_matrix_access_full(\n            expression.id,\n            expression.sourceInfo\n          );\n        }\n        const columnType = this.evaluateExpressionType(expression.column);\n        if (!columnType.isCompatible(Types.INTEGER)) {\n          throw ProcessorErrorFactory.array_dimension_not_int_full(\n            expression.sourceInfo\n          );\n        }\n      }\n      const arrType = arrayTypeInfo.type;\n      if (expression.column !== null) {\n        // indexing matrix\n        return arrType.innerType;\n      } else {\n        if (arrayTypeInfo.columns === null) {\n          return arrType.innerType;\n        }\n        return new ArrayType(arrType.innerType, 1);\n      }\n    }\n  }\n\n  evaluateLiteralType (literal) {\n    if (literal instanceof IntLiteral) {\n      return literal.type;\n    } else if (literal instanceof RealLiteral) {\n      return literal.type;\n    } else if (literal instanceof StringLiteral) {\n      return literal.type;\n    } else if (literal instanceof BoolLiteral) {\n      return literal.type;\n    } else if (literal instanceof CharLiteral) {\n      return literal.type;\n    } else if (literal instanceof VariableLiteral) {\n      const typeInfo = this.findSymbol(literal.id, this.symbolMap);\n      if (typeInfo === null) {\n        throw ProcessorErrorFactory.symbol_not_found_full(\n          literal.id,\n          literal.sourceInfo\n        );\n      }\n      if (typeInfo.type instanceof ArrayType) {\n        return typeInfo.type;\n      }\n      return typeInfo.type;\n    } else {\n      // console.warn(\"Evaluating type only for an array literal...\");\n      let last = null;\n      if (literal.value.length === 1) {\n        last = this.evaluateExpressionType(literal.value[0]);\n      } else {\n        for (let i = 0; i < literal.value.length; i++) {\n          const e = this.evaluateExpressionType(literal.value[i]);\n          if (last === null) {\n            last = e;\n          } else if (!last.isCompatible(e)) {\n            const strInfo = last.stringInfo();\n            const info = strInfo[0];\n            const strExp = literal.toString();\n            throw ProcessorErrorFactory.incompatible_types_array_full(\n              strExp,\n              info.type,\n              info.dim,\n              literal.sourceInfo\n            );\n          }\n        }\n      }\n      if (last instanceof ArrayType) {\n        return new ArrayType(last.innerType, last.dimensions + 1);\n      }\n      return new ArrayType(last, 1);\n    }\n  }\n\n  evaluateArrayLiteral (arrayDeclaration) {\n    const type = arrayDeclaration.type;\n    const literal = arrayDeclaration.initial;\n    // console.log(arrayDeclaration);\n    if (arrayDeclaration.isVector) {\n      this.evaluateVectorLiteralType(literal, type);\n    } else {\n      // TODO matrix type check\n      for (let i = 0; i < literal.lines; ++i) {\n        const line_literal = literal.value[i];\n        this.evaluateVectorLiteralType(\n          line_literal,\n          new ArrayType(type.innerType, 1)\n        );\n      }\n    }\n    return true;\n  }\n\n  assertFunction (fun) {\n    this.pushMap();\n    this.currentFunction = fun;\n    fun.formalParameters.forEach((formalParam) => {\n      if (formalParam.type instanceof ArrayType) {\n        if (formalParam.type.dimensions > 1) {\n          this.insertSymbol(formalParam.id, {\n            id: formalParam.id,\n            lines: -1,\n            columns: -1,\n            type: formalParam.type,\n          });\n        } else {\n          this.insertSymbol(formalParam.id, {\n            id: formalParam.id,\n            lines: -1,\n            columns: null,\n            type: formalParam.type,\n          });\n        }\n      } else {\n        this.insertSymbol(formalParam.id, {\n          id: formalParam.id,\n          type: formalParam.type,\n        });\n      }\n    });\n    this.assertDeclarations(fun.variablesDeclarations);\n    const optional = fun.returnType.isCompatible(Types.VOID);\n    const valid = this.assertReturn(fun, optional);\n    if (!valid) {\n      throw ProcessorErrorFactory.function_no_return(fun.name);\n    }\n    this.popMap();\n  }\n\n  assertReturn (fun, optional) {\n    return fun.commands.reduce(\n      (last, next) => this.checkCommand(fun.returnType, next, optional) || last,\n      optional\n    );\n  }\n\n  checkCommand (type, cmd, optional) {\n    if (cmd instanceof While) {\n      const resultType = this.evaluateExpressionType(cmd.expression);\n      if (!resultType.isCompatible(Types.BOOLEAN)) {\n        throw ProcessorErrorFactory.loop_condition_type_full(\n          cmd.expression.toString(),\n          cmd.sourceInfo\n        );\n      }\n      this.checkCommands(type, cmd.commands, optional);\n      return false;\n    } else if (cmd instanceof For) {\n      const var_type = this.evaluateExpressionType(cmd.for_id);\n      if (!var_type.isCompatible(Types.INTEGER)) {\n        throw ProcessorErrorFactory.invalid_for_variable(\n          cmd.for_id,\n          cmd.sourceInfo\n        );\n      }\n      const from_type = this.evaluateExpressionType(cmd.for_from);\n      if (!from_type.isCompatible(Types.INTEGER)) {\n        throw ProcessorErrorFactory.invalid_for_from(\n          cmd.for_from,\n          cmd.sourceInfo\n        );\n      }\n      const to_type = this.evaluateExpressionType(cmd.for_to);\n      if (!to_type.isCompatible(Types.INTEGER)) {\n        throw ProcessorErrorFactory.invalid_for_to(cmd.for_to, cmd.sourceInfo);\n      }\n      if (cmd.for_pass != null) {\n        const pass_type = this.evaluateExpressionType(cmd.for_pass);\n        if (!pass_type.isCompatible(Types.INTEGER)) {\n          throw ProcessorErrorFactory.invalid_for_pass(\n            cmd.for_pass,\n            cmd.sourceInfo\n          );\n        }\n      }\n      this.checkCommands(type, cmd.commands, optional);\n      return false;\n    } else if (cmd instanceof Switch) {\n      const sType = this.evaluateExpressionType(cmd.expression);\n      let result = optional;\n      let hasDefault = false;\n      for (let i = 0; i < cmd.cases.length; i++) {\n        const aCase = cmd.cases[i];\n        if (aCase.expression !== null) {\n          const caseType = this.evaluateExpressionType(aCase.expression);\n          if (!sType.isCompatible(caseType)) {\n            const strInfo = sType.stringInfo();\n            const info = strInfo[0];\n            const strExp = aCase.expression.toString();\n            throw ProcessorErrorFactory.invalid_case_type_full(\n              strExp,\n              info.type,\n              info.dim,\n              aCase.sourceInfo\n            );\n          }\n        } else {\n          hasDefault = true;\n        }\n        result = result && this.checkCommands(type, aCase.commands, result);\n      }\n      return result && hasDefault;\n    } else if (cmd instanceof ArrayIndexAssign) {\n      // TODO - rework!!!!!\n      let used_dims = 0;\n      const typeInfo = this.findSymbol(cmd.id, this.symbolMap);\n      if (typeInfo === null) {\n        throw ProcessorErrorFactory.symbol_not_found_full(\n          cmd.id,\n          cmd.sourceInfo\n        );\n      }\n      if (typeInfo.isConst) {\n        throw ProcessorErrorFactory.invalid_const_assignment_full(\n          cmd.id,\n          cmd.sourceInfo\n        );\n      }\n      if (!(typeInfo.type instanceof ArrayType)) {\n        throw ProcessorErrorFactory.invalid_array_access_full(\n          cmd.id,\n          cmd.sourceInfo\n        );\n      }\n      const exp = cmd.expression;\n      const lineExp = cmd.line;\n      const lineType = this.evaluateExpressionType(lineExp);\n      if (!lineType.isCompatible(Types.INTEGER)) {\n        throw ProcessorErrorFactory.array_dimension_not_int_full(\n          cmd.sourceInfo\n        );\n      }\n      used_dims += 1;\n      const columnExp = cmd.column;\n      if (typeInfo.columns === null && columnExp !== null) {\n        throw ProcessorErrorFactory.invalid_matrix_access_full(\n          cmd.id,\n          cmd.sourceInfo\n        );\n      } else if (columnExp !== null) {\n        const columnType = this.evaluateExpressionType(columnExp);\n        if (!columnType.isCompatible(Types.INTEGER)) {\n          throw ProcessorErrorFactory.array_dimension_not_int_full(\n            cmd.sourceInfo\n          );\n        }\n        used_dims += 1;\n      }\n      // exp a single value exp or an array access\n      const exp_type = this.evaluateExpressionType(exp);\n      const access_type = typeInfo.type;\n\n      let compatible = false;\n      let type = access_type;\n      if (exp_type instanceof MultiType) {\n        if (access_type.dimensions - used_dims == 0) {\n          type = access_type.innerType;\n        } else {\n          type = new ArrayType(\n            access_type.innerType,\n            Math.max(0, access_type.dimensions - used_dims)\n          );\n        }\n        compatible = exp_type.isCompatible(type);\n      } else {\n        compatible = access_type.canAccept(exp_type, used_dims);\n      }\n      if (!compatible) {\n        if (0 === access_type.dimensions - used_dims) {\n          type = access_type.innerType; // enable a valid attempt to cast real <--> integer\n        }\n        if (\n          !Config.enable_type_casting ||\n          !Store.canImplicitTypeCast(type, exp_type)\n        ) {\n          const access_type_string_info = access_type.stringInfo();\n          const access_type_info = access_type_string_info[0];\n          const exp_type_string_info = exp_type.stringInfo();\n          const exp_type_info = exp_type_string_info[0];\n          throw ProcessorErrorFactory.incompatible_types_full(\n            access_type_info.type,\n            access_type_info.dim - used_dims,\n            exp_type_info.type,\n            exp_type_info.dim,\n            exp.toString(),\n            cmd.sourceInfo\n          );\n        }\n      }\n      return optional;\n    } else if (cmd instanceof Assign) {\n      // TODO - rework since there is no literal array assignment\n      const typeInfo = this.findSymbol(cmd.id, this.symbolMap);\n      if (typeInfo === null) {\n        throw ProcessorErrorFactory.symbol_not_found_full(\n          cmd.id,\n          cmd.sourceInfo\n        );\n      }\n      if (typeInfo.isConst) {\n        throw ProcessorErrorFactory.invalid_const_assignment_full(\n          cmd.id,\n          cmd.sourceInfo\n        );\n      }\n      const exp = cmd.expression;\n      const exp_type = this.evaluateExpressionType(exp);\n      if (exp_type instanceof ArrayType) {\n        if (!(typeInfo.type instanceof ArrayType)) {\n          // TODO better error message\n          throw new Error(\"Cannot assign an array to a non-array variable \");\n        }\n        // Both are arrays...\n        // if both don't have same dimensions and type, cannot perform assignment\n        if (!exp_type.isCompatible(typeInfo.type)) {\n          if (\n            exp_type.dimensions === typeInfo.type.dimensions &&\n            !exp_type.innerType.isCompatible(typeInfo.type.innerType)\n          ) {\n            if (\n              !Config.enable_type_casting ||\n              !Store.canImplicitTypeCast(\n                typeInfo.type.innerType,\n                exp_type.innerType\n              )\n            ) {\n              const stringInfo = typeInfo.type.stringInfo();\n              const info = stringInfo[0];\n              const exp_type_string_info = exp_type.stringInfo();\n              const exp_type_info = exp_type_string_info[0];\n              throw ProcessorErrorFactory.incompatible_types_full(\n                info.type,\n                info.dim,\n                exp_type_info.type,\n                exp_type_info.dim,\n                exp.toString(),\n                cmd.sourceInfo\n              );\n            }\n          } else {\n            switch (exp_type.dimensions) {\n              case 1: {\n                throw ProcessorErrorFactory.vector_to_matrix_attr(\n                  cmd.id,\n                  exp.toString(),\n                  cmd.sourceInfo\n                );\n              }\n              case 2: {\n                throw ProcessorErrorFactory.matrix_to_vector_attr(\n                  cmd.id,\n                  exp.toString(),\n                  cmd.sourceInfo\n                );\n              }\n            }\n          }\n        }\n      } else if (!exp_type.isCompatible(typeInfo.type)) {\n        if (\n          !Config.enable_type_casting ||\n          !Store.canImplicitTypeCast(typeInfo.type, exp_type)\n        ) {\n          const stringInfo = typeInfo.type.stringInfo();\n          const info = stringInfo[0];\n          const exp_type_string_info = exp_type.stringInfo();\n          const exp_type_info = exp_type_string_info[0];\n          throw ProcessorErrorFactory.incompatible_types_full(\n            info.type,\n            info.dim,\n            exp_type_info.type,\n            exp_type_info.dim,\n            exp.toString(),\n            cmd.sourceInfo\n          );\n        }\n      }\n      return optional;\n    } else if (cmd instanceof Break) {\n      return optional;\n    } else if (cmd instanceof IfThenElse) {\n      const resultType = this.evaluateExpressionType(cmd.condition);\n      if (!resultType.isCompatible(Types.BOOLEAN)) {\n        throw ProcessorErrorFactory.if_condition_type_full(\n          cmd.condition.toString(),\n          cmd.sourceInfo\n        );\n      }\n      if (cmd.ifFalse instanceof IfThenElse) {\n        return (\n          this.checkCommands(type, cmd.ifTrue.commands, optional) &&\n          this.checkCommand(type, cmd.ifFalse, optional)\n        );\n      } else if (cmd.ifFalse != null) {\n        return (\n          this.checkCommands(type, cmd.ifTrue.commands, optional) &&\n          this.checkCommands(type, cmd.ifFalse.commands, optional)\n        );\n      } else {\n        return this.checkCommands(type, cmd.ifTrue.commands, optional);\n      }\n    } else if (cmd instanceof FunctionCall) {\n      let fun = null;\n      if (cmd.isMainCall) {\n        fun = this.getMainFunction();\n      } else {\n        fun = this.findFunction(cmd.id);\n      }\n      if (fun === null) {\n        throw ProcessorErrorFactory.function_missing_full(\n          cmd.id,\n          cmd.sourceInfo\n        );\n      }\n      this.assertParameters(fun, cmd.actualParameters);\n      return optional;\n    } else if (cmd instanceof Return) {\n      const funcName = this.currentFunction.isMain\n        ? LanguageDefinedFunction.getMainFunctionName()\n        : this.currentFunction.name;\n      if (cmd.expression === null && !type.isCompatible(Types.VOID)) {\n        const stringInfo = type.stringInfo();\n        const info = stringInfo[0];\n        throw ProcessorErrorFactory.invalid_void_return_full(\n          funcName,\n          info.type,\n          info.dim,\n          cmd.sourceInfo\n        );\n      } else if (cmd.expression !== null) {\n        const resultType = this.evaluateExpressionType(cmd.expression);\n        if (!type.isCompatible(resultType)) {\n          if (\n            !Config.enable_type_casting ||\n            !Store.canImplicitTypeCast(type, resultType)\n          ) {\n            const stringInfo = type.stringInfo();\n            const info = stringInfo[0];\n            throw ProcessorErrorFactory.invalid_return_type_full(\n              funcName,\n              info.type,\n              info.dim,\n              cmd.sourceInfo\n            );\n          }\n        }\n        return true;\n      } else {\n        return true;\n      }\n    }\n  }\n\n  checkCommands (type, cmds, optional) {\n    return cmds.reduce(\n      (last, next) => this.checkCommand(type, next, optional) || last,\n      optional\n    );\n  }\n\n  /**\n   *\n   * @param {import('./../../ast/commands/function').Function} fun\n   * @param {Expression[]} actualParametersList\n   */\n  assertParameters (fun, actualParametersList) {\n    const parameterList = fun.formalParameters;\n    if (\n      parameterList.length > actualParametersList.length ||\n      (parameterList.length !== actualParametersList.length &&\n        !fun.hasVariadic())\n    ) {\n      throw ProcessorErrorFactory.invalid_parameters_size_full(\n        fun.name,\n        actualParametersList.length,\n        fun.formalParameters.length,\n        null\n      );\n    }\n\n    for (\n      let i = 0, j = 0;\n      i < parameterList.length && j < actualParametersList.length;\n      i += 1, j += 1\n    ) {\n      const formalParam = parameterList[i];\n      if (formalParam.variadic && i + 1 !== parameterList.length) {\n        throw \"A function variadic parameter must be its last parameter!\";\n      }\n      if (formalParam.variadic) {\n        j = this.assertVariadicParameter(\n          fun,\n          formalParam,\n          j,\n          actualParametersList\n        );\n      } else {\n        const param = actualParametersList[j];\n        this.assertParameter(fun, formalParam, param);\n      }\n    }\n  }\n\n  evaluateVectorLiteralType (literal, type) {\n    // console.log(literal);\n    for (let i = 0; i < literal.value.length; i += 1) {\n      const exp = literal.value[i];\n      const expType = this.evaluateExpressionType(exp);\n      let compatible = false;\n      if (expType instanceof MultiType) {\n        compatible = expType.isCompatible(type.innerType);\n      } else {\n        compatible = type.canAccept(expType, 1);\n      }\n      if (!compatible) {\n        if (\n          !Config.enable_type_casting ||\n          !Store.canImplicitTypeCast(type.innerType, expType)\n        ) {\n          const stringInfo = type.stringInfo();\n          const info = stringInfo[0];\n          const result_string_info = expType.stringInfo();\n          const result_info = result_string_info[0];\n          throw ProcessorErrorFactory.incompatible_types_full(\n            info.type,\n            0,\n            result_info.type,\n            result_info.dim,\n            exp.toString(),\n            literal.sourceInfo\n          );\n        }\n      }\n    }\n    return type;\n  }\n\n  /**\n   *\n   * @param {import('./../../ast/commands/function').Function} fun\n   * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam\n   * @param {number} index\n   * @param {Expression[]} actualParametersList\n   */\n  assertVariadicParameter (fun, formalParam, index, actualParametersList) {\n    let i;\n    for (i = index; i < actualParametersList.length; i += 1) {\n      this.assertParameter(fun, formalParam, actualParametersList[i]);\n    }\n    return i - 1;\n  }\n\n  /**\n   *\n   * @param {import('./../../ast/commands/function').Function} fun\n   * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam\n   * @param {Expression} actualParameter\n   */\n  assertParameter (fun, formalParam, actualParameter) {\n    // const id = formalParam.id;\n    if (formalParam.byRef) {\n      if (actualParameter instanceof VariableLiteral) {\n        const variable = this.findSymbol(actualParameter.id, this.symbolMap);\n        if (variable.isConst) {\n          throw ProcessorErrorFactory.invalid_const_ref_full(\n            fun.name,\n            actualParameter.toString(),\n            actualParameter.sourceInfo\n          );\n        }\n      } else if (\n        !(\n          actualParameter instanceof VariableLiteral ||\n          actualParameter instanceof ArrayAccess\n        )\n      ) {\n        throw ProcessorErrorFactory.invalid_parameter_type_full(\n          fun.name,\n          actualParameter.toString(),\n          actualParameter.sourceInfo\n        );\n      }\n    }\n    const resultType = this.evaluateExpressionType(actualParameter);\n    if (\n      resultType instanceof MultiType &&\n      formalParam.type instanceof MultiType\n    ) {\n      let shared = 0;\n      for (let j = 0; j < resultType.types.length; ++j) {\n        const element = resultType.types[j];\n        if (formalParam.type.types.indexOf(element) !== -1) {\n          shared += 1;\n        }\n      }\n      if (shared <= 0) {\n        if (Config.enable_type_casting && !formalParam.byRef) {\n          if (\n            (!resultType.isCompatible(Types.INTEGER) &&\n              !resultType.isCompatible(Types.REAL)) ||\n            formalParam.type.isCompatible(Types.INTEGER) ||\n            formalParam.type.isCompatible(Types.REAL)\n          ) {\n            throw ProcessorErrorFactory.invalid_parameter_type_full(\n              fun.name,\n              actualParameter.toString(),\n              actualParameter.sourceInfo\n            );\n          }\n        }\n      }\n    } else if (resultType instanceof MultiType) {\n      if (!resultType.isCompatible(formalParam.type)) {\n        if (Config.enable_type_casting && !formalParam.byRef) {\n          if (\n            (!resultType.isCompatible(Types.INTEGER) &&\n              !resultType.isCompatible(Types.REAL)) ||\n            formalParam.type.isCompatible(Types.INTEGER) ||\n            formalParam.type.isCompatible(Types.REAL)\n          ) {\n            throw ProcessorErrorFactory.invalid_parameter_type_full(\n              fun.name,\n              actualParameter.toString(),\n              actualParameter.sourceInfo\n            );\n          }\n        }\n      }\n    } else if (!formalParam.type.isCompatible(resultType)) {\n      if (Config.enable_type_casting && !formalParam.byRef) {\n        if (!Store.canImplicitTypeCast(formalParam.type, resultType)) {\n          throw ProcessorErrorFactory.invalid_parameter_type_full(\n            fun.name,\n            actualParameter.toString(),\n            actualParameter.sourceInfo\n          );\n        }\n      }\n    }\n  }\n}\n","export const Context = Object.freeze({\n  BASE: Symbol('context:base'),\n  BREAKABLE: Symbol('context:breakable'),\n  FUNCTION: Symbol('context:function')\n});","import { Store } from \"./store/store\";\nimport { Modes } from \"./modes\";\nimport { Context } from \"./context\";\nimport { Types } from \"./../typeSystem/types\";\nimport { Operators } from \"./../ast/operators\";\nimport { LanguageDefinedFunction } from \"./definedFunctions\";\nimport {\n  resultTypeAfterInfixOp,\n  resultTypeAfterUnaryOp,\n} from \"./compatibilityTable\";\nimport * as Commands from \"./../ast/commands/\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Command } from \"./../ast/commands/command\";\nimport * as Expressions from \"./../ast/expressions/\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Expression } from \"./../ast/expressions/expression\";\nimport * as Utils from \"./../util/utils\";\nimport { ArrayType } from \"./../typeSystem/array_type\";\nimport { convertToString, toInt } from \"../typeSystem/parsers\";\nimport { Config } from \"../util/config\";\nimport { ProcessorErrorFactory } from \"./error/processorErrorFactory\";\nimport { RuntimeError } from \"./error/runtimeError\";\nimport { Location } from \"../memory/location\";\nimport { StoreValue } from \"./store/value/store_value\";\nimport { StoreValueRef } from \"./store/value/store_value_ref\";\nimport { ArrayStoreValue } from \"./store/value/array_store_value\";\nimport { ArrayStoreValueRef } from \"./store/value/array_store_value_ref\";\nimport { StoreValueAddress } from \"./store/value/store_value_address\";\nimport { LocalizedStrings } from \"../services/localizedStringsService\";\n\nexport class IVProgProcessor {\n  static get MAIN_INTERNAL_ID () {\n    return \"$main\";\n  }\n\n  constructor (ast) {\n    this.ast = ast;\n    this.globalStore = new Store(\"$global\");\n    this.stores = [this.globalStore];\n    this.context = [Context.BASE];\n    this.input = null;\n    this.forceKill = false;\n    this.output = null;\n    this.mode = Modes.RUN;\n    /**\n     * Stores the sourceInfo of every function call, command or expression\n     */\n    this.function_call_stack = [];\n    this.instruction_count = 0;\n    this.function_call_count = 0;\n  }\n\n  registerInput (input) {\n    if (this.input !== null) this.input = null;\n    this.input = input;\n  }\n\n  registerOutput (output) {\n    if (this.output !== null) this.output = null;\n    this.output = output;\n  }\n\n  checkContext (context) {\n    return this.context[this.context.length - 1] === context;\n  }\n\n  ignoreSwitchCases (store) {\n    if (store.mode === Modes.RETURN) {\n      return true;\n    } else if (store.mode === Modes.BREAK) {\n      return true;\n    } else {\n      return false;\n    }\n  }\n\n  prepareState () {\n    if (this.stores !== null) {\n      for (let i = 0; i < this.stores.length; i++) {\n        delete this.stores[i];\n      }\n      this.stores = null;\n    }\n    if (this.globalStore !== null) this.globalStore = null;\n    this.globalStore = new Store(\"$global\");\n    this.stores = [this.globalStore];\n    this.context = [Context.BASE];\n    this.instruction_count = 0;\n    this.mode = Modes.RUN;\n  }\n\n  async interpretAST () {\n    this.prepareState();\n    Location.clear();\n    await this.initGlobal();\n    const mainFunc = this.findMainFunction();\n    if (mainFunc === null) {\n      throw ProcessorErrorFactory.main_missing();\n    }\n    return this.runFunction(mainFunc, [], this.globalStore);\n  }\n\n  async initGlobal () {\n    if (!this.checkContext(Context.BASE)) {\n      return ProcessorErrorFactory.invalid_global_var();\n    }\n    return this.executeCommands(this.globalStore, this.ast.global);\n  }\n\n  findMainFunction () {\n    return this.ast.functions.find((v) => v.isMain);\n  }\n\n  findFunction (name) {\n    if (name.match(/^\\$.+$/)) {\n      if (name === IVProgProcessor.MAIN_INTERNAL_ID) {\n        return this.findMainFunction();\n      }\n      const fun = LanguageDefinedFunction.getFunction(name);\n      if (!fun) {\n        throw ProcessorErrorFactory.not_implemented(name);\n      }\n      return fun;\n    } else {\n      const val = this.ast.functions.find((v) => v.name === name);\n      if (!val) {\n        throw ProcessorErrorFactory.function_missing(name);\n      }\n      return val;\n    }\n  }\n\n  async runFunction (func, actualParameters, store) {\n    const funcName = func.isMain ? IVProgProcessor.MAIN_INTERNAL_ID : func.name;\n    const funcStore = new Store(funcName);\n    funcStore.extendStore(this.globalStore);\n    await this.associateParameters(\n      func.formalParameters,\n      actualParameters,\n      store,\n      funcStore\n    );\n    this.context.push(Context.FUNCTION);\n    this.stores.push(funcStore);\n    const stoWithVars = await this.executeCommands(\n      funcStore,\n      func.variablesDeclarations\n    );\n    const finalSto = await this.executeCommands(stoWithVars, func.commands);\n    this.stores.pop();\n    this.context.pop();\n    return finalSto;\n  }\n\n  /**\n   *\n   * @param {import('./../ast/commands/formalParameter').FormalParameter[]} formal_params\n   * @param {Expression[]} effective_params\n   * @param {Store} caller_store\n   * @param {Store} callee_store\n   */\n  async associateParameters (\n    formal_params,\n    effective_params,\n    caller_store,\n    callee_store\n  ) {\n    const funcName =\n      callee_store.name === IVProgProcessor.MAIN_INTERNAL_ID\n        ? LanguageDefinedFunction.getMainFunctionName()\n        : callee_store.name;\n\n    const hasVariadic = formal_params.some((p) => p.variadic);\n\n    if (\n      (formal_params.length != effective_params.length && !hasVariadic) ||\n      formal_params.length > effective_params.length\n    ) {\n      throw ProcessorErrorFactory.invalid_parameters_size(\n        funcName,\n        formal_params.length,\n        effective_params.length\n      );\n    }\n    for (\n      let i = 0, j = 0;\n      i < formal_params.length && j < effective_params.length;\n      i += 1, j += 1\n    ) {\n      const formalParameter = formal_params[i];\n      if (formalParameter.variadic) {\n        [j, callee_store] = await this.associateVariadicParameter(\n          funcName,\n          formalParameter,\n          j,\n          effective_params,\n          caller_store,\n          callee_store\n        );\n      } else {\n        const actualParam = effective_params[i];\n        callee_store = await this.associateParameter(\n          funcName,\n          formalParameter,\n          actualParam,\n          caller_store,\n          callee_store\n        );\n      }\n    }\n    return callee_store;\n  }\n\n  /**\n   *\n   * @param {string} funcName\n   * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter\n   * @param {number} index\n   * @param {Expression[]} effective_params\n   * @param {Store} caller_store\n   * @param {Store} callee_store\n   */\n  async associateVariadicParameter (\n    funcName,\n    formalParameter,\n    index,\n    effective_params,\n    caller_store,\n    callee_store\n  ) {\n    let i;\n    let count = 1;\n    for (i = index; i < effective_params.length; i += 1) {\n      const actualParam = effective_params[i];\n      callee_store = await this.associateParameter(\n        funcName,\n        formalParameter,\n        actualParam,\n        caller_store,\n        callee_store,\n        count\n      );\n      count += 1;\n    }\n    const variadicCount = new StoreValue(Types.INTEGER, count, undefined, true);\n    callee_store.insertStore(`${formalParameter.id}.0`, variadicCount);\n    return [i - 1, callee_store];\n  }\n\n  /**\n   *\n   * @param {string} funcName\n   * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter\n   * @param {Expression} actualParameter\n   * @param {Store} callerStore\n   * @param {Store} calleeStore\n   * @param {number} variadicCount The number of the current value being assigned to the variadic parameter, default 0\n   */\n  async associateParameter (\n    funcName,\n    formalParameter,\n    actualParameter,\n    callerStore,\n    calleeStore,\n    variadicCount = 0\n  ) {\n    const actualValue = await this.evaluateExpression(\n      callerStore,\n      actualParameter\n    );\n\n    let shouldTypeCast = false;\n\n    if (!formalParameter.type.isCompatible(actualValue.type)) {\n      if (\n        Config.enable_type_casting &&\n        !formalParameter.byRef &&\n        Store.canImplicitTypeCast(formalParameter.type, actualValue.type)\n      ) {\n        shouldTypeCast = true;\n      } else {\n        throw ProcessorErrorFactory.invalid_parameter_type(\n          funcName,\n          actualParameter.toString()\n        );\n      }\n    }\n\n    if (formalParameter.byRef && !actualValue.inStore()) {\n      throw ProcessorErrorFactory.invalid_ref(\n        funcName,\n        actualParameter.toString()\n      );\n    }\n\n    if (formalParameter.byRef) {\n      const realObj = callerStore.getStoreObject(actualValue.id);\n      let ref = null;\n      if (actualValue instanceof ArrayStoreValue) {\n        // it's a vector or matrix...\n        const values = actualValue.get();\n        const array_type = actualValue.type;\n        const addresses = values.map((v) =>\n          realObj.getLocAddressOf(v.line, v.column)\n        );\n        const columns = actualValue.isVector() ? 0 : actualValue.columns;\n        ref = new ArrayStoreValueRef(\n          array_type,\n          values,\n          addresses,\n          actualValue.lines,\n          columns,\n          realObj.id\n        );\n      } else {\n        if (actualValue instanceof StoreValueAddress) {\n          const line = actualValue.line;\n          const column = actualValue.column;\n          ref = new StoreValueRef(\n            actualValue.type,\n            actualValue.get(),\n            realObj.getLocAddressOf(line, column),\n            realObj.id\n          );\n          ref.setReferenceDimension(realObj.type.dimensions);\n        } else {\n          ref = new StoreValueRef(\n            actualValue.type,\n            actualValue.get(),\n            realObj.locAddress,\n            realObj.id\n          );\n        }\n      }\n      let varID = formalParameter.id;\n      if (formalParameter.variadic) varID = `${varID}.${variadicCount}`;\n      calleeStore.insertStore(varID, ref);\n    } else {\n      let realValue = actualValue;\n      if (shouldTypeCast) {\n        realValue = Store.doImplicitCasting(formalParameter.type, realValue);\n      }\n      let varID = formalParameter.id;\n      if (formalParameter.variadic) varID = `${varID}.${variadicCount}`;\n      calleeStore.insertStore(varID, realValue);\n    }\n    return calleeStore;\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Command[]} cmds\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeCommands (store, cmds) {\n    // helper to partially apply a function, in this case executeCommand\n    let sto = store;\n    for (let i = 0; i < cmds.length; i += 1) {\n      sto = await this.executeCommand(sto, cmds[i]);\n    }\n    return sto;\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Command} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeCommand (store, cmd) {\n    this.instruction_count += 1;\n    if (this.instruction_count % Config.suspend_threshold == 0) {\n      //every Config.suspend_threshold instruction should briefly delay its execution in order to allow the browser to process other things\n      await Utils.sleep(3);\n    }\n\n    // Checks if it must interrupt the execution for some reason\n    if (this.instruction_count >= Config.max_instruction_count) {\n      throw ProcessorErrorFactory.exceed_max_instructions();\n    } else if (this.forceKill) {\n      throw \"FORCED_KILL!\";\n    } else if (store.mode === Modes.PAUSE) {\n      return this.executeCommand(store, cmd);\n    } else if (store.mode === Modes.RETURN) {\n      return store;\n    } else if (\n      this.checkContext(Context.BREAKABLE) &&\n      store.mode === Modes.BREAK\n    ) {\n      return store;\n    } else if (this.mode === Modes.ABORT) {\n      throw LocalizedStrings.getMessage(\"aborted_execution\");\n    }\n\n    if (cmd instanceof Commands.Declaration) {\n      return this.executeDeclaration(store, cmd);\n    } else if (cmd instanceof Commands.ArrayIndexAssign) {\n      return this.executeArrayIndexAssign(store, cmd);\n    } else if (cmd instanceof Commands.Assign) {\n      return this.executeAssign(store, cmd);\n    } else if (cmd instanceof Commands.Break) {\n      return this.executeBreak(store, cmd);\n    } else if (cmd instanceof Commands.Return) {\n      return this.executeReturn(store, cmd);\n    } else if (cmd instanceof Commands.IfThenElse) {\n      return this.executeIfThenElse(store, cmd);\n    } else if (cmd instanceof Commands.RepeatUntil) {\n      return this.executeRepeatUntil(store, cmd);\n    } else if (cmd instanceof Commands.While) {\n      return this.executeWhile(store, cmd);\n    } else if (cmd instanceof Commands.For) {\n      return this.executeFor(store, cmd);\n    } else if (cmd instanceof Commands.Switch) {\n      return this.executeSwitch(store, cmd);\n    } else if (cmd instanceof Expressions.FunctionCall) {\n      return this.executeFunctionCall(store, cmd);\n    } else if (cmd instanceof Commands.SysCall) {\n      return this.executeSysCall(store, cmd);\n    } else {\n      throw ProcessorErrorFactory.unknown_command(cmd.sourceInfo);\n    }\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.SysCall} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeSysCall (store, cmd) {\n    const func = cmd.langFunc.bind(this);\n    return func(store, cmd);\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.FunctionCall} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeFunctionCall (store, cmd) {\n    let func = null;\n    if (cmd.isMainCall) {\n      func = this.findMainFunction();\n    } else {\n      func = this.findFunction(cmd.id);\n    }\n    this.function_call_stack.push(cmd.sourceInfo);\n    const sto = await this.runFunction(func, cmd.actualParameters, store);\n    sto.destroy();\n    if (\n      !Types.VOID.isCompatible(func.returnType) &&\n      sto.mode !== Modes.RETURN\n    ) {\n      const funcName =\n        func.name === IVProgProcessor.MAIN_INTERNAL_ID\n          ? LanguageDefinedFunction.getMainFunctionName()\n          : func.name;\n      throw ProcessorErrorFactory.function_no_return(funcName);\n    } else {\n      this.function_call_stack.pop();\n      return store;\n    }\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.Switch} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeSwitch (store, cmd) {\n    this.context.push(Context.BREAKABLE);\n    const switchCases = cmd.cases;\n    let lastStore = store;\n    let lastCaseCheckResult = false;\n    for (\n      let i = 0;\n      i < switchCases.length && !this.ignoreSwitchCases(lastStore);\n      i += 1\n    ) {\n      const switchCase = switchCases[i];\n      if (lastCaseCheckResult || switchCase.isDefault) {\n        lastStore = await this.executeCommands(lastStore, switchCase.commands);\n      } else {\n        const equalityInfixApp = new Expressions.InfixApp(\n          Operators.EQ,\n          cmd.expression,\n          switchCase.expression\n        );\n        equalityInfixApp.sourceInfo = switchCase.sourceInfo;\n        const result = await this.evaluateExpression(\n          lastStore,\n          equalityInfixApp\n        );\n        if (result.get()) {\n          lastStore = await this.executeCommands(\n            lastStore,\n            switchCase.commands\n          );\n        }\n        lastCaseCheckResult = result.get();\n      }\n    }\n    this.context.pop();\n    if (lastStore.mode === Modes.BREAK) {\n      lastStore.mode = Modes.RUN;\n    }\n    return lastStore;\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.For} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeFor (store, cmd) {\n    //BEGIN for -> while rewrite\n    const initCmd = new Commands.Assign(cmd.for_id.id, cmd.for_from);\n    initCmd.sourceInfo = cmd.sourceInfo;\n    // Assume for is iterating forward and that pass is not missing\n    let passValue = cmd.for_pass;\n    let condition = new Expressions.InfixApp(\n      Operators.LT,\n      cmd.for_id,\n      cmd.for_to\n    );\n\n    if (cmd.for_pass == null) {\n      passValue = new Expressions.IntLiteral(toInt(1));\n      const checkEndGTBegin = await this.evaluateExpression(\n        store,\n        new Expressions.InfixApp(Operators.GE, cmd.for_to, cmd.for_from)\n      );\n      if (!checkEndGTBegin.get()) {\n        passValue = new Expressions.IntLiteral(toInt(-1));\n        condition = new Expressions.InfixApp(\n          Operators.GT,\n          cmd.for_id,\n          cmd.for_to\n        );\n      }\n    } else {\n      const isForward = await this.evaluateExpression(\n        store,\n        new Expressions.InfixApp(\n          Operators.GE,\n          cmd.for_pass,\n          new Expressions.IntLiteral(toInt(0))\n        )\n      );\n      if (!isForward.get()) {\n        condition = new Expressions.InfixApp(\n          Operators.GT,\n          cmd.for_id,\n          cmd.for_to\n        );\n      }\n    }\n\n    condition.sourceInfo = cmd.sourceInfo;\n    const increment = new Commands.Assign(\n      cmd.for_id.id,\n      new Expressions.InfixApp(Operators.ADD, cmd.for_id, passValue)\n    );\n    increment.sourceInfo = cmd.sourceInfo;\n    const whileBlock = new Commands.CommandBlock(\n      [],\n      cmd.commands.concat(increment)\n    );\n    const forAsWhile = new Commands.While(condition, whileBlock);\n    forAsWhile.sourceInfo = cmd.sourceInfo;\n    //END for -> while rewrite\n    const newCmdList = [initCmd, forAsWhile];\n    return this.executeCommands(store, newCmdList);\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.RepeatUntil} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeRepeatUntil (store, cmd) {\n    this.context.push(Context.BREAKABLE);\n    const sto = await this.executeCommands(store, cmd.commands);\n    if (sto.mode === Modes.BREAK) {\n      this.context.pop();\n      sto.mode = Modes.RUN;\n      return sto;\n    }\n    const checkCondition = await this.evaluateExpression(sto, cmd.expression);\n    if (!checkCondition.type.isCompatible(Types.BOOLEAN)) {\n      throw ProcessorErrorFactory.loop_condition_type_full(cmd.sourceInfo);\n    }\n    this.context.pop();\n    if (checkCondition.get()) {\n      return sto;\n    } else {\n      return this.executeCommand(sto, cmd);\n    }\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.While} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeWhile (store, cmd) {\n    this.context.push(Context.BREAKABLE);\n    const checkCondition = await this.evaluateExpression(store, cmd.expression);\n    if (!checkCondition.type.isCompatible(Types.BOOLEAN)) {\n      throw ProcessorErrorFactory.loop_condition_type_full(\n        cmd.expression.toString(),\n        cmd.sourceInfo\n      );\n    }\n    if (checkCondition.get()) {\n      const sto = await this.executeCommands(store, cmd.commands);\n      this.context.pop();\n      if (sto.mode === Modes.BREAK) {\n        sto.mode = Modes.RUN;\n        return sto;\n      }\n      return this.executeCommand(sto, cmd);\n    } else {\n      this.context.pop();\n      return store;\n    }\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.IfThenElse} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeIfThenElse (store, cmd) {\n    const isTrue = await this.evaluateExpression(store, cmd.condition);\n    if (!isTrue.type.isCompatible(Types.BOOLEAN)) {\n      throw ProcessorErrorFactory.if_condition_type_full(\n        cmd.condition.toString(),\n        cmd.sourceInfo\n      );\n    }\n    if (isTrue.get()) {\n      return this.executeCommands(store, cmd.ifTrue.commands);\n    } else if (cmd.ifFalse !== null) {\n      if (cmd.ifFalse instanceof Commands.IfThenElse) {\n        return this.executeCommand(store, cmd.ifFalse);\n      } else {\n        return this.executeCommands(store, cmd.ifFalse.commands);\n      }\n    } else {\n      return store;\n    }\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.Return} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeReturn (store, cmd) {\n    const funcName =\n      store.name === IVProgProcessor.MAIN_INTERNAL_ID\n        ? LanguageDefinedFunction.getMainFunctionName()\n        : store.name;\n    // console.log(funcName,  store.name === IVProgProcessor.MAIN_INTERNAL_ID);\n    const func = this.findFunction(store.name);\n    const funcType = func.returnType;\n    const value = await this.evaluateExpression(store, cmd.expression);\n    if (value === null && funcType.isCompatible(Types.VOID)) {\n      store.mode = Modes.RETURN;\n      return store;\n    }\n\n    let real_value = value;\n    if (value === null || !funcType.isCompatible(value.type)) {\n      if (\n        !Config.enable_type_casting ||\n        !Store.canImplicitTypeCast(funcType, value.type)\n      ) {\n        const stringInfo = funcType.stringInfo();\n        const info = stringInfo[0];\n        throw ProcessorErrorFactory.invalid_return_type_full(\n          funcName,\n          info.type,\n          info.dim,\n          cmd.sourceInfo\n        );\n      }\n      real_value = Store.doImplicitCasting(funcType, value);\n    }\n\n    store.insertStore(\"$\", real_value);\n    store.mode = Modes.RETURN;\n    return store;\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.Break} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeBreak (store, cmd) {\n    if (this.checkContext(Context.BREAKABLE)) {\n      store.mode = Modes.BREAK;\n      return store;\n    } else {\n      throw ProcessorErrorFactory.unexpected_break_command_full(cmd.sourceInfo);\n    }\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.Assign} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeAssign (store, cmd) {\n    const inStore = store.applyStore(cmd.id);\n    if (inStore.isConst) {\n      throw ProcessorErrorFactory.invalid_const_assignment_full(\n        cmd.id,\n        cmd.sourceInfo\n      );\n    }\n    const value = await this.evaluateExpression(store, cmd.expression);\n    let realValue = value;\n    if (!inStore.type.isCompatible(realValue.type)) {\n      if (\n        Config.enable_type_casting &&\n        Store.canImplicitTypeCast(inStore.type, value.type)\n      ) {\n        realValue = Store.doImplicitCasting(inStore.type, realValue);\n      } else {\n        const stringInfo = inStore.type.stringInfo();\n        const info = stringInfo[0];\n        const exp_type_string_info = value.type.stringInfo();\n        const exp_type_info = exp_type_string_info[0];\n        const exp = cmd.expression.toString();\n        throw ProcessorErrorFactory.incompatible_types_full(\n          info.type,\n          info.dim,\n          exp_type_info.type,\n          exp_type_info.dim,\n          exp,\n          cmd.sourceInfo\n        );\n      }\n    }\n\n    if (inStore instanceof ArrayStoreValue) {\n      const columns = realValue.columns == null ? 0 : realValue.columns;\n      if (inStore.lines !== realValue.lines || inStore.columns !== columns) {\n        const exp = cmd.expression.toString();\n        if (inStore.isVector()) {\n          throw ProcessorErrorFactory.invalid_vector_assignment_full(\n            cmd.id,\n            inStore.lines,\n            exp,\n            realValue.lines,\n            cmd.sourceInfo\n          );\n        } else {\n          throw ProcessorErrorFactory.invalid_matrix_assignment_full(\n            cmd.id,\n            inStore.lines,\n            inStore.columns,\n            exp,\n            realValue.lines,\n            realValue.columns,\n            cmd.sourceInfo\n          );\n        }\n      }\n    }\n\n    store.updateStore(cmd.id, realValue);\n    return store;\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.ArrayIndexAssign} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeArrayIndexAssign (store, cmd) {\n    const mustBeArray = store.applyStore(cmd.id);\n    let used_dims = 0;\n    if (mustBeArray.isConst) {\n      throw ProcessorErrorFactory.invalid_const_assignment_full(\n        cmd.id,\n        cmd.sourceInfo\n      );\n    }\n    if (!(mustBeArray.type instanceof ArrayType)) {\n      throw ProcessorErrorFactory.invalid_array_access_full(\n        cmd.id,\n        cmd.sourceInfo\n      );\n    }\n    const lineSV = await this.evaluateExpression(store, cmd.line);\n    if (!Types.INTEGER.isCompatible(lineSV.type)) {\n      throw ProcessorErrorFactory.array_dimension_not_int_full(cmd.sourceInfo);\n    }\n    used_dims += 1;\n    const line = lineSV.get().toNumber();\n    const columnSV = await this.evaluateExpression(store, cmd.column);\n    let column = null;\n    if (columnSV != null) {\n      if (!Types.INTEGER.isCompatible(columnSV.type)) {\n        throw ProcessorErrorFactory.array_dimension_not_int_full(\n          cmd.sourceInfo\n        );\n      }\n      column = columnSV.get().toNumber();\n      used_dims += 1;\n    }\n    const value = await this.evaluateExpression(store, cmd.expression);\n    let actualValue = value;\n    if (line >= mustBeArray.lines) {\n      if (mustBeArray.isVector) {\n        throw ProcessorErrorFactory.vector_line_outbounds_full(\n          cmd.id,\n          line,\n          mustBeArray.lines,\n          cmd.sourceInfo\n        );\n      } else {\n        throw ProcessorErrorFactory.matrix_line_outbounds_full(\n          cmd.id,\n          line,\n          mustBeArray.lines,\n          cmd.sourceInfo\n        );\n      }\n    } else if (line < 0) {\n      throw ProcessorErrorFactory.array_dimension_not_positive_full(\n        cmd.sourceInfo\n      );\n    }\n    if (column != null && mustBeArray.columns === 0) {\n      throw ProcessorErrorFactory.vector_not_matrix_full(\n        cmd.id,\n        cmd.sourceInfo\n      );\n    }\n    if (column != null) {\n      if (column >= mustBeArray.columns) {\n        throw ProcessorErrorFactory.matrix_column_outbounds_full(\n          cmd.id,\n          column,\n          mustBeArray.columns,\n          cmd.sourceInfo\n        );\n      } else if (column < 0) {\n        throw ProcessorErrorFactory.array_dimension_not_positive_full(\n          cmd.sourceInfo\n        );\n      }\n    }\n\n    if (!mustBeArray.type.canAccept(value.type, used_dims)) {\n      if (\n        !Config.enable_type_casting ||\n        !Store.canImplicitTypeCast(mustBeArray.type.innerType, value.type)\n      ) {\n        const type = mustBeArray.type.innerType;\n        const stringInfo = type.stringInfo();\n        const info = stringInfo[0];\n        const exp_type_string_info = value.type.stringInfo();\n        const exp_type_info = exp_type_string_info[0];\n        const exp = cmd.expression.toString();\n        throw ProcessorErrorFactory.incompatible_types_full(\n          info.type,\n          info.dim,\n          exp_type_info.type,\n          exp_type_info.dim,\n          exp,\n          cmd.sourceInfo\n        );\n      }\n      actualValue = Store.doImplicitCasting(mustBeArray.type.innerType, value);\n    }\n\n    const current_value = mustBeArray.getAt(line, column);\n    if (current_value instanceof ArrayStoreValue) {\n      if (\n        current_value.lines !== actualValue.lines ||\n        current_value.columns !== actualValue.columns\n      ) {\n        const exp = cmd.expression.toString();\n        throw ProcessorErrorFactory.invalid_matrix_index_assign_full(\n          cmd.id,\n          line,\n          current_value.lines,\n          exp,\n          actualValue.lines,\n          cmd.sourceInfo\n        );\n      }\n    }\n\n    return store.updateStoreArray(cmd.id, actualValue, line, column);\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.Declaration} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeDeclaration (store, cmd) {\n    if (cmd instanceof Commands.ArrayDeclaration) {\n      return this.executeArrayDeclaration(store, cmd);\n    } else {\n      let temp = new StoreValue(cmd.type, null, null, cmd.isConst);\n      if (cmd.initial !== null) {\n        const value = await this.evaluateExpression(store, cmd.initial);\n        let realValue = value;\n        if (!value.type.isCompatible(cmd.type)) {\n          if (\n            Config.enable_type_casting &&\n            Store.canImplicitTypeCast(cmd.type, value.type)\n          ) {\n            realValue = Store.doImplicitCasting(cmd.type, realValue);\n          } else {\n            const stringInfo = value.type.stringInfo();\n            const info = stringInfo[0];\n            const exp_type_string_info = value.type.stringInfo();\n            const exp_type_info = exp_type_string_info[0];\n            const exp = cmd.expression.toString();\n            throw ProcessorErrorFactory.incompatible_types_full(\n              info.type,\n              info.dim,\n              exp_type_info.type,\n              exp_type_info.dim,\n              exp,\n              cmd.sourceInfo\n            );\n          }\n        }\n        temp = new StoreValue(cmd.type, realValue.get(), null, cmd.isConst);\n      }\n      store.insertStore(cmd.id, temp);\n      return store;\n    }\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Commands.ArrayDeclaration} cmd\n   *\n   * @returns {Promise<Store>}\n   */\n  async executeArrayDeclaration (store, cmd) {\n    const linesSV = await this.evaluateExpression(store, cmd.lines);\n    if (!Types.INTEGER.isCompatible(linesSV.type)) {\n      throw ProcessorErrorFactory.array_dimension_not_int_full(cmd.sourceInfo);\n    }\n    const line = linesSV.get().toNumber();\n    const columnsSV = await this.evaluateExpression(store, cmd.columns);\n    let column = null;\n    if (columnsSV !== null) {\n      if (!Types.INTEGER.isCompatible(columnsSV.type)) {\n        throw ProcessorErrorFactory.array_dimension_not_int_full(\n          cmd.sourceInfo\n        );\n      }\n      column = columnsSV.get().toNumber();\n      if (column < 0) {\n        throw ProcessorErrorFactory.array_dimension_not_positive_full(\n          cmd.sourceInfo\n        );\n      }\n    }\n    let temp = new ArrayStoreValue(\n      cmd.type,\n      [],\n      line,\n      column,\n      null,\n      cmd.isConst\n    );\n    if (cmd.initial !== null) {\n      // array can only be initialized by a literal....\n      const valueList = await this.evaluateArrayLiteral(\n        store,\n        cmd.initial,\n        cmd.type,\n        line,\n        column\n      );\n      temp = new ArrayStoreValue(\n        cmd.type,\n        valueList,\n        line,\n        column,\n        null,\n        cmd.isConst\n      );\n    }\n    store.insertStore(cmd.id, temp);\n    return store;\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Expression} exp\n   *\n   * @returns {Promise<import('./store/value/istore_value').IStoreValue>}\n   */\n  async evaluateExpression (store, exp) {\n    this.instruction_count += 1;\n    if (this.instruction_count % Config.suspend_threshold == 0) {\n      //every Config.suspend_threshold instruction should briefly delay its execution in order to allow the browser to process other things\n      await Utils.sleep(3);\n    }\n    if (this.mode === Modes.ABORT) {\n      throw LocalizedStrings.getMessage(\"aborted_execution\");\n    }\n    if (this.instruction_count >= Config.max_instruction_count) {\n      throw new Error(\n        \"Número de instruções excedeu o limite definido. Verifique se seu código não possui laços infinitos ou muitas chamadas de funções recursivas.\"\n      );\n    }\n    if (exp instanceof Expressions.UnaryApp) {\n      return this.evaluateUnaryApp(store, exp);\n    } else if (exp instanceof Expressions.InfixApp) {\n      return this.evaluateInfixApp(store, exp);\n    } else if (exp instanceof Expressions.ArrayAccess) {\n      return this.evaluateArrayAccess(store, exp);\n    } else if (exp instanceof Expressions.VariableLiteral) {\n      return this.evaluateVariableLiteral(store, exp);\n    } else if (exp instanceof Expressions.IntLiteral) {\n      return this.evaluateLiteral(store, exp);\n    } else if (exp instanceof Expressions.RealLiteral) {\n      return this.evaluateLiteral(store, exp);\n    } else if (exp instanceof Expressions.BoolLiteral) {\n      return this.evaluateLiteral(store, exp);\n    } else if (exp instanceof Expressions.StringLiteral) {\n      return this.evaluateLiteral(store, exp);\n    } else if (exp instanceof Expressions.CharLiteral) {\n      return this.evaluateLiteral(store, exp);\n    } else if (exp instanceof Expressions.ArrayLiteral) {\n      throw new Error(\n        \"Internal Error: The system should not eval an array literal.\"\n      );\n    } else if (exp instanceof Expressions.FunctionCall) {\n      return this.evaluateFunctionCall(store, exp);\n    }\n    return null;\n  }\n\n  async evaluateFunctionCall (store, exp) {\n    if (exp.isMainCall) {\n      throw ProcessorErrorFactory.void_in_expression_full(\n        LanguageDefinedFunction.getMainFunctionName(),\n        exp.sourceInfo\n      );\n    }\n    const func = this.findFunction(exp.id);\n    if (Types.VOID.isCompatible(func.returnType)) {\n      throw ProcessorErrorFactory.void_in_expression_full(\n        exp.id,\n        exp.sourceInfo\n      );\n    }\n    if (this.function_call_stack.length >= Config.max_call_stack) {\n      throw ProcessorErrorFactory.exceeded_recursive_calls(exp.sourceInfo);\n    }\n    this.function_call_stack.push(exp.sourceInfo);\n    const sto = await this.runFunction(func, exp.actualParameters, store);\n    if (sto.mode !== Modes.RETURN) {\n      throw new Error(\n        \"!!!Internal error: the function that was called did not have a return command or did not set the store mode properly -> \" +\n          exp.id\n      );\n    }\n    const val = sto.applyStore(\"$\");\n    sto.destroy();\n    this.function_call_stack.pop();\n    return val;\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Expressions.ArrayLiteral} exp\n   * @param {ArrayType} type\n   *\n   * @returns {Promise<StoreValue[]>}\n   */\n  async evaluateArrayLiteral (store, exp, type, lines, columns) {\n    if (!exp.isVector) {\n      if (columns == null) {\n        throw new Error(\n          \"This should never happen: Vector cannot be initialized by a matrix\"\n        );\n      }\n      const storeValueMatrix = await this.evaluateMatrix(\n        store,\n        exp,\n        type,\n        lines,\n        columns\n      );\n      return storeValueMatrix.reduce((prev, next) => prev.concat(next), []);\n    } else {\n      if (columns != null) {\n        throw new Error(\n          \"This should never happen: Matrix cannot be initialized by a vector\"\n        );\n      }\n      return this.evaluateVector(store, exp, type, lines);\n    }\n  }\n\n  /**\n   * Evalautes a list of literals and expression composing the vector\n   * @param {Store} store\n   * @param {Expressions.ArrayLiteral} exps\n   * @param {ArrayType} type\n   * @param {number} n_elements\n   *\n   * @returns {Promise<StoreValue[]>} store object list\n   */\n  async evaluateVector (store, exps, type, n_elements) {\n    const values = exps.value;\n    if (n_elements !== values.length) {\n      throw ProcessorErrorFactory.invalid_number_elements_vector(\n        n_elements,\n        exps.toString(),\n        values.length,\n        exps.sourceInfo\n      );\n    }\n    const actualValues = await Promise.all(\n      values.map((exp) => this.evaluateExpression(store, exp))\n    );\n    return actualValues.map((v, index) => {\n      if (!type.canAccept(v.type, 1)) {\n        if (\n          !Config.enable_type_casting ||\n          !Store.canImplicitTypeCast(type.innerType, v.type)\n        ) {\n          // const stringInfo = v.type.stringInfo();\n          // const info = stringInfo[0];\n          const exp_str = values[index].toString();\n          // TODO - fix error message\n          throw ProcessorErrorFactory.invalid_array_literal_type_full(\n            exp_str,\n            values[index].sourceInfo\n          );\n        }\n        const newValue = Store.doImplicitCasting(type.innerType, v);\n        return newValue;\n      }\n      return v;\n    });\n  }\n\n  /**\n   * Evaluates a list of array literals composing the matrix\n   * @param {Store} store\n   * @param {Expressions.ArrayLiteral} exps\n   * @param {ArrayType} type\n   *\n   * @returns {Promise<StoreValue[][]>}\n   */\n  async evaluateMatrix (store, exps, type, lines, columns) {\n    const values = exps.value;\n    if (values.length !== lines) {\n      throw ProcessorErrorFactory.invalid_number_lines_matrix(\n        lines,\n        exps.toString(),\n        values.length,\n        exps.sourceInfo\n      );\n    }\n    const vectors = values.map((vector) => {\n      const vec_type = new ArrayType(type.innerType, 1);\n      return this.evaluateVector(store, vector, vec_type, columns);\n    });\n    return await Promise.all(vectors);\n  }\n\n  /**\n   *\n   * @param {Store} _\n   * @param {import('../ast/expressions/literal').Literal} exp\n   *\n   * @returns {import('./store/value/istore_value').IStoreValue}\n   */\n  async evaluateLiteral (_, exp) {\n    return new StoreValue(exp.type, exp.value);\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Expressions.VariableLiteral} exp\n   *\n   * @returns {import('./store/value/istore_value').IStoreValue}\n   */\n  async evaluateVariableLiteral (store, exp) {\n    const val = store.applyStore(exp.id);\n    return val;\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Expressions.ArrayAccess} exp\n   *\n   * @returns {import('./store/value/istore_value').IStoreValue}\n   */\n  async evaluateArrayAccess (store, exp) {\n    const mustBeArray = store.getStoreObject(exp.id);\n    if (!(mustBeArray.type instanceof ArrayType)) {\n      throw ProcessorErrorFactory.invalid_array_access_full(\n        exp.id,\n        exp.sourceInfo\n      );\n    }\n    const lineSV = await this.evaluateExpression(store, exp.line);\n    if (!Types.INTEGER.isCompatible(lineSV.type)) {\n      throw ProcessorErrorFactory.array_dimension_not_int_full(exp.sourceInfo);\n    }\n    const line = lineSV.get().toNumber();\n    const columnSV = await this.evaluateExpression(store, exp.column);\n    let column = null;\n    if (columnSV !== null) {\n      if (!Types.INTEGER.isCompatible(columnSV.type)) {\n        throw ProcessorErrorFactory.array_dimension_not_int_full(\n          exp.sourceInfo\n        );\n      }\n      column = columnSV.get().toNumber();\n    }\n    if (line >= mustBeArray.lines) {\n      if (mustBeArray.isVector) {\n        throw ProcessorErrorFactory.vector_line_outbounds_full(\n          exp.id,\n          line,\n          mustBeArray.lines,\n          exp.sourceInfo\n        );\n      } else {\n        throw ProcessorErrorFactory.matrix_line_outbounds_full(\n          exp.id,\n          line,\n          mustBeArray.lines,\n          exp.sourceInfo\n        );\n      }\n    } else if (line < 0) {\n      throw ProcessorErrorFactory.array_dimension_not_positive_full(\n        exp.sourceInfo\n      );\n    }\n    if (column !== null && mustBeArray.columns === 0) {\n      throw ProcessorErrorFactory.vector_not_matrix_full(\n        exp.id,\n        exp.sourceInfo\n      );\n    }\n    if (column !== null) {\n      if (column >= mustBeArray.columns) {\n        throw ProcessorErrorFactory.matrix_column_outbounds_full(\n          exp.id,\n          column,\n          mustBeArray.columns,\n          exp.sourceInfo\n        );\n      } else if (column < 0) {\n        throw ProcessorErrorFactory.array_dimension_not_positive_full(\n          exp.sourceInfo\n        );\n      }\n    }\n    const result = mustBeArray.getAt(line, column);\n    const type = mustBeArray.type.innerType;\n    if (Array.isArray(result)) {\n      const values = result.map((val, col) => {\n        return new StoreValueAddress(\n          type,\n          val,\n          line,\n          col,\n          mustBeArray.id,\n          mustBeArray.readOnly\n        );\n      });\n      return new ArrayStoreValue(\n        new ArrayType(type, 1),\n        values,\n        mustBeArray.columns,\n        null,\n        mustBeArray.id,\n        mustBeArray.readOnly\n      );\n    } else {\n      return new StoreValueAddress(\n        type,\n        result,\n        line,\n        column,\n        mustBeArray.id,\n        mustBeArray.readOnly\n      );\n    }\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Expressions.UnaryApp} unaryApp\n   *\n   * @returns {import('./store/value/istore_value').IStoreValue}\n   */\n  async evaluateUnaryApp (store, unaryApp) {\n    const left = await this.evaluateExpression(store, unaryApp.left);\n    const resultType = resultTypeAfterUnaryOp(unaryApp.op, left.type);\n    if (Types.UNDEFINED.isCompatible(resultType)) {\n      const stringInfo = left.type.stringInfo();\n      const info = stringInfo[0];\n      throw ProcessorErrorFactory.invalid_unary_op_full(\n        unaryApp.op,\n        info.type,\n        info.dim,\n        unaryApp.sourceInfo\n      );\n    }\n    switch (unaryApp.op.ord) {\n      case Operators.ADD.ord:\n        return new StoreValue(resultType, left.get());\n      case Operators.SUB.ord:\n        return new StoreValue(resultType, left.get().negated());\n      case Operators.NOT.ord:\n        return new StoreValue(resultType, !left.get());\n      default:\n        throw new RuntimeError(\"!!!Critical Invalid UnaryApp \" + unaryApp.op);\n    }\n  }\n\n  /**\n   *\n   * @param {Store} store\n   * @param {Expressions.InfixApp} infixApp\n   *\n   * @returns {import('./store/value/istore_value').IStoreValue}\n   */\n  async evaluateInfixApp (store, infixApp) {\n    const left = await this.evaluateExpression(store, infixApp.left);\n    const right = await this.evaluateExpression(store, infixApp.right);\n    let shouldImplicitCast = false;\n    let resultType = resultTypeAfterInfixOp(infixApp.op, left.type, right.type);\n    if (Types.UNDEFINED.isCompatible(resultType)) {\n      if (\n        Config.enable_type_casting &&\n        Store.canImplicitTypeCast(left.type, right.type)\n      ) {\n        shouldImplicitCast = true;\n      } else {\n        const stringInfoLeft = left.type.stringInfo();\n        const infoLeft = stringInfoLeft[0];\n        const stringInfoRight = right.type.stringInfo();\n        const infoRight = stringInfoRight[0];\n        throw ProcessorErrorFactory.invalid_infix_op_full(\n          infixApp.op,\n          infoLeft.type,\n          infoLeft.dim,\n          infoRight.type,\n          infoRight.dim,\n          infixApp.sourceInfo\n        );\n      }\n    }\n    let result = null;\n    switch (infixApp.op.ord) {\n      case Operators.ADD.ord: {\n        if (Types.STRING.isCompatible(left.type)) {\n          const rightStr = convertToString(right.get(), right.type);\n          return new StoreValue(resultType, left.get() + rightStr);\n        } else if (Types.STRING.isCompatible(right.type)) {\n          const leftStr = convertToString(left.get(), left.type);\n          return new StoreValue(resultType, leftStr + right.get());\n        } else if (Types.CHAR.isCompatible(left.type)) {\n          const strLeft = convertToString(left.get(), left.type);\n          const strRight = convertToString(right.get(), right.type);\n          return new StoreValue(resultType, strLeft + strRight);\n        } else {\n          return new StoreValue(resultType, left.get().plus(right.get()));\n        }\n      }\n      case Operators.SUB.ord:\n        return new StoreValue(resultType, left.get().minus(right.get()));\n      case Operators.MULT.ord: {\n        result = left.get().times(right.get());\n        return new StoreValue(resultType, result);\n      }\n      case Operators.DIV.ord: {\n        if (right.get() == 0) {\n          throw ProcessorErrorFactory.divsion_by_zero_full(\n            infixApp.toString(),\n            infixApp.sourceInfo\n          );\n        }\n        if (Types.INTEGER.isCompatible(resultType))\n          result = left.get().divToInt(right.get());\n        else result = left.get().div(right.get());\n        return new StoreValue(resultType, result);\n      }\n      case Operators.MOD.ord: {\n        let leftValue = left.get();\n        let rightValue = right.get();\n        if (shouldImplicitCast) {\n          resultType = Types.INTEGER;\n          leftValue = leftValue.trunc();\n          rightValue = rightValue.trunc();\n        }\n        result = leftValue.modulo(rightValue);\n        return new StoreValue(resultType, result);\n      }\n      case Operators.GT.ord: {\n        let leftValue = left.get();\n        let rightValue = right.get();\n        if (Types.STRING.isCompatible(left.type)) {\n          result = leftValue.length > rightValue.length;\n        } else if (Types.CHAR.isCompatible(left.type)) {\n          result = leftValue.charCodeAt(0) > rightValue.charCodeAt(0);\n        } else {\n          if (shouldImplicitCast) {\n            resultType = Types.BOOLEAN;\n            leftValue = leftValue.trunc();\n            rightValue = rightValue.trunc();\n          }\n          result = leftValue.gt(rightValue);\n        }\n        return new StoreValue(resultType, result);\n      }\n      case Operators.GE.ord: {\n        let leftValue = left.get();\n        let rightValue = right.get();\n        if (Types.STRING.isCompatible(left.type)) {\n          result = leftValue.length >= rightValue.length;\n        } else if (Types.CHAR.isCompatible(left.type)) {\n          result = leftValue.charCodeAt(0) >= rightValue.charCodeAt(0);\n        } else {\n          if (shouldImplicitCast) {\n            resultType = Types.BOOLEAN;\n            leftValue = leftValue.trunc();\n            rightValue = rightValue.trunc();\n          }\n          result = leftValue.gte(rightValue);\n        }\n        return new StoreValue(resultType, result);\n      }\n      case Operators.LT.ord: {\n        let leftValue = left.get();\n        let rightValue = right.get();\n        if (Types.STRING.isCompatible(left.type)) {\n          result = leftValue.length < rightValue.length;\n        } else if (Types.CHAR.isCompatible(left.type)) {\n          result = leftValue.charCodeAt(0) < rightValue.charCodeAt(0);\n        } else {\n          if (shouldImplicitCast) {\n            resultType = Types.BOOLEAN;\n            leftValue = leftValue.trunc();\n            rightValue = rightValue.trunc();\n          }\n          result = leftValue.lt(rightValue);\n        }\n        return new StoreValue(resultType, result);\n      }\n      case Operators.LE.ord: {\n        let leftValue = left.get();\n        let rightValue = right.get();\n        if (Types.STRING.isCompatible(left.type)) {\n          result = leftValue.length <= rightValue.length;\n        } else if (Types.CHAR.isCompatible(left.type)) {\n          result = leftValue.charCodeAt(0) <= rightValue.charCodeAt(0);\n        } else {\n          if (shouldImplicitCast) {\n            resultType = Types.BOOLEAN;\n            leftValue = leftValue.trunc();\n            rightValue = rightValue.trunc();\n          }\n          result = leftValue.lte(rightValue);\n        }\n        return new StoreValue(resultType, result);\n      }\n      case Operators.EQ.ord: {\n        let leftValue = left.get();\n        let rightValue = right.get();\n        if (\n          Types.INTEGER.isCompatible(left.type) ||\n          Types.REAL.isCompatible(left.type)\n        ) {\n          if (shouldImplicitCast) {\n            resultType = Types.BOOLEAN;\n            leftValue = leftValue.trunc();\n            rightValue = rightValue.trunc();\n          }\n          result = leftValue.eq(rightValue);\n        } else {\n          result = leftValue === rightValue;\n        }\n        return new StoreValue(resultType, result);\n      }\n      case Operators.NEQ.ord: {\n        let leftValue = left.get();\n        let rightValue = right.get();\n        if (\n          Types.INTEGER.isCompatible(left.type) ||\n          Types.REAL.isCompatible(left.type)\n        ) {\n          if (shouldImplicitCast) {\n            resultType = Types.BOOLEAN;\n            leftValue = leftValue.trunc();\n            rightValue = rightValue.trunc();\n          }\n          result = !leftValue.eq(rightValue);\n        } else {\n          result = leftValue !== rightValue;\n        }\n        return new StoreValue(resultType, result);\n      }\n      case Operators.AND.ord:\n        return new StoreValue(resultType, left.get() && right.get());\n      case Operators.OR.ord:\n        return new StoreValue(resultType, left.get() || right.get());\n      default:\n        throw new RuntimeError(\"!!!Critical Invalid InfixApp \" + infixApp.op);\n    }\n  }\n}\n","import { Input } from './../io/input';\nimport { LocalizedStrings } from '../services/localizedStringsService';\n\nexport class InputTest extends Input {\n\n  constructor (inputList) {\n    super();\n    this.index = 0;\n    this.inputList = inputList;\n  }\n\n  requestInput () {\n    const promise = new Promise( (resolve, reject) => {\n      if(this.index < this.inputList.length) {      \n        resolve(this.inputList[this.index]);\n        this.index++;\n      } else {\n        reject(new Error(LocalizedStrings.getError(\"exceeded_input_request\")));\n      }\n    });\n    return promise\n  }\n}","export class Input {\n\n  /**\n   * This function should return a promise which will resolve with the text provided by user.\n   * The promise should usually resolves when the ENTER key is pressed, \n   * but if the parameter anyKey is true, any key press should make the promise immediatlly resolve\n   * \n   * @param {boolean} anyKey if true any key pressed should be immediatly sent to the processor, defaults false \n   * @returns Promise<string>\n   */\n  requestInput (anyKey = false) {\n    throw new Error(\"Must be implemented\");\n  }\n\n}","import { Output } from \"./../io/output\";\n\nexport class OutputTest extends Output {\n  constructor () {\n    super();\n    this.list = [];\n    this.currentLine = null;\n  }\n\n  write (text, newLine = false) {\n    if (this.currentLine == null) {\n      this.currentLine = this.list.push(\"\") - 1;\n    }\n\n    this.list[this.currentLine] += text;\n    if (newLine) {\n      this.currentLine = null;\n    }\n  }\n\n  sendOutput (text) {\n    const output = \"\" + text;\n    if (output.indexOf(\"\\n\") !== -1) {\n      const outputList = output.split(\"\\n\");\n      const last = outputList.pop();\n      outputList.forEach((t) => {\n        //t = t.replace(/\\t/g, '&#x0020;&#x0020;');\n        //t = t.replace(/\\s/g, \"&#x0020;\");\n        if (t.length == 0) this.currentLine = null;\n        else this.write(t, true);\n      });\n      //last = last.replace(/\\t/g, '&#x0020;&#x0020;');\n      //last = last.replace(/\\s/g, \"&#x0020;\");\n      if (last.length != 0) this.write(last);\n    } else {\n      //output = output.replace(/\\t/g, '&#x0020;&#x0020;');\n      //output = output.replace(/\\s/g, \"&#x0020;\");\n      this.write(output);\n    }\n  }\n}\n","export class Output {\n\n  // Channels used to indicate the nature of the output for formatting purposes(raw HTML only)\n  static get USER () {\n    return 0;\n  }\n\n  static get INFO () {\n    return 1;\n  }\n\n  static get ERR () {\n    return 2;\n  }\n\n  static get INPUT () {\n    return 3;\n  }\n  // </ END Channels>\n\n  /**\n   * sendOutput is the function used by the code processor to send output from the program to the user\n   * From the functions presented in this file this is only function that MUST BE provided by the instance passed to\n   * the processor using IVProgProcessor.registerOutput\n   * \n   * @param {string|number|boolean} text text to be present as an output \n   */\n  sendOutput (text) {\n    throw new Error(\"Must be implemented\");\n  }\n\n  /**\n   * Function used by the assessment tool to present the assessment results which can be raw HTML text and should not be sanitized\n   * @param {string|number|boolean} text text to be presented to the user\n   * @param {number} channel channel that should be used to send this output\n   */\n  writeRawHTML (text, channel) {\n    throw new Error(\"Must be implemented\");\n  }\n\n  /**\n   * Function used by the assessment tool to generate logs and notifications\n   * @param {string|number|boolean} text the output\n   * @param {boolean} newLine if true a line break will be added after the text\n   */\n  write (text, newLine = false) {\n    throw new Error(\"Must be implemented\");\n  }\n\n  /**\n   * Function used by the assessment tool to generate logs and notifications in the INFO channel\n   * @param {string|number|boolean} text the output\n   */\n  info (text) {\n    throw new Error(\"Must be implemented\");\n  }\n\n  /**\n   * Function used by the assessment tool to generate logs and notifications in the ERROR channel\n   * @param {string|number|boolean} text the output\n   */\n  err (text) {\n    throw new Error(\"Must be implemented\");\n  }\n\n}","import {SemanticAnalyser} from './../processor/semantic/semanticAnalyser';\nimport {IVProgProcessor} from './../processor/ivprogProcessor';\nimport { InputTest } from './inputTest';\nimport { OutputTest } from './outputTest';\nimport { LocalizedStrings } from './../services/localizedStringsService'\n\nexport async function autoGenerateTestCaseOutput (program_text, testCases, callback) {\n  let copyTestCases = testCases.map((test) => Object.assign({}, test));\n  try {\n    const program = SemanticAnalyser.analyseFromSource(program_text);\n    const resultList = testCases.map(async (test, id) => {\n      const input = new InputTest(test.input);\n      const output = new OutputTest();\n      const exec =  new IVProgProcessor(program);\n      exec.registerInput(input);\n      exec.registerOutput(output);\n      await exec.interpretAST();\n      return { id: id, program: exec };\n    });\n    const result_final = await Promise.all(resultList);\n    for (let i = 0; i < result_final.length; ++i) {\n      const result_1 = result_final[i];\n      const output_2 = result_1.program.output.list;\n      const input_2 = result_1.program.input;\n      if (input_2.index != input_2.inputList.length) {\n        window.showAlert(LocalizedStrings.getMessage(\"testcase_autogen_unused_input\", [result_1.id + 1]));\n        return false;\n      }\n      if (output_2.length == 0) {\n        window.showAlert(LocalizedStrings.getMessage(\"testcase_autogen_empty\", [result_1.id + 1]));\n      }\n      copyTestCases[result_1.id].output = output_2;\n    }\n    callback(copyTestCases);\n    return true;\n  }catch (error) {\n    return Promise.reject(error)\n  }\n}","import { Config } from \"./src/util/config\";\nimport { i18nHelper } from \"./src/services/i18nHelper\";\nimport * as LocalizedStringsService from \"./src/services/localizedStringsService\";\nimport { openAssessmentDetail, levenshteinDistance } from \"./src/util/utils\";\nimport { processData } from \"./src/util/dataProcess\";\nimport { parseExpression, parseCode } from \"./src/util/parseFromVisual\";\nimport { autoGenerateTestCaseOutput } from \"./src/util/auto_gen_output\";\nimport { IVProgProcessor } from \"./src/processor/ivprogProcessor.js\";\nimport { SemanticAnalyser } from \"./src/processor/semantic/semanticAnalyser.js\";\nimport { Modes } from \"./src/processor/modes\";\nimport { Location } from \"./src/memory/location\";\n\nconst Settings = {\n  programming: [],\n  functions: [],\n  datatypes: [],\n  commands: [],\n  filter: []\n}\n\nconst i18n = i18nHelper.i18n;\nconst LocalizedStrings = LocalizedStringsService.getInstance();\n\nexport {\n  i18n,\n  Settings,\n  Config,\n  LocalizedStrings,\n  SemanticAnalyser,\n  IVProgProcessor,\n  Modes,\n  Location,\n  openAssessmentDetail,\n  autoGenerateTestCaseOutput,\n  parseExpression,\n  parseCode,\n  levenshteinDistance,\n  processData,\n};\n"],"names":["root","factory","exports","module","define","amd","this","arr","len","length","i","arr2","Array","isArray","arrayLikeToArray","self","ReferenceError","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","fn","args","arguments","apply","err","undefined","instance","Constructor","TypeError","setPrototypeOf","isNativeReflectConstruct","_construct","Parent","Class","Reflect","construct","a","push","Function","bind","prototype","_defineProperties","target","props","descriptor","enumerable","configurable","writable","Object","defineProperty","protoProps","staticProps","obj","superPropBase","_get","property","receiver","get","base","desc","getOwnPropertyDescriptor","call","_getPrototypeOf","o","getPrototypeOf","__proto__","subClass","superClass","create","constructor","toString","indexOf","sham","Proxy","Date","e","iter","Symbol","iterator","from","_arr","_n","_d","_e","_s","_i","next","_typeof","assertThisInitialized","_setPrototypeOf","p","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","object","hasOwnProperty","strings","raw","slice","freeze","defineProperties","arrayWithoutHoles","iterableToArray","nonIterableSpread","minLen","n","name","test","isNativeFunction","_wrapNativeSuper","_cache","Map","has","set","Wrapper","globalScope","Decimal","inexact","quadrant","EXP_LIMIT","MAX_DIGITS","NUMERALS","LN10","PI","DEFAULTS","precision","rounding","modulo","toExpNeg","toExpPos","minE","maxE","crypto","external","decimalError","invalidArgument","precisionLimitExceeded","cryptoUnavailable","mathfloor","Math","floor","mathpow","pow","isBinary","isHex","isOctal","isDecimal","BASE","LN10_PRECISION","PI_PRECISION","P","digitsToString","d","k","ws","indexOfLastWord","str","w","getZeroString","checkInt32","min","max","Error","checkRoundingDigits","rm","repeating","di","r","rd","ceil","convertBase","baseIn","baseOut","j","arrL","strL","charAt","reverse","absoluteValue","abs","x","s","finalise","comparedTo","cmp","y","xdL","ydL","xd","yd","xs","ys","NaN","cosine","cos","pr","Ctor","sd","tinyPow","taylorSeries","times","cos2x","minus","plus","toLessThanHalfPi","neg","cubeRoot","cbrt","m","rep","t","t3","t3plusx","isFinite","isZero","toExponential","divide","eq","decimalPlaces","dp","dividedBy","div","dividedToIntegerBy","divToInt","equals","greaterThan","gt","greaterThanOrEqualTo","gte","hyperbolicCosine","cosh","one","cosh2_x","d8","hyperbolicSine","sinh","sqrt","sinh2_x","d5","d16","d20","hyperbolicTangent","tanh","inverseCosine","acos","halfPi","isNeg","getPi","asin","inverseHyperbolicCosine","acosh","lte","ln","inverseHyperbolicSine","asinh","inverseHyperbolicTangent","atanh","wpr","xsd","inverseSine","atan","inverseTangent","px","x2","isInteger","isInt","isNaN","isNegative","isPositive","isPos","lessThan","lt","lessThanOrEqualTo","logarithm","log","isBase10","denominator","inf","num","naturalLogarithm","getLn10","sub","xe","xLTy","pop","shift","getBase10Exponent","mod","q","naturalExponential","exp","negated","add","carry","unshift","z","getPrecision","round","sine","sin","sin2_x","squareRoot","tangent","tan","mul","rL","toBinary","toStringBinary","toDecimalPlaces","toDP","finiteToString","toFixed","toFraction","maxD","d0","d1","d2","n0","n1","toHexadecimal","toHex","toNearest","toNumber","toOctal","toPower","yn","intPow","toPrecision","toSignificantDigits","toSD","truncated","trunc","valueOf","toJSON","multiplyInteger","temp","compare","b","aL","bL","subtract","logBase","more","prod","prodL","qd","rem","remL","rem0","xi","xL","yd0","yL","yz","sign","isTruncated","digits","roundUp","xdi","out","isExp","nonFiniteToString","zs","truncate","isOdd","maxOrMin","ltgt","guard","sum","c","c0","numerator","x1","String","parseDecimal","replace","search","substring","charCodeAt","parseOther","divisor","isFloat","toLowerCase","isHyperbolic","u","pi","atan2","config","v","useDefaults","defaults","ps","getRandomValues","randomBytes","hypot","isDecimalInstance","log2","log10","random","Uint32Array","copy","clone","ROUND_UP","ROUND_DOWN","ROUND_CEIL","ROUND_FLOOR","ROUND_HALF_UP","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_CEIL","ROUND_HALF_FLOOR","EUCLID","hasSticky","RegExp","sticky","isRegExp","isObject","reCapture","reUnion","regexps","map","join","regexpOrLiteral","ignoreCase","global","multiline","source","ruleOptions","type","match","include","options","defaultType","lineBreaks","fallback","shouldThrow","sort","toRules","spec","array","result","concat","JSON","stringify","arrayToRules","keys","getOwnPropertyNames","thing","rules","forEach","rule","objectToRules","defaultErrorRule","compileRules","hasStates","errorRule","fast","fastAllowed","unicodeFlag","groups","parts","unicode","pat","regexp","exec","fallbackRule","flags","suffix","checkStateGroup","g","state","Lexer","states","startState","buffer","stack","reset","data","index","line","col","queuedToken","queuedThrow","setState","save","re","popState","pushState","eat","tokenToString","_getGroup","groupCount","queuedGroup","token","_token","queuedText","group","lastIndex","text","offset","matchNL","nl","size","formatError","LexerIterator","lexer","message","start","eol","firstLine","tokenType","compile","all","$all","ruleMap","included","splice","newRules","newRule","fastKeys","keywords","reverseMap","byLength","types","item","keyword","runtime","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","_invoke","GenStateSuspendedStart","method","GenStateExecuting","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","GenStateSuspendedYield","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","values","Gp","defineIteratorMethods","AsyncIterator","PromiseImpl","invoke","__await","unwrapped","previousPromise","callInvokeWithMethodAndArg","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","iterable","iteratorMethod","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","async","skipTempReset","prev","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","prop","StringTypes","ConfigObject","intConvertRoundMode","default_lang","enable_type_casting","idle_input_interval","suspend_threshold","max_instruction_count","Number","MAX_SAFE_INTEGER","activity_programming_type","activity_functions","activity_datatypes","activity_commands","activity_filter","opts","otherConfig","Config","LanguageService","lsKey","defaultLang","listeners","document","setupListener","_this","addEventListener","event","l","getLang","lang","localStorage","getItem","console","warn","getDefaultLang","registerLanguageChangeListener","listener","LocalizedStrings","service","i18nData","listenToChange","updateTagText","getString","id","i18nObj","getDefaultString","getOR","getUI","getError","ERROR","processString","getMessage","MESSAGE","UI","func","querySelectorAll","node","innerHTML","processTagTex","getAttribute","split","LanguageServiceNoLS","notifyChange","setLang","MessagesObj","UIObj","ErrorsObj","i18n_data","combineRegex","pieces","IVProgLexer","RKs","i18nLexer","langLibs","langFuncs","HEX_DIGIT","OCTAL_DIGIT","ESC_OCTAL","ESC_UNICODE","ESC_SEQ","STRING_CHARACTER","makeLexer","entries","boolVal","commands","logicOp","RK_LOGICAL_AND","RK_LOGICAL_OR","RK_LOGICAL_NOT","RESERVED_KEYS","moo","lexerRules","COMMENTS","OPEN_BRACE","CLOSE_BRACE","OPEN_PARENTHESIS","CLOSE_PARENTHESIS","OPEN_CURLY","CLOSE_CURLY","COMMA","ASSIGNMENT","REAL","INTEGER","SUM_OP","MULTI_OP","RELATIONAL_OPERATOR","COLON","STRING","CHARACTER","EOS","WHITESPACE","RK_REFERENCE","ID","DOT","moolexer","ptLexer","RK_VOID","RK_PROGRAM","RK_SWITCH","RK_CASE","RK_DEFAULT","RK_CONST","RK_FUNCTION","RK_RETURN","RK_FOR","RK_FOR_ALT","RK_FOR_FROM","RK_FOR_TO","RK_FOR_PASS","RK_BREAK","RK_DO","RK_DO_UNTIL","RK_WHILE","RK_WHILE_ALT","RK_IF","RK_ELSE","RK_FALSE","RK_TRUE","RK_REAL","RK_INTEGER","RK_BOOLEAN","RK_CHARACTER","RK_STRING","$mathLib","$ioLib","$strLib","$arrayLib","$langLib","main_function","$read","$write","$numElements","$matrixLines","$matrixColumns","$substring","$length","$uppercase","$lowercase","$charAt","$isReal","$isInt","$isBool","$castReal","$castInt","$castBool","$castString","$castChar","$sin","$cos","$tan","$sqrt","$pow","$log","$abs","$negate","$invert","$max","$min","$rand","enLexer","lexers","pt","en","iLMparameters","langLexer","Lexers","langInfo","getLangFuncs","getLangLibs","line_i18n","Command","_sourceInfo","sourceInfo","Break","Return","expression","Assign","ArrayIndexAssign","lineExpression","columnExpression","column","Declaration","initial","isConst","ArrayDeclaration","lines","columns","While","commandBlock","For","for_id","for_from","for_to","for_pass","Type","ord","dim","another","MultiType","list","stringInfo","isCompatible","BOOLEAN","CHAR","VOID","UNDEFINED","ALL","Types","returnType","formalParameters","some","variadic","variables","IfThenElse","condition","ifTrue","ifFalse","CommandBlock","RepeatUntil","Expression","_parenthesis","flag","Switch","cases","Case","SysCall","langFunc","FormalParameter","byRef","FunctionCall","actualParameters","isMainCall","LanguageDefinedFunction","getMainFunctionName","getLocalName","params","parenthesis","Modes","RETURN","BREAK","PAUSE","RUN","ABORT","toInt","toChar","toReal","toBool","val","getReservedKeys","getRules","convertBoolToString","bool","convertToString","RuntimeError","msg","_context","captureStackTrace","contextObj","SemanticError","createRuntimeError","i18n_id","LocalizedStringsService","createSemanticError","ProcessorErrorFactory","symbol_not_found_full","symbol_not_found","function_missing_full","function_missing","main_missing","array_dimension_not_int_full","array_dimension_not_int","unknown_command_full","unknown_command","incompatible_types_full","left_type","left_dim","right_type","right_dim","source_info","translateType","incompatible_types","incompatible_types_array_full","incompatible_types_array","loop_condition_type_full","loop_condition_type","endless_loop_full","endless_loop","if_condition_type_full","if_condition_type","invalid_global_var","not_implemented","invalid_case_type_full","invalid_case_type","void_in_expression_full","void_in_expression","invalid_array_access_full","invalid_array_access","invalid_matrix_access_full","invalid_matrix_access","matrix_column_outbounds_full","matrix_column_outbounds","matrix_line_outbounds_full","matrix_line_outbounds","vector_line_outbounds_full","vector_line_outbounds","vector_not_matrix_full","vector_not_matrix","function_no_return","invalid_void_return_full","invalid_void_return","invalid_return_type_full","invalid_return_type","invalid_parameters_size_full","expected","actual","invalid_parameters_size","invalid_parameter_type_full","fun_name","invalid_parameter_type","invalid_ref_full","invalid_ref","unexpected_break_command_full","unexpected_break_command","invalid_array_literal_type_full","invalid_array_literal_type","invalid_array_literal_line_full","invalid_array_literal_line","invalid_array_literal_column_full","invalid_array_literal_column","invalid_unary_op_full","expString","opName","translateOp","invalid_unary_op","invalid_infix_op_full","typeLeft","dimLeft","typeRight","dimRight","invalid_infix_op","array_dimension_not_positive_full","array_dimension_not_positive","invalid_type_conversion","invalid_read_type","invalid_read_type_array","typePos","dimPos","typeArray","dimArray","invalid_const_ref_full","invalid_const_ref","invalid_const_assignment_full","var_id","invalid_const_assignment","invalid_vector_assignment_full","left_id","left_size","right_id","right_size","invalid_vector_assignment","invalid_matrix_assignment_full","left_line","left_column","right_line","right_column","invalid_matrix_assignment","matrix_to_vector_attr","vector_to_matrix_attr","invalid_matrix_index_assign_full","mat_id","mat_line","mat_size","exp_size","invalid_matrix_index_assign","invalid_number_elements_vector","expected_num","actual_num","invalid_number_lines_matrix","divsion_by_zero_full","divsion_by_zero","undefined_tanget_value","negative_log_value","invalid_string_index","local_fun_name","negative_sqrt_value","exceeded_recursive_calls","invalid_for_variable","invalid_for_from","invalid_for_to","invalid_for_pass","exceed_max_instructions","StoreValue","ArrayType","dimensions","innerType","used_dims","free_dims","ArrayAccess","strLine","strColumn","Literal","IntLiteral","RealLiteral","BoolLiteral","CharLiteral","StringLiteral","ArrayLiteral","arrayLiteral","element","validateSize","validateType","VariableLiteral","InfixApp","op","left","right","UnaryApp","SourceInfo","tokenA","tokenB","Operators","ADD","SUB","MULT","DIV","MOD","GT","GE","LT","LE","EQ","NEQ","AND","OR","NOT","convertFromString","SyntaxError","createError","message_id","SyntaxErrorFactory","extra_lines","token_missing_one","token_missing_list","expectedList","id_missing","eos_missing","invalid_array_dimension","typeName","invalid_array_size","invalid_main_return","invalid_var_declaration","invalid_break_command","cmdName","invalid_terminal","invalid_type","const_not_init","invalid_id_format","duplicate_function","main_parameters","duplicate_variable","invalid_character","annonymous_array_literal","invalid_matrix_literal_line","cannot_infer_matrix_line","cannot_infer_matrix_column","cannot_infer_vector_size","matrix_to_vector_literal_attr","vector_to_matrix_literal_attr","array_init_not_literal","array_exceeds_2d","invalid_matrix_id_dimension","invalid_vector_init","invalid_matrix_init","invalid_syntax","IVProgParser","input","ivprogLexer","inputStream","tokenStream","pos","ruleNames","variableTypes","getTypeKeys","functionTypes","parsingArrayDimension","scope","definedFuncsNameList","definedVariablesStack","fill","parser","stream","filter","parseProgram","EOF_TOKEN","getToken","consumeNewLines","globalVars","functions","checkOpenCurly","pushVariableStack","isVariableType","parseGlobalVariables","parseFunction","popVariableStack","checkCloseCurly","isEOF","attempt","eosToken","functionID","funcIDToken","variableID","getCurrentVariableStack","decl","parseMaybeConst","checkEOS","constToken","typeString","parseType","parseDeclaration","getTypeArray","dim1","dim2","createSourceInfo","idString","parseID","checkVariableDuplicate","checkOpenBrace","parseArrayDimension","checkCloseBrace","parseArrayDeclaration","assignmentToken","parseExpressionOR","declaration","Commands","commaToken","n_lines","n_columns","dim_is_id","Expressions","parseArrayLiteral","isVector","Parsers","find","dimToken","getIntLiteral","parseVariable","invalid_token","beginArray","parseVectorList","parseExpressionList","endArray","createSourceInfoFromList","dataDim","lastSize","pushScope","FUNCTION","formalParams","funType","checkFunctionDuplicate","checkOpenParenthesis","checkCloseParenthesis","parseFormalParameters","commandsBlock","parseCommandBlock","isMain","popScope","reference","maybeIDToken","parameter","insideScope","anotherID","optionalCurly","variablesDecl","hasOpen","parsedCommand","cmd","parseCommand","lastToken","varType","parseIDCommand","parseReturn","parseWhile","parseFor","BREAKABLE","parseBreak","parseSwitchCase","parseRepeatUntil","parseIfThenElse","casesList","parseCases","command","whileToken","COMMAND","logicalExpression","cmdBlocks","maybeIf","elseBlock","for_token","id_token","parseForParameters","maybePass","returnCommand","refToken","parseMaybeLibID","isID","parseExpression","assignmentOrParenthesis","funcCall","parseFunctionCallCommand","keyword_code","from_token","int_or_id","is_unary_op","colonToken","block","defaultCase","setCommands","aCase","exp1","parseExpressionAND","opToken","or","exp2","finalExp","parseExpressionNot","and","not","parseExpressionRel","relToken","rel","factor","parseFactor","sumOpToken","factor2","term","parseTerm","multOpToken","term2","getRealLiteral","getStringLiteral","getCharLiteral","getBoolLiteral","parseIDTerm","parseParenthesisExp","firstIndex","secondIndex","parseFunctionCallExpression","getInternalName","stepBack","parseActualParameters","funcName","getFunctionName","literalNames","convertToRadians","degrees","seed","now","valueToKey","sinFun","libsObject","sto","_","applyStore","angle","insertStore","mode","cosFun","createCosFun","tanFun","function_call_stack","createTanFun","sqrtFun","createSqrtFun","powFun","createPowFun","logFun","createLogFun","absFun","createAbsFun","negateFun","createNegateFun","invertFun","createInvertFun","maxFun","numbers","sto_addrs","paramType","createMaxFun","minFun","createMinFun","randFun","createRandFun","readFunction","store","requestInput","typeToConvert","trim","realObject","getStoreObject","getReferenceDimension","arrayInfo","getRefObj","stoValue","updateStore","createInputFun","writeFunction","totalSV","total","output","sendOutput","createOutputFun","substringFun","end","createSubstringFun","lengthFun","createLengthFun","uppercaseFun","toUpperCase","createUppercaseFun","lowercaseFun","createLowercaseFun","charAtFun","idx","createrCharAtFun","numElementsFun","vector","createNumElementsFun","matrixLinesFun","matrix","createMatrixLinesFun","matrixColumnsFun","createMatrixColumnsFun","isRealFun","createParser","createIsRealFun","isIntFun","createIsIntFun","createIsBoolFun","castRealFun","typeStringInfoArray","typeInfo","createCastRealFun","castIntFun","createCastIntFun","castBoolFun","createCastBoolFun","castStringFun","createCastStringFun","fromCharCode","createCastCharFun","funcsObject","concatObjects","localName","names","lib","internalName","getFunction","libName","funName","IVProgLocalizedStrings","langService","langsJsons","shouldListenToChange","type_string","category","Langs","_instance","getInstance","i18nHelper","i18n","identifier","levenshteinDistance","win","openAssessmentDetail","preventDefault","page_code","currentTarget","dataset","page","close","window","open","write","sleep","ms","res","setTimeout","processData","folderInput","querySelector","header","generateSubCode","algorithmInIlm","program_obj","parse","globals","ivprogCore","generateCode","prepareData","submission","exercID","studentID","exercMap","download","getExercHeader","reduce","acc","file","createElement","setAttribute","encodeURIComponent","classList","appendChild","files","f","folderName","webkitRelativePath","csvEntries","vec","blockExercMap","getFilePath","path","counter","studentsMap","submissions","parseInt","student","parseFloat","previousCode","previousFile","previous","prepareActivityToStudentHelper","getOrElse","currentFile","current","currentCode","logs","ratio","setInterval","clearInterval","csv","TYPES","getOpType","switchCaseWalker","switchCase","commandWalker","isDefault","expressionWalker","ifThenElseWalker","ifthenelse","forLoop","switchCommand","whileLoop","functionCall","parameters","lastInput","newLine","content","variable","parameters_list","functionCallWalker","assingment","arrayClass","class","assignmentWalker","testFirst","var_attribution","var_initial","step_expression","functionWalker","funcDeclaration","return_type","return_dimensions","variables_list","functionParameterWalker","variablesDeclarations","variableDeclarationWalker","formalParameter","rows","dimension","is_const","variableInitialWalker","funcObj","paramsList","opType","opValue","parseCode","codeLinesMap","program","parseTree","buildInfixMultiDivSubTable","table","buildInfixEqualityInequalityTable","buildInfixRelationalTable","buildInfixAndOrTable","buildUnarySumSubList","compatibilityMap","infixMap","WeakMap","buildInfixModTable","unaryMap","buildUnaryCompatibilityTable","resultTypeAfterInfixOp","operator","leftExpressionType","rightExpressionType","newMulti","typeA","typeB","resultType","resultTypeAfterUnaryOp","Address","inner_ref","address_id","address","findIndex","beg","med","getAddressAt","Location","allocate","deallocate","updateAddress","clear","StoreObject","loc_address","readOnly","_loc_address","_type","_readOnly","_id","locAddress","StoreObjectRef","getRefAddress","refObj","reference_dimension","StoreValueAddress","ArrayStoreValue","array_type","actual_line","actual_column","canAccept","actual_values","StoreObjectArray","_lines","_columns","loc_addresses","cols","addresses","getIndexOf","StoreValueRef","reference_dimesion","ArrayStoreValueRef","StoreObjectArrayRef","getAddresses","Store","castType","sourceType","stoObj","canImplicitTypeCast","nextStore","oldObj","array_value","setAt","oldType","stoType","sto_value","updateStoreArray","newObj","all_values","setID","destroy","isDefined","SemanticAnalyser","ast","symbolMap","currentFunction","stringCode","analyseTree","symbol_map","findSymbol","fun","pushMap","assertDeclarations","assertFunction","assertDeclaration","assertArrayDeclaration","insertSymbol","evaluateExpressionType","result_info","evaluateArrayLiteral","finalResult","resultTypeLeft","resultTypeRight","infoLeft","infoRight","evaluateLiteralType","findFunction","assertParameters","arrayTypeInfo","arrType","literal","last","strExp","arrayDeclaration","evaluateVectorLiteralType","line_literal","formalParam","optional","assertReturn","popMap","checkCommand","checkCommands","sType","hasDefault","caseType","lineExp","columnExp","exp_type","access_type","compatible","access_type_info","exp_type_info","getMainFunction","cmds","actualParametersList","parameterList","hasVariadic","assertVariadicParameter","param","assertParameter","expType","actualParameter","shared","IVProgProcessor","globalStore","stores","forceKill","instruction_count","function_call_count","prepareState","initGlobal","mainFunc","findMainFunction","runFunction","checkContext","executeCommands","MAIN_INTERNAL_ID","funcStore","extendStore","associateParameters","stoWithVars","finalSto","formal_params","effective_params","caller_store","callee_store","associateVariadicParameter","actualParam","associateParameter","count","variadicCount","callerStore","calleeStore","evaluateExpression","actualValue","shouldTypeCast","inStore","realObj","ref","getLocAddressOf","setReferenceDimension","varID","realValue","doImplicitCasting","executeCommand","Utils","executeDeclaration","executeArrayIndexAssign","executeAssign","executeBreak","executeReturn","executeIfThenElse","executeRepeatUntil","executeWhile","executeFor","executeSwitch","executeFunctionCall","executeSysCall","switchCases","lastStore","lastCaseCheckResult","ignoreSwitchCases","equalityInfixApp","initCmd","passValue","increment","whileBlock","forAsWhile","newCmdList","checkCondition","isTrue","funcType","real_value","exp_type_string_info","mustBeArray","lineSV","columnSV","current_value","getAt","executeArrayDeclaration","linesSV","columnsSV","valueList","evaluateUnaryApp","evaluateInfixApp","evaluateArrayAccess","evaluateVariableLiteral","evaluateLiteral","evaluateFunctionCall","max_call_stack","evaluateMatrix","storeValueMatrix","evaluateVector","exps","n_elements","actualValues","exp_str","vectors","vec_type","unaryApp","infixApp","shouldImplicitCast","stringInfoLeft","stringInfoRight","rightStr","leftStr","strLeft","strRight","leftValue","rightValue","InputTest","inputList","OutputTest","currentLine","outputList","channel","autoGenerateTestCaseOutput","program_text","testCases","callback","copyTestCases","assign","analyseFromSource","resultList","registerInput","registerOutput","interpretAST","result_final","result_1","output_2","input_2","showAlert","Settings","programming","datatypes"],"sourceRoot":""}