formatting

This commit is contained in:
Eric Vergnaud 2020-10-03 14:04:11 +08:00
parent e73f72be73
commit 3451dccd6c
2 changed files with 6 additions and 1 deletions

View File

@ -7,6 +7,7 @@ const RuleContext = require('./RuleContext');
const {Hash, Map, equalArrays} = require('./Utils');
class PredictionContext {
constructor(cachedHashCode) {
this.cachedHashCode = cachedHashCode;
}
@ -83,6 +84,7 @@ function calculateHashString(parent, returnState) {
* can be used for both lexers and parsers.
*/
class PredictionContextCache {
constructor() {
this.cache = new Map();
}
@ -115,6 +117,7 @@ class PredictionContextCache {
class SingletonPredictionContext extends PredictionContext {
constructor(parent, returnState) {
let hashCode = 0;
const hash = new Hash();
@ -182,6 +185,7 @@ class SingletonPredictionContext extends PredictionContext {
}
class EmptyPredictionContext extends SingletonPredictionContext {
constructor() {
super(null, PredictionContext.EMPTY_RETURN_STATE);
}
@ -211,6 +215,7 @@ class EmptyPredictionContext extends SingletonPredictionContext {
PredictionContext.EMPTY = new EmptyPredictionContext();
class ArrayPredictionContext extends PredictionContext {
constructor(parents, returnStates) {
/**
* Parent can be null only if full ctx mode and we make an array

View File

@ -8,8 +8,8 @@ const {IntervalSet} = require('./../IntervalSet');
const {Token} = require('./../Token');
class ATN {
constructor(grammarType , maxTokenType) {
constructor(grammarType , maxTokenType) {
/**
* Used for runtime deserialization of ATNs from strings
* The type of the ATN.