Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lexing

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lexing - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

9

index.js

@@ -496,4 +496,6 @@ var __extends = this.__extends || function (d, b) {

var MachineState = (function () {
function MachineState(iterable) {
function MachineState(iterable, peek_length) {
if (peek_length === void 0) { peek_length = 256; }
this.iterable = iterable;
this.peek_length = peek_length;
}

@@ -507,4 +509,7 @@ // generic callbacks

};
MachineState.prototype.attachState = function (SubState) {
return new SubState(this.iterable, this.peek_length);
};
MachineState.prototype.read = function () {
var input = this.iterable.peek(64);
var input = this.iterable.peek(this.peek_length);
for (var i = 0, rule; (rule = this.rules[i]); i++) {

@@ -511,0 +516,0 @@ var match = input.match(rule[0]);

@@ -529,2 +529,5 @@ /// <reference path="type_declarations/DefinitelyTyped/node/node.d.ts" />

}
export interface MachineStateConstructor<T, I> {
new(iterable: StringIterable, peek_length?: number): MachineState<T, I>;
}

@@ -550,3 +553,4 @@ /**

protected rules: MachineRule<T>[];
constructor(protected iterable: StringIterable) { }
constructor(protected iterable: StringIterable,
protected peek_length: number = 256) { }

@@ -561,4 +565,8 @@ // generic callbacks

attachState<SubT, SubI>(SubState: MachineStateConstructor<SubT, SubI>): MachineState<SubT, SubI> {
return new SubState(this.iterable, this.peek_length);
}
read(): T {
var input = this.iterable.peek(64);
var input = this.iterable.peek(this.peek_length);

@@ -565,0 +573,0 @@ for (var i = 0, rule: MachineRule<T>; (rule = this.rules[i]); i++) {

@@ -263,2 +263,5 @@ /// <reference path="../../type_declarations/DefinitelyTyped/node/node.d.ts" />

function MachineRule<T>(regexp: RegExp, callback: MachineCallback<T>): MachineRule<T>;
interface MachineStateConstructor<T, I> {
new (iterable: StringIterable, peek_length?: number): MachineState<T, I>;
}
/**

@@ -282,9 +285,11 @@ Every MachineState has:

protected iterable: StringIterable;
protected peek_length: number;
protected value: I;
protected rules: MachineRule<T>[];
constructor(iterable: StringIterable);
constructor(iterable: StringIterable, peek_length?: number);
pop(): T;
ignore(): T;
attachState<SubT, SubI>(SubState: MachineStateConstructor<SubT, SubI>): MachineState<SubT, SubI>;
read(): T;
}
}
{
"name": "lexing",
"version": "0.3.3",
"version": "0.3.4",
"description": "Regex-based lexer",

@@ -5,0 +5,0 @@ "keywords": [

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