summaryrefslogtreecommitdiff
path: root/src/ljstype.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann@users.noreply.github.com>2017-03-01 11:54:57 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-01 12:19:22 +0100
commit166b951b9d05eff654ef664124f17c8a37f418a6 (patch)
treea783d5f05cd640d06065c514b87bc7cf74f5e506 /src/ljstype.js
parent94a301a27a8a75c4684790a99a898262b8354f68 (diff)
parent444182dbbb18f44cf7cafc378f092c28006be365 (diff)
downloadfengari-166b951b9d05eff654ef664124f17c8a37f418a6.tar.gz
fengari-166b951b9d05eff654ef664124f17c8a37f418a6.tar.bz2
fengari-166b951b9d05eff654ef664124f17c8a37f418a6.zip
Merge pull request #2 from giann/feature/lex-parse
Lexing & Parsing
Diffstat (limited to 'src/ljstype.js')
-rw-r--r--src/ljstype.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/ljstype.js b/src/ljstype.js
new file mode 100644
index 0000000..a92c8d0
--- /dev/null
+++ b/src/ljstype.js
@@ -0,0 +1,29 @@
+"use strict";
+
+const assert = require('assert');
+
+const lisdigit = function(c) {
+ return /^\d$/.test(c.charAt(0));
+};
+
+const lisxdigit = function(c) {
+ return /^[0-9a-fA-F]$/.test(c.charAt(0));
+};
+
+const lisspace = function(c) {
+ return /^\s$/.test(c.charAt(0));
+};
+
+const lislalpha = function(c) {
+ return /^[_a-zA-z]$/.test(c.charAt(0));
+};
+
+const lislalnum = function(c) {
+ return /^[_a-zA-z0-9]$/.test(c.charAt(0));
+};
+
+module.exports.lisdigit = lisdigit;
+module.exports.lislalnum = lislalnum;
+module.exports.lislalpha = lislalpha;
+module.exports.lisspace = lisspace;
+module.exports.lisxdigit = lisxdigit; \ No newline at end of file