Skip to content

Commit

Permalink
Improve help message, target _blank, update lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
BalaM314 committed Dec 22, 2024
1 parent ee783d2 commit 7246e1c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/src/parser/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,16 @@ export const parseStatement = errorBoundary()(function _parseStatement(tokens:Ra
fail({
summary: `Expected a statement, not an expression`,
help: [
`for the language specification, see https://www.cambridgeinternational.org/Images/697401-2026-pseudocode-guide-for-teachers.pdf`,
`for a list of sample programs, see https://github.com/BalaM314/soodocode/tree/master/programs/programs`
{
text: `for the language specification, see https://www.cambridgeinternational.org/Images/697401-2026-pseudocode-guide-for-teachers.pdf`,
html: `for the language specification, <a href="https://www.cambridgeinternational.org/Images/697401-2026-pseudocode-guide-for-teachers.pdf">click here</a>`,
},{
text: `for a small example program, write \`OUTPUT "Hello, world!"\``,
html: `<span class="error-message-help-clickable" onclick='document.getElementById("soodocode-input").value = \`OUTPUT "Hello, world!"\`'>for a small example program, click here</span>`
},{
text: `for a list of sample programs, see https://github.com/BalaM314/soodocode/tree/master/programs/programs`,
html: `<span class="error-message-help-clickable" onclick='document.getElementById("sample-programs-dialog").showModal()'>for a list of sample programs, click here</span>`
}
],
}, tokens);
}
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export default tseslint.config(
"@typescript-eslint/no-duplicate-type-constituents": "off",
"@typescript-eslint/no-unsafe-function-type": "off",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-misused-promises": ["warn", {
checksVoidReturn: false,
}]
// "@typescript-eslint/no-redundant-type-constituents": "off",
// "@typescript-eslint/no-non-null-assertion": "off",
// "@typescript-eslint/no-inferrable-types": "off",
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<title>Soodocode Runtime</title>
<link rel="stylesheet" href="index.css">
<base target="_blank">
<script>
if(!Array.prototype.findLastIndex){
Array.prototype.findLastIndex = function(pred, thisArg){
Expand Down

0 comments on commit 7246e1c

Please sign in to comment.