{"_id":"lex","_rev":"244919","name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","dist-tags":{"latest":"1.7.9"},"maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"time":{"modified":"2024-10-21T04:08:48.000Z","created":"2012-09-20T17:11:56.226Z","1.7.9":"2015-08-16T01:39:48.560Z","1.7.8":"2014-12-25T02:16:33.791Z","1.7.7":"2014-10-04T13:31:39.690Z","1.7.6":"2014-06-08T16:02:28.441Z","1.7.5":"2014-03-28T14:13:52.876Z","1.7.4":"2013-04-17T02:17:01.001Z","1.7.3":"2013-01-25T15:25:49.933Z","1.7.2":"2013-01-25T14:58:19.802Z","1.7.1":"2013-01-25T12:26:48.659Z","1.7.0":"2013-01-25T11:45:23.425Z","1.6.0":"2013-01-23T15:53:20.913Z","1.5.1":"2012-12-16T08:28:04.309Z","1.4.1":"2012-12-01T09:24:14.654Z","1.4.0":"2012-12-01T09:22:16.234Z","1.3.0":"2012-12-01T06:20:13.090Z","1.2.0":"2012-11-25T03:12:07.550Z","1.1.2":"2012-11-17T16:04:57.829Z","1.1.1":"2012-11-16T02:44:57.334Z","1.1.0":"2012-11-15T14:11:31.506Z","1.0.1":"2012-09-29T09:17:17.875Z","1.0.0":"2012-09-20T17:11:56.226Z"},"users":{"chocolateboy":true,"smikes":true,"rkielty":true,"thinhair":true,"slurm":true},"author":{"name":"Aadit M Shah","email":"aaditmshah@fastmail.fm","url":"http://aaditmshah.github.com/"},"repository":{"type":"git","url":"git+https://github.com/aaditmshah/lexer.git"},"versions":{"1.7.9":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.7.9","keywords":["lex","lexer","lexical","analysis","scan","scanner","scanning","token","tokenize","tokenizer","tokenization","flex","jison"],"author":{"name":"Aadit M Shah","email":"aaditmshah@fastmail.fm","url":"http://aaditmshah.github.com/"},"main":"lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@fastmail.fm","url":"http://aaditmshah.github.com/"}],"bugs":{"url":"https://github.com/aaditmshah/lexer/issues"},"licenses":[{"type":"MIT","url":"http://opensource.org/licenses/MIT"}],"repository":{"type":"git","url":"git+https://github.com/aaditmshah/lexer.git"},"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","gitHead":"46ea2e02e80e8205db75b83362f9fbbcfc9c8787","_id":"lex@1.7.9","scripts":{},"_shasum":"5d5636ccef574348362938b79a47f0eed8ed0d43","_from":".","_npmVersion":"2.13.5","_nodeVersion":"0.12.7","_npmUser":{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"},"dist":{"shasum":"5d5636ccef574348362938b79a47f0eed8ed0d43","size":4626,"noattachment":false,"key":"/lex/-/lex-1.7.9.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.7.9.tgz"},"directories":{},"publish_time":1439689188560,"_cnpm_publish_time":1439689188560,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.7.8":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.7.8","keywords":["lex","lexer","lexical","analysis","scan","scanner","scanning","token","tokenize","tokenizer","tokenization","flex","jison"],"author":{"name":"Aadit M Shah","email":"aaditmshah@fastmail.fm","url":"http://aaditmshah.github.com/"},"main":"lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@fastmail.fm","url":"http://aaditmshah.github.com/"}],"bugs":{"url":"https://github.com/aaditmshah/lexer/issues"},"licenses":[{"type":"MIT","url":"http://opensource.org/licenses/MIT"}],"repository":{"type":"git","url":"https://github.com/aaditmshah/lexer.git"},"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","gitHead":"d2f93ea92f70101ad3f9ef97a141a8cb5c13ac13","_id":"lex@1.7.8","scripts":{},"_shasum":"ab1e7baed788491760de3045fd537639a45d1501","_from":".","_npmVersion":"2.1.15","_nodeVersion":"0.10.34","_npmUser":{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"},"dist":{"shasum":"ab1e7baed788491760de3045fd537639a45d1501","size":4615,"noattachment":false,"key":"/lex/-/lex-1.7.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.7.8.tgz"},"directories":{},"publish_time":1419473793791,"_cnpm_publish_time":1419473793791,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.7.7":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.7.7","keywords":["lex","lexer","lexical","analysis","scan","scanner","scanning","token","tokenize","tokenizer","tokenization","flex","jison"],"author":{"name":"Aadit M Shah","email":"aaditmshah@fastmail.fm","url":"http://aaditmshah.github.com/"},"main":"lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@fastmail.fm","url":"http://aaditmshah.github.com/"}],"bugs":{"url":"https://github.com/aaditmshah/lexer/issues"},"licenses":[{"type":"MIT","url":"http://opensource.org/licenses/MIT"}],"repository":{"type":"git","url":"https://github.com/aaditmshah/lexer.git"},"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","_id":"lex@1.7.7","_shasum":"b6059577a1e3dfcaafb83afb109778a253eed42e","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"},"dist":{"shasum":"b6059577a1e3dfcaafb83afb109778a253eed42e","size":4610,"noattachment":false,"key":"/lex/-/lex-1.7.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.7.7.tgz"},"directories":{},"publish_time":1412429499690,"_cnpm_publish_time":1412429499690,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.7.6":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.7.6","keywords":["lex","lexer","lexical","analysis","scan","scanner","scanning","token","tokenize","tokenizer","tokenization","flex","jison"],"author":{"name":"Aadit M Shah","email":"aaditmshah@fastmail.fm","url":"http://aaditmshah.github.com/"},"main":"lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@fastmail.fm","url":"http://aaditmshah.github.com/"}],"bugs":{"url":"https://github.com/aaditmshah/lexer/issues"},"licenses":[{"type":"MIT","url":"http://opensource.org/licenses/MIT"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","repository":{"type":"git","url":"https://github.com/aaditmshah/lexer.git"},"_id":"lex@1.7.6","_shasum":"acd8076a5d9cc2db767e229ceab32236945d26c4","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"},"dist":{"shasum":"acd8076a5d9cc2db767e229ceab32236945d26c4","size":4618,"noattachment":false,"key":"/lex/-/lex-1.7.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.7.6.tgz"},"directories":{},"publish_time":1402243348441,"_cnpm_publish_time":1402243348441,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.7.5":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.7.5","keywords":["lex","lexer","lexical","analysis","scan","scanner","scanning","token","tokenize","tokenizer","tokenization","flex","jison"],"author":{"name":"Aadit M Shah","email":"aaditmshah@fastmail.fm","url":"http://aaditmshah.github.com/"},"main":"lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@fastmail.fm","url":"http://aaditmshah.github.com/"}],"bugs":{"url":"https://github.com/aaditmshah/lexer/issues"},"licenses":[{"type":"MIT","url":"http://opensource.org/licenses/MIT"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","repository":{"type":"git","url":"https://github.com/aaditmshah/lexer.git"},"_id":"lex@1.7.5","dist":{"shasum":"c95e15de2fc963077972b9b584f1a1fb55f03d4d","size":4441,"noattachment":false,"key":"/lex/-/lex-1.7.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.7.5.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"},"directories":{},"publish_time":1396016032876,"_cnpm_publish_time":1396016032876,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.7.4":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.7.4","keywords":["lex","lexer","lexical","analysis","scan","scanner","scanning","token","tokenize","tokenizer","tokenization","flex","jison"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"MIT","url":"http://opensource.org/licenses/MIT"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.7.4","dist":{"shasum":"33dd66b980a38d77a6c424d7173e6f40d602c0c5","size":4456,"noattachment":false,"key":"/lex/-/lex-1.7.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.7.4.tgz"},"_from":".","_npmVersion":"1.2.17","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1366165021001,"_cnpm_publish_time":1366165021001,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.7.3":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.7.3","keywords":["lex","lexer","lexical","analysis","scan","scanner","scanning","token","tokenize","tokenizer","tokenization","flex","jison"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.7.3","dist":{"shasum":"3cdf996cee1a76c900951bd155884976073c7bb8","size":3809,"noattachment":false,"key":"/lex/-/lex-1.7.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.7.3.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1359127549933,"_cnpm_publish_time":1359127549933,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.7.2":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.7.2","keywords":["lex","lexer","lexical","analysis","scan","scanner","scanning","token","tokenize","tokenizer","tokenization","flex","jison"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.7.2","dist":{"shasum":"8e0aff92f8b8b608f3fe0295e9a5cd457cbee311","size":3798,"noattachment":false,"key":"/lex/-/lex-1.7.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.7.2.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1359125899802,"_cnpm_publish_time":1359125899802,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.7.1":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.7.1","keywords":["lex","lexer","lexical","analysis","scan","scanner","scanning","token","tokenize","tokenizer","tokenization","flex","jison"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.7.1","dist":{"shasum":"ff7620d88ce010710129b45eae81b7c1ef7f5c2c","size":3774,"noattachment":false,"key":"/lex/-/lex-1.7.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.7.1.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1359116808659,"_cnpm_publish_time":1359116808659,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.7.0":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.7.0","keywords":["lex","lexer","lexical","analysis","scan","scanner","scanning","token","tokenize","tokenizer","tokenization","flex","jison"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.7.0","dist":{"shasum":"e10e570f8b27c103dcbef5234f90f0498db6fca1","size":3782,"noattachment":false,"key":"/lex/-/lex-1.7.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.7.0.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1359114323425,"_cnpm_publish_time":1359114323425,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.6.0":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.6.0","keywords":["lex","lexer","lexical","analysis","scan","scanner","scanning","token","tokenize","tokenizer","tokenization","flex","jison"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.6.0","dist":{"shasum":"d5bbf47837f32747bce312e1e1e1c60181c230eb","size":3411,"noattachment":false,"key":"/lex/-/lex-1.6.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.6.0.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1358956400913,"_cnpm_publish_time":1358956400913,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.5.1":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.5.1","keywords":["lex","lexer","lexical","analysis","scan","scanner","scanning","token","tokenize","tokenizer","tokenization","flex","jison"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.5.1","dist":{"shasum":"5935fc54fda6ffe267413218c36e5241455b024e","size":3096,"noattachment":false,"key":"/lex/-/lex-1.5.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.5.1.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1355646484309,"_cnpm_publish_time":1355646484309,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.4.1":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.4.1","keywords":["lexer"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"./lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.4.1","dist":{"shasum":"de401e393aa681a324cc8b74e9d5c8db0f7c592a","size":2935,"noattachment":false,"key":"/lex/-/lex-1.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.4.1.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1354353854654,"_cnpm_publish_time":1354353854654,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.4.0":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.4.0","keywords":["lexer"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"./lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.4.0","dist":{"shasum":"b3fd2f5d3f20c76302bbb1e7e09bf3802796b741","size":2923,"noattachment":false,"key":"/lex/-/lex-1.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.4.0.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1354353736234,"_cnpm_publish_time":1354353736234,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.3.0":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.3.0","keywords":["lexer"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"./lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.3.0","dist":{"shasum":"762707fe78a8bc24bd40374be4365e17ceb10a4c","size":2925,"noattachment":false,"key":"/lex/-/lex-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.3.0.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1354342813090,"_cnpm_publish_time":1354342813090,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.2.0":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.2.0","keywords":["lexer"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"./lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.2.0","dist":{"shasum":"c91ea9a6034a1fcf17ae6906950f62cd62d965bd","size":2880,"noattachment":false,"key":"/lex/-/lex-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.2.0.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1353813127550,"_cnpm_publish_time":1353813127550,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.2":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.1.2","keywords":["lexer"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"./lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.1.2","dist":{"shasum":"bf4552086d3b8c210d41ea840a7f0a7ec3549131","size":2898,"noattachment":false,"key":"/lex/-/lex-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.1.2.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1353168297829,"_cnpm_publish_time":1353168297829,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.1":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.1.1","keywords":["lexer"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"./lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.1.1","dist":{"shasum":"571ec1edd85f31d55464799d4e8e19d90f84eb6c","size":2911,"noattachment":false,"key":"/lex/-/lex-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.1.1.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1353033897334,"_cnpm_publish_time":1353033897334,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.0":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.1.0","keywords":["lexer"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"./lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":"https://github.com/aaditmshah/lexer/issues","licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","readmeFilename":"README.md","_id":"lex@1.1.0","dist":{"shasum":"c0a7d1acc8ef36d8337539df35690d73240833ff","size":2901,"noattachment":false,"key":"/lex/-/lex-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.1.0.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"directories":{},"publish_time":1352988691506,"_cnpm_publish_time":1352988691506,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.0.1":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.0.1","keywords":["lexer"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"./lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":{"name":"https://github.com/aaditmshah/lexer/issues"},"licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"_id":"lex@1.0.1","devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"2519b630801566177ad5155dea96d3e8a9fa89e2","size":2891,"noattachment":false,"key":"/lex/-/lex-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.0.1.tgz"},"directories":{},"publish_time":1348910237875,"_cnpm_publish_time":1348910237875,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.0.0":{"name":"lex","description":"An elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.","version":"1.0.0","keywords":["lexer"],"author":{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"},"main":"./lib/lexer.js","maintainers":[{"name":"aaditmshah","email":"aaditmshah@fastmail.fm"}],"contributors":[{"name":"Aadit M Shah","email":"aaditmshah@myopera.com","url":"http://aaditmshah.github.com/"}],"bugs":{"name":"https://github.com/aaditmshah/lexer/issues"},"licenses":[{"type":"GPLv3","url":"http://www.gnu.org/copyleft/gpl.html"}],"repositories":[{"type":"git","url":"https://github.com/aaditmshah/lexer.git"}],"dependencies":{},"homepage":"https://github.com/aaditmshah/lexer","_npmUser":{"name":"aaditmshah","email":"aaditmshah@myopera.com"},"_id":"lex@1.0.0","devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"caf920a157c0279dfee37fd7dc978c6c8a2d27b7","size":2872,"noattachment":false,"key":"/lex/-/lex-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lex/download/lex-1.0.0.tgz"},"directories":{},"publish_time":1348161116226,"_cnpm_publish_time":1348161116226,"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"readme":"# Lexer #\n\nAn elegant armor-plated JavaScript lexer modelled after flex. Easily extensible to tailor to your need for perfection.\n\n## Installation ##\n\nLexer may be installed on [node.js](http://nodejs.org/ \"node.js\") via the [node package manager](https://npmjs.org/ \"npm\") using the command `npm install lex`.\n\nYou may also install it on [RingoJS](http://ringojs.org/ \"Home - RingoJS\") using the command `ringo-admin install aaditmshah/lexer`.\n\nYou may install it for web apps using the [bower](http://bower.io/ \"Bower - A package manager for the web\") command `bower install lexer`.\n\nYou may install it as a [component](https://github.com/component/component \"component/component\") for web apps using the command `component install aaditmshah/lexer`.\n\n## Usage ##\n\nCreating a lexer is as simple as instantiating the constructor `Lexer`.\n\n```javascript\nvar lexer = new Lexer;\n```\n\nAfter creating a lexer you may add rules to the lexer using the method `addRule`. The first argument to the function must be a `RegExp` object (the pattern to match). The second argument must be a function (the action to call when the pattern matches some text). The arguments passed to the function are the lexeme that was matched and all the substrings matched by parentheticals in the regular expression if any.\n\n```javascript\nvar lexer = new Lexer;\n\nlexer.addRule(/[a-f\\d]+/i, function (lexeme) {\n    return \"HEX\";\n});\n```\n\nAfter adding rules to the lexer you may set the property `input` of the lexer to any string that you wish to tokenize and then call the method `lex`. The function returns the first non `undefined` value returned by an action. Else it returns `undefined` if it scans the entire input string. On calling `lex` it starts scanning where it last left off. The `addRule` and `setInput` methods of the lexer support chaining.\n\n```javascript\nvar lines = 0;\nvar chars = 0;\n\n(new Lexer).addRule(/\\n/, function () {\n    lines++;\n    chars++;\n}).addRule(/./, function () {\n    chars++;\n}).setInput(\"Hello World!\").lex();\n```\n\nIf the lexer can't match any pattern then it executes the default rule which matches the next character in the input string. The default action may be specified as an argument to the constructor. Setting the property `reject` on the `this` object in an action to `true` tells the lexer to reject the current rule and match the next best rule.\n\n```javascript\nvar row = 1;\nvar col = 1;\n\nvar lexer = new Lexer(function (char) {\n    throw new Error(\"Unexpected character at row \" + row + \", col \" + col + \": \" + char);\n});\n\nlexer.addRule(/\\n/, function () {\n    row++;\n    col = 1;\n}, []);\n\nlexer.addRule(/./, function () {\n    this.reject = true;\n    col++;\n}, []);\n\nlexer.input = \"Hello World!\";\n\nlexer.lex();\n```\n\nYou may even specify [start conditions](http://flex.sourceforge.net/manual/Start-Conditions.html \"Start Conditions - Lexical Analysis With Flex, for Flex 2.5.37\") for every rule as an optional third argument to the `addRule` method (which must be an array of unsigned integers). By default all rules are active in the initial state (i.e. `0`). Odd start conditions are inclusive while even start conditions are exclusive. Rules with an empty array as the third argument are always active.\n\n## Integration with Jison ##\n\nThe generated lexer may be used as a custom scanner for Jison. Actions must return tokens and associated text must be made available in the property `yytext` on the object `this` from within the action.\n\n```javascript\nvar Parser = require(\"jison\").Parser;\nvar Lexer = require(\"lex\");\n\nvar grammar = {\n    \"bnf\": {\n        \"expression\" :[[ \"e EOF\",   \"return $1;\"  ]],\n        \"e\" :[[ \"NUMBER\",  \"$$ = Number(yytext);\" ]]\n    }\n};\n\nvar parser = new Parser(grammar);\nvar lexer = parser.lexer = new Lexer;\n\nlexer.addRule(/\\s+/, function () {});\n\nlexer.addRule(/[0-9]+(?:\\.[0-9]+)?\\b/, function (lexeme) {\n    this.yytext = lexeme;\n    return \"NUMBER\";\n});\n\nlexer.addRule(/$/, function () {\n    return \"EOF\";\n});\n\nparser.parse(\"2\");\n```\n\nStarting from v1.6.0 you can return multiple values from an action by returning an array. The elements of the array will be returned individually by the `lex` method. This allows you to implement features like [python style indentation](http://docs.python.org/release/2.5.1/ref/indentation.html \"2.1.8 Indentation\") as follows:\n\n```javascript\nvar indent = [0];\n\nvar lexer = new Lexer;\n\nlexer.addRule(/^[\\t ]*/gm, function (lexeme) {\n    var indentation = lexeme.length;\n\n    if (indentation > indent[0]) {\n        indent.unshift(indentation);\n        return \"INDENT\";\n    }\n\n    var tokens = [];\n\n    while (indentation < indent[0]) {\n        tokens.push(\"DEDENT\");\n        indent.shift();\n    }\n\n    if (tokens.length) return tokens;\n});\n```\n\n## Global Patterns ##\n\nSometimes you may wish to match a pattern which need not necessarily generate the longest possible string. Since the scanner sorts the matched strings according to their length there's no way to do so. Hence in v1.7.0 I introduced global patterns. Strings matching these patterns are never sorted. This allows you to match a shorter strings before longer ones:\n\n```javascript\nvar lexer = new Lexer;\n\nlexer.addRule(/^ */gm, function (lexeme) {\n    console.log(lexeme.length);\n});\n\nlexer.addRule(/[0-9]+/, function (lexeme) {\n    console.log(lexeme);\n});\n\nlexer.setInput(\"37\");\n\nlexer.lex();\n```\n\nThe above program first logs the number of spaces at the beginning of the line (`0`) and then the number `37` although the length of the string `\"37\"` is greater than the empty string `\"\"`. This is because it's the first rule and the `global` flag for its pattern is set.\n","_attachments":{},"homepage":"https://github.com/aaditmshah/lexer","bugs":{"url":"https://github.com/aaditmshah/lexer/issues"}}