Skip to content

Commit

Permalink
Use implicit public
Browse files Browse the repository at this point in the history
  • Loading branch information
nikeee committed Apr 2, 2024
1 parent 346f40b commit b4a7ce5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class Parser {
return sourceText.split(/\r?\n/);
}

public parse(sourceText: string): SourceFile {
parse(sourceText: string): SourceFile {
this.sourceText = sourceText;
this.scanner.setText(this.sourceText);

Expand Down
32 changes: 16 additions & 16 deletions src/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,24 @@ export type ErrorCallback = (
) => void;

export class DefaultScanner implements Scanner {
public end: number;
public pos: number;
public startPos: number;
public tokenPos: number;
public token: SyntaxKind;
public tokenValue: string | undefined;
public tokenFlags: TokenFlags;
public isUnterminated: boolean;
public text: string;
public onError: ErrorCallback | null;

public setText(newText?: string, start = 0, length?: number): void {
end: number;
pos: number;
startPos: number;
tokenPos: number;
token: SyntaxKind;
tokenValue: string | undefined;
tokenFlags: TokenFlags;
isUnterminated: boolean;
text: string;
onError: ErrorCallback | null;

setText(newText?: string, start = 0, length?: number): void {
this.text = newText || "";
this.end = length === undefined ? this.text.length : start + length;
this.#setTextPos(start || 0);
}

public setErrorCallback(cb: ErrorCallback | null) {
setErrorCallback(cb: ErrorCallback | null) {
this.onError = cb;
}

Expand All @@ -111,7 +111,7 @@ export class DefaultScanner implements Scanner {
this.tokenFlags = TokenFlags.None;
}

public scan(skipTrivia = true): SyntaxKind {
scan(skipTrivia = true): SyntaxKind {
this.startPos = this.pos;
this.tokenFlags = TokenFlags.None;
this.isUnterminated = false;
Expand Down Expand Up @@ -543,11 +543,11 @@ export class DefaultScanner implements Scanner {
return (this.token = SyntaxKind.TextIdentifier);
}

public lookAhead<T extends SyntaxKind>(callback: () => T): T {
lookAhead<T extends SyntaxKind>(callback: () => T): T {
return this.#speculationHelper(callback, /*isLookahead*/ true);
}

public tryScan<T extends SyntaxKind>(callback: () => T): T {
tryScan<T extends SyntaxKind>(callback: () => T): T {
return this.#speculationHelper(callback, /*isLookahead*/ false);
}

Expand Down

0 comments on commit b4a7ce5

Please sign in to comment.