Minor changes and fixes to add-new-language script

This commit is contained in:
Nilay Majorwar 2022-02-18 18:04:32 +05:30
parent 4fc94fd9ab
commit 5b5600f329
3 changed files with 6 additions and 8 deletions

View File

@ -76,8 +76,8 @@ const copyFile = (src, dest) => {
const dest = path.resolve(__dirname, `../pages/ide/${langId}.tsx`);
const contents = cropFirstLine(fs.readFileSync(src).toString());
const finalContents = contents
.replace("$LANG_ID", langId)
.replace("$LANG_NAME", langName);
.replace(/\$LANG_ID/g, langId)
.replace(/\$LANG_NAME/g, langName);
fs.writeFileSync(dest, finalContents);
}

View File

@ -7,11 +7,9 @@ export type RS = {
};
/** Sample program */
export const sampleProgram = [
"Program line 1",
"Program line 2",
"Program line 3",
].join("\n");
export const sampleProgram = `Program line 1
Program line 2
Program line 3`;
/** Syntax highlighting */
export const editorTokensProvider: MonacoTokensProvider = {

View File

@ -17,6 +17,6 @@ export default class XYZLanguageEngine implements LanguageEngine<RS> {
executeStep(): StepExecutionResult<RS> {
// TODO: Unimplemented
return { rendererState: { value: 0 }, nextStepLocation: { line: 0 } };
return { rendererState: { value: 0 }, nextStepLocation: { startLine: 0 } };
}
}