Skip to content

Commit e1e91c6

Browse files
committed
Fix bugs where single quoted strings gets detected as incomplete string
1 parent a5a56db commit e1e91c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/rules/literal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Chapter, Context } from "../types";
77
export const literalRule = new class extends Rule<Literal> {
88
public process(child: Literal, parent: Node, context: Context, ast: AST): void {
99
if (typeof child.value === "string") {
10-
if (child.raw!.length < 2 || !child.raw!.endsWith("\""))
10+
if (child.raw!.length < 2 || !child.raw!.endsWith(child.raw!.charAt(0)))
1111
ast.addDiagnostic("Incomplete string expression", DiagnosticSeverity.Error, child.loc!);
1212
}
1313
if (child.value === null && context.chapter == Chapter.SOURCE_1)

0 commit comments

Comments
 (0)