Comparing version 4.12.0-beta.4 to 4.12.0-beta.5
{ | ||
"name": "antlr4", | ||
"version": "4.12.0-beta.4", | ||
"version": "4.12.0-beta.5", | ||
"type": "module", | ||
@@ -23,5 +23,5 @@ "description": "JavaScript runtime for ANTLR4", | ||
"@babel/core": "^7.19.1", | ||
"@babel/eslint-parser": "^7.19.1", | ||
"@babel/preset-env": "^7.19.4", | ||
"@types/node": "^18.7.23", | ||
"@babel/eslint-parser": "^7.19.1", | ||
"babel-loader": "^8.2.5", | ||
@@ -49,6 +49,4 @@ "compression-webpack-plugin": "^10.0.0", | ||
"browser": { | ||
"fs": false, | ||
"net": false, | ||
"module": false | ||
"fs": false | ||
} | ||
} |
export declare class CharStream { | ||
index: number; // defined as property | ||
size: number;// defined as property | ||
constructor(data: string); | ||
constructor(data: string, decodeToUnicodeCodePoints: boolean); | ||
reset(): void; | ||
seek(index: number): void; | ||
consume(): void; | ||
getText(start: number, stop: number): string; | ||
LA(offset: number): number; | ||
LT(offset: number): number; | ||
mark(): number; | ||
release(marker: number): void; | ||
seek(index: number): void; | ||
getText(start: number, stop: number): string; | ||
toString(): string; | ||
} |
@@ -5,3 +5,3 @@ import {CharStream} from "./CharStream"; | ||
fileName: string; | ||
index: number; // defined as property | ||
@@ -8,0 +8,0 @@ constructor(fileName: string); |
@@ -7,3 +7,8 @@ /* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. | ||
import InputStream from './InputStream.js'; | ||
import fs from "fs"; | ||
const isNode = | ||
typeof process !== "undefined" && | ||
process.versions != null && | ||
process.versions.node != null; | ||
// use eval to fool webpack and mocha | ||
const fs = isNode ? await eval("import('fs')") : null; | ||
@@ -16,2 +21,4 @@ /** | ||
constructor(fileName, decodeToUnicodeCodePoints) { | ||
if(!isNode) | ||
throw new Error("FileStream is only available when running in Node!"); | ||
const data = fs.readFileSync(fileName, "utf8"); | ||
@@ -18,0 +25,0 @@ super(data, decodeToUnicodeCodePoints); |
export * from "./InputStream"; | ||
export * from "./FileStream"; | ||
export * from "./CharStream"; | ||
export * from "./CharStreams"; | ||
export * from "./TokenStream"; | ||
@@ -18,2 +17,2 @@ export * from "./BufferedTokenStream"; | ||
export * from './error'; | ||
export * from './utils'; | ||
export * from './utils'; |
@@ -40,3 +40,2 @@ /* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. | ||
import ParseTreeListener from "./tree/ParseTreeListener.js"; | ||
import ParseTreeVisitor from "./tree/ParseTreeVisitor.js"; | ||
import ParseTreeWalker from "./tree/ParseTreeWalker.js"; | ||
@@ -57,3 +56,3 @@ import ErrorListener from "./error/ErrorListener.js" | ||
RuleNode, TerminalNode, ParseTreeWalker, RuleContext, ParserRuleContext, Interval, IntervalSet, | ||
PredictionMode, LL1Analyzer, ParseTreeListener, ParseTreeVisitor, ATN, ATNDeserializer, PredictionContextCache, LexerATNSimulator, ParserATNSimulator, DFA, | ||
PredictionMode, LL1Analyzer, ParseTreeListener, ATN, ATNDeserializer, PredictionContextCache, LexerATNSimulator, ParserATNSimulator, DFA, | ||
RecognitionException, NoViableAltException, FailedPredicateException, ErrorListener, DiagnosticErrorListener, BailErrorStrategy, | ||
@@ -67,2 +66,2 @@ arrayToString | ||
import CodePointAt from './polyfills/codepointat.js'; | ||
import FromCodePoint from './polyfills/fromcodepoint.js'; | ||
import FromCodePoint from './polyfills/fromcodepoint.js'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
1424014
13179
2
214
1