diff --git a/src/parser/common/basic-parser-types.ts b/src/parser/common/basic-parser-types.ts index 8a9c0b6..728fdab 100644 --- a/src/parser/common/basic-parser-types.ts +++ b/src/parser/common/basic-parser-types.ts @@ -4,9 +4,9 @@ */ export interface CaretPosition { /** start at 1 */ - lineNumber: number; + readonly lineNumber: number; /** start at 1 */ - column: number; + readonly column: number; } /** @@ -45,23 +45,23 @@ export enum SyntaxContextType { export interface WordRange { /** content of word */ - text: string; + readonly text: string; /** start at 0 */ - startIndex: number; - stopIndex: number; + readonly startIndex: number; + readonly stopIndex: number; /** start at 1 */ - line: number; + readonly line: number; /** start at 1 */ - startColumn: number; - stopColumn: number; + readonly startColumn: number; + readonly stopColumn: number; } /** * Suggested information analyzed from the input */ export interface SyntaxSuggestion { - syntaxContextType: SyntaxContextType; - wordRanges: T[]; + readonly syntaxContextType: SyntaxContextType; + readonly wordRanges: T[]; } /** @@ -71,22 +71,22 @@ export interface Suggestions { /** * Suggestions about syntax */ - syntax: SyntaxSuggestion[]; + readonly syntax: SyntaxSuggestion[]; /** * Suggestions about keywords */ - keywords: string[]; + readonly keywords: string[]; } export interface TextSlice { /** start at 0 */ - startIndex: number; - endIndex: number; + readonly startIndex: number; + readonly endIndex: number; /** start at 1 */ - startLine: number; - endLine: number; + readonly startLine: number; + readonly endLine: number; /** start at 1 */ - startColumn: number; - endColumn: number; - text: string; + readonly startColumn: number; + readonly endColumn: number; + readonly text: string; } diff --git a/src/parser/common/parseErrorListener.ts b/src/parser/common/parseErrorListener.ts index d7deff1..3876767 100644 --- a/src/parser/common/parseErrorListener.ts +++ b/src/parser/common/parseErrorListener.ts @@ -5,23 +5,23 @@ import { ATNSimulator } from 'antlr4ts/atn/ATNSimulator'; * Converted from {@link SyntaxError}. */ export interface ParseError { - startLine: number; - endLine: number; - startCol: number; - endCol: number; - message: string; + readonly startLine: number; + readonly endLine: number; + readonly startCol: number; + readonly endCol: number; + readonly message: string; } /** * The type of error resulting from lexical parsing and parsing. */ export interface SyntaxError { - recognizer: Recognizer; - offendingSymbol: Token; - line: number; - charPositionInLine: number; - msg: string; - e: RecognitionException; + readonly recognizer: Recognizer; + readonly offendingSymbol: Token; + readonly line: number; + readonly charPositionInLine: number; + readonly msg: string; + readonly e: RecognitionException; } /**