Ver código fonte

Implement the char related functions into definedFunctions.js and grammar files (pt)

Lucas de Souza 4 anos atrás
pai
commit
f9f705d169
2 arquivos alterados com 5 adições e 3 exclusões
  1. 1 0
      grammar/pt/langFunctions.js
  2. 4 3
      js/processor/definedFunctions.js

+ 1 - 0
grammar/pt/langFunctions.js

@@ -19,6 +19,7 @@ export default {
   $castInt: "como_inteiro",
   $castBool: "como_logico",
   $castString: "como_cadeia",
+  $castChar: "como_caractere",
   $sin: "seno",
   $cos: "cosseno",
   $tan: "tangente",

+ 4 - 3
js/processor/definedFunctions.js

@@ -8,7 +8,7 @@ import {createMatrixColumnsFun, createMatrixLinesFun,
 import {createCastBoolFun, createCastIntFun,
   createCastRealFun, createCastStringFun,
   createIsBoolFun, createIsIntFun,
-  createIsRealFun} from './lib/lang';
+  createIsRealFun, createCastCharFun} from './lib/lang';
 import {createAbsFun, createCosFun,
   createInvertFun, createLogFun,
   createMaxFun, createMinFun,
@@ -28,7 +28,7 @@ function valueToKey (value, object) {
 }
 
 function concatObjects (...objs) {
-  let result = {};
+  const result = {};
   for (let i = 0; i < objs.length; i++) {
     const obj = objs[i];
     for(const key in obj) {
@@ -78,7 +78,8 @@ const libsObject = {
     $castReal: createCastRealFun(),
     $castInt: createCastIntFun(),
     $castBool: createCastBoolFun(),
-    $castString: createCastStringFun()
+    $castString: createCastStringFun(),
+    $castChar: createCastCharFun()
   }
 }