Full implementation of the procol

This commit is contained in:
2014-11-01 23:02:35 +01:00
parent 1e7d36bd3c
commit a33b867112
4 changed files with 291 additions and 97 deletions

View File

@@ -1,6 +1,6 @@
/**
* @function color
* Convert a color to message string
* @function color
* @param {string|number} value Color to convert
* @return {string} Converted color
*/
@@ -11,8 +11,8 @@ function color (value) {
}
/**
* @function bool
* Convert a boolean value to message string
* @function bool
* @param {bool} value Boolean to convert
* @return {string} Converted boolean
*/
@@ -23,21 +23,26 @@ function bool (value) {
}
/**
* @function position
* Convert a position to message string
* @function position
* @param {number} line Line of position starting with 1
* @param {number} col Column of position starting with 0
* @return {string} Converted position
*/
function position (line, col) {
function position (pos) {
"use strict";
return line+"/"+col;
if (Array.isArray(pos)) {
return pos[0]+"/"+pos[1];
}
else {
return pos;
}
}
/**
* @function string
* Convert a string to message string
* @function string
* @param {string} value String to convert
* @return {string} Converted string
*/