Socket
Socket
Sign inDemoInstall

moo

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moo - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

20

moo.js

@@ -60,6 +60,2 @@ (function(root, factory) {

function compareLength(a, b) {
return b.length - a.length
}
function regexpOrLiteral(obj) {

@@ -195,5 +191,5 @@ if (typeof obj === 'string') {

var flags = hasSticky ? 'ym' : 'gm'
var regexp = new RegExp(reUnion(parts) + suffix, flags)
var combined = new RegExp(reUnion(parts) + suffix, flags)
return {regexp: regexp, groups: groups, error: errorRule}
return {regexp: combined, groups: groups, error: errorRule}
}

@@ -243,2 +239,5 @@

(byLength[keyword.length] = byLength[keyword.length] || []).push(keyword)
if (typeof keyword !== 'string') {
throw new Error("keyword must be string (in keyword '" + tokenType + "')")
}
reverseMap[keyword] = tokenType

@@ -260,5 +259,2 @@ })

var tokenType = reverseMap[keyword]
if (typeof tokenType !== 'string') {
throw new Error('keyword type must be string: ' + name)
}
source += 'case ' + str(keyword) + ': return ' + str(tokenType) + '\n'

@@ -455,6 +451,4 @@ })

if (group.tokenType === tokenType) return true
if (group.keywords) {
for (var k in group.keywords) {
if (group.keywords[k].tokenType === tokenType) return true
}
if (group.keywords && hasOwnProperty.call(group.keywords, tokenType)) {
return true
}

@@ -461,0 +455,0 @@ }

{
"name": "moo",
"version": "0.4.1",
"version": "0.4.2",
"description": "Optimised tokenizer/lexer generator! πŸ„ Much performance. Moo!",

@@ -5,0 +5,0 @@ "main": "moo.js",

@@ -343,3 +343,5 @@ ![](cow.png)

Do check the [FAQ](https://github.com/tjvr/moo/issues?q=label%3Aquestion).
Before submitting an issue, [remember...](https://github.com/tjvr/moo/blob/master/.github/CONTRIBUTING.md)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc