diff options
author | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-27 08:46:56 +0100 |
---|---|---|
committer | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-27 14:19:05 +0100 |
commit | 5a47025d64f013975051473c1115ff70c0281785 (patch) | |
tree | 2a79b29beea6d4571993783cef523c38568c2742 /src/ljstype.js | |
parent | 94a301a27a8a75c4684790a99a898262b8354f68 (diff) | |
download | fengari-5a47025d64f013975051473c1115ff70c0281785.tar.gz fengari-5a47025d64f013975051473c1115ff70c0281785.tar.bz2 fengari-5a47025d64f013975051473c1115ff70c0281785.zip |
lexing
Diffstat (limited to 'src/ljstype.js')
-rw-r--r-- | src/ljstype.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/ljstype.js b/src/ljstype.js new file mode 100644 index 0000000..52ac153 --- /dev/null +++ b/src/ljstype.js @@ -0,0 +1,29 @@ +/* jshint esversion: 6 */ +"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 lislanum = function(c) { + return /^[_a-zA-z0-9]$/.test(c.charAt(0)); +}; + +module.exports.lisdigit = lisdigit; +module.exports.lislalpha = lislalpha; +module.exports.lislanum = lislanum; +module.exports.lisspace = lisspace; +module.exports.lisxdigit = lisxdigit;
\ No newline at end of file |