|
@@ -96,7 +96,7 @@ class GDScriptDiagnosticSeverity {
|
|
diagnostics.push(new vscode.Diagnostic(new vscode.Range(i, semicolonIndex, i, semicolonIndex+1), "Statement contains a semicolon.", DiagnosticSeverity.Warning));
|
|
diagnostics.push(new vscode.Diagnostic(new vscode.Range(i, semicolonIndex, i, semicolonIndex+1), "Statement contains a semicolon.", DiagnosticSeverity.Warning));
|
|
} if (line.match(/[^#].*?/) && expectEndOfLine){
|
|
} if (line.match(/[^#].*?/) && expectEndOfLine){
|
|
if(!line.match(/.*?(\\|\:)/)){
|
|
if(!line.match(/.*?(\\|\:)/)){
|
|
- diagnostics.push(new vscode.Diagnostic(range, "': or /' expected at end of the line.", DiagnosticSeverity.Error));
|
|
|
|
|
|
+ diagnostics.push(new vscode.Diagnostic(range, "': or \\' expected at end of the line.", DiagnosticSeverity.Error));
|
|
expectEndOfLine = false;
|
|
expectEndOfLine = false;
|
|
}
|
|
}
|
|
if(line.match(/.*?\:/))
|
|
if(line.match(/.*?\:/))
|
|
@@ -106,7 +106,7 @@ class GDScriptDiagnosticSeverity {
|
|
if(line.match(/(if|elif|else|for|while|func|class).*?\\/))
|
|
if(line.match(/(if|elif|else|for|while|func|class).*?\\/))
|
|
expectEndOfLine = true;
|
|
expectEndOfLine = true;
|
|
if(line.match(/(if|elif|else|for|while|func|class).*?/) && !line.match(/.*?(\\|\:)/))
|
|
if(line.match(/(if|elif|else|for|while|func|class).*?/) && !line.match(/.*?(\\|\:)/))
|
|
- diagnostics.push(new vscode.Diagnostic(range, "': or /' expected at end of the line.", DiagnosticSeverity.Error));
|
|
|
|
|
|
+ diagnostics.push(new vscode.Diagnostic(range, "': or \\' expected at end of the line.", DiagnosticSeverity.Error));
|
|
else if(line.match(/(if|elif|while|func|class)\s*\:/))
|
|
else if(line.match(/(if|elif|while|func|class)\s*\:/))
|
|
diagnostics.push(new vscode.Diagnostic(range, "Indentifier expected before ':'", DiagnosticSeverity.Error));
|
|
diagnostics.push(new vscode.Diagnostic(range, "Indentifier expected before ':'", DiagnosticSeverity.Error));
|
|
else if(line.match(/[^\w]for[^\w]/) && !line.match(/\s+for\s\w+\s+in\s+[\w+]|\{.*?\}|\[.*?\]/))
|
|
else if(line.match(/[^\w]for[^\w]/) && !line.match(/\s+for\s\w+\s+in\s+[\w+]|\{.*?\}|\[.*?\]/))
|