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

modl-parser

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modl-parser - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

README.md

28

dist/MODLParser.js

@@ -24,6 +24,14 @@ "use strict";

var tokens = MODLTokeniser_1.tokeniser(s);
var root = parse(new TokenStream_1.TokenStream(tokens));
return new Model_1.Modl(root);
var rootItems = parse(new TokenStream_1.TokenStream(tokens));
return new Model_1.Modl(rootItems);
};
exports.parseModl = parseModl;
var ParserException = (function (_super) {
__extends(ParserException, _super);
function ParserException() {
return _super !== null && _super.apply(this, arguments) || this;
}
return ParserException;
}(Error));
exports.ParserException = ParserException;
var parse = function (s) {

@@ -45,3 +53,3 @@ var rootPrimitive = parsePrimitive(s);

case MODLTokeniser_1.TokenType.EQUALS: {
if (s.length() === 0) {
if (s.empty()) {
throw new ParserException("Unexpected token: " + tok.toS());

@@ -99,3 +107,3 @@ }

var result = [];
while (s.length() > 0) {
while (!s.empty()) {
result.push(parseModlValue(s));

@@ -117,3 +125,3 @@ var maybeStructSep = s.next();

var arrayEntries = [];
while (s.length() > 0) {
while (!s.empty()) {
var peek = s.peek();

@@ -148,3 +156,3 @@ if (peek && peek.type === MODLTokeniser_1.TokenType.RBRACKET) {

var mapEntries = [];
while (s.length() > 0) {
while (!s.empty()) {
var peek = s.peek();

@@ -223,10 +231,2 @@ if (peek && peek.type === MODLTokeniser_1.TokenType.RPAREN) {

};
var ParserException = (function (_super) {
__extends(ParserException, _super);
function ParserException() {
return _super !== null && _super.apply(this, arguments) || this;
}
return ParserException;
}(Error));
exports.ParserException = ParserException;
//# sourceMappingURL=MODLParser.js.map

@@ -10,2 +10,4 @@ export declare class Token {

export declare const tokeniser: (s: string) => Token[];
export declare class TokeniserException extends Error {
}
export declare enum TokenType {

@@ -26,3 +28,1 @@ LPAREN = "LPAREN",

}
export declare class TokeniserException extends Error {
}

@@ -18,3 +18,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.TokeniserException = exports.TokenType = exports.tokeniser = exports.Token = void 0;
exports.TokenType = exports.TokeniserException = exports.tokeniser = exports.Token = void 0;
var Token = (function () {

@@ -37,2 +37,10 @@ function Token(type, value, from, to) {

exports.tokeniser = tokeniser;
var TokeniserException = (function (_super) {
__extends(TokeniserException, _super);
function TokeniserException() {
return _super !== null && _super.apply(this, arguments) || this;
}
return TokeniserException;
}(Error));
exports.TokeniserException = TokeniserException;
var WS = ' \t\r\n';

@@ -172,10 +180,2 @@ var nonStringTokens = '[]();"=';

}());
var TokeniserException = (function (_super) {
__extends(TokeniserException, _super);
function TokeniserException() {
return _super !== null && _super.apply(this, arguments) || this;
}
return TokeniserException;
}(Error));
exports.TokeniserException = TokeniserException;
//# sourceMappingURL=MODLTokeniser.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var MODLParser_1 = require("./MODLParser");
var tests = ['()'];
var modl = tests.map(function (t) { return MODLParser_1.parseModl(t); });
console.log(JSON.stringify(modl));
var result = MODLParser_1.parseModl('x=y');
console.log(JSON.stringify(result));
//# sourceMappingURL=Scratch.js.map

@@ -8,3 +8,3 @@ import { Token } from './MODLTokeniser';

pushBack(t: Token): void;
length(): number;
empty(): boolean;
}

@@ -25,4 +25,4 @@ "use strict";

};
TokenStream.prototype.length = function () {
return this.tokens.length;
TokenStream.prototype.empty = function () {
return this.tokens.length === 0;
};

@@ -29,0 +29,0 @@ return TokenStream;

{
"name": "modl-parser",
"version": "0.1.7",
"version": "0.1.8",
"description": "A MODL parser in TypeScript",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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