Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/source-academy/modules in…
Browse files Browse the repository at this point in the history
…to misc-20240522
  • Loading branch information
RichDom2185 committed Jul 18, 2024
2 parents b9b7cba + d6baa34 commit b70eb1e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
10 changes: 10 additions & 0 deletions src/bundles/repl/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ export function set_font_size(font_size_px: number) {
INSTANCE.customizedEditorProps.fontSize = parseInt(font_size_px.toString());// The TypeScript type checker will throw an error as "parseInt" in TypeScript only accepts one string as parameter.
}

/**
* Set program text in the Repl editor to the given string
* @param {text} string
*
* @category Main
*/
export function set_program_text(text: string) {
INSTANCE.updateUserCode(text);
}

/**
* When use this function as the entrance function in the parameter of "set_evaluator", the Programmable Repl will directly use the default js-slang interpreter to run your program in Programmable Repl editor. Do not directly call this function in your own code.
* @param {program} Do not directly set this parameter in your code.
Expand Down
1 change: 1 addition & 0 deletions src/bundles/repl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ export {
repl_display,
set_background_image,
set_font_size,
set_program_text,
default_js_slang
} from './functions';
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7106,14 +7106,14 @@ write@^1.0.0:
mkdirp "^0.5.1"

ws@^7.5.5:
version "7.5.9"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591"
integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==
version "7.5.10"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9"
integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==

ws@^8.11.0:
version "8.12.1"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.12.1.tgz#c51e583d79140b5e42e39be48c934131942d4a8f"
integrity sha512-1qo+M9Ba+xNhPB+YTWUlK6M17brTut5EXbcBaMRN5pH5dFrXz7lzz1ChFSUq3bOUl8yEvSenhHmYUNJxFzdJew==
version "8.17.1"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b"
integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==

xml-name-validator@^4.0.0:
version "4.0.0"
Expand Down

0 comments on commit b70eb1e

Please sign in to comment.