Skip to content

Commit 1bf9299

Browse files
committed
v2.8.1
1 parent 920f55f commit 1bf9299

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "AutoHotkey v2 Language Support, based on vscode-lsp.",
55
"author": "thqby",
66
"publisher": "thqby",
7-
"version": "2.8.0",
7+
"version": "2.8.1",
88
"license": "LGPLv3.0",
99
"categories": [
1010
"Formatters",

server/src/lexer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ export interface Token {
256256
symbol?: AhkSymbol
257257
topofline: number
258258
type: TokenType
259+
unexpected_lf?: boolean
259260
}
260261

261262
export enum USAGE { Read, Write }
@@ -1289,7 +1290,7 @@ export class Lexer {
12891290
}
12901291

12911292
function unexpected_lf(tk: Token) {
1292-
_this.addDiagnostic(diagnostic.unexpected('`n'), input.lastIndexOf('\n', tk.offset), 1);
1293+
tk.unexpected_lf ??= (_this.addDiagnostic(diagnostic.unexpected('`n'), input.lastIndexOf('\n', tk.offset), 1), true);
12931294
}
12941295

12951296
function parse_unresolved_typedef() {
@@ -2733,6 +2734,8 @@ export class Lexer {
27332734
else delete t.body_start;
27342735
line_end_token = tk.previous_token;
27352736
next = tk.type === TokenType.Reserved && tk.content.toLowerCase() === 'else';
2737+
if (e.type === TokenType.Reserved && t === tk)
2738+
unexpected(tk);
27362739
}
27372740
in_loop = oil, mode = prev;
27382741
if (typeof else_body === 'boolean') {

0 commit comments

Comments
 (0)