mirror of
https://github.com/DaanVandenBosch/phantasmal-world.git
synced 2025-04-04 06:28:28 +08:00
Script editor now supports line comments.
This commit is contained in:
parent
269b9cbd25
commit
7cfcf5222c
@ -19,6 +19,8 @@ Features that are in ***bold italics*** are planned and not yet implemented.
|
||||
- Save as dialog to choose name
|
||||
- Support for .qst (BB, ***GC***, ***PC***, ***DC***)
|
||||
- ***Notify user when and why quest saving fails***
|
||||
- Custom text-based format
|
||||
- Usable with SCM tools
|
||||
|
||||
## Undo/Redo
|
||||
|
||||
@ -111,6 +113,7 @@ Features that are in ***bold italics*** are planned and not yet implemented.
|
||||
- ***Show instruction documentation on hover over***
|
||||
- ***Show reserved register usage on hover over***
|
||||
- ***When saving, ask user whether to really save when asm contains errors***
|
||||
- ***Theme selection***
|
||||
|
||||
## Enemy Waves
|
||||
|
||||
|
@ -143,6 +143,16 @@ export class AssemblyLexer {
|
||||
const char = this.peek();
|
||||
let token: Token;
|
||||
|
||||
if ("/" === char) {
|
||||
this.skip();
|
||||
|
||||
if ("/" === this.peek()) {
|
||||
break;
|
||||
} else {
|
||||
this.back();
|
||||
}
|
||||
}
|
||||
|
||||
if (/\s/.test(char)) {
|
||||
this.skip();
|
||||
continue;
|
||||
@ -380,8 +390,17 @@ export class AssemblyLexer {
|
||||
this.mark();
|
||||
|
||||
while (this.has_next()) {
|
||||
if (/[\s,]/.test(this.peek())) {
|
||||
const char = this.peek();
|
||||
|
||||
if (/[\s,]/.test(char)) {
|
||||
break;
|
||||
} else if ("/" === char) {
|
||||
this.skip();
|
||||
|
||||
if (this.peek() === "/") {
|
||||
this.back();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
this.skip();
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ const ASM_SYNTAX: languages.IMonarchLanguage = {
|
||||
// Whitespace.
|
||||
[/[ \t\r\n]+/, "white"],
|
||||
// [/\/\*/, "comment", "@comment"],
|
||||
// [/\/\/.*$/, "comment"],
|
||||
[/\/\/.*$/, "comment"],
|
||||
|
||||
// Delimiters.
|
||||
[/,/, "delimiter"],
|
||||
@ -113,6 +113,9 @@ languages.setLanguageConfiguration("psoasm", {
|
||||
},
|
||||
autoClosingPairs: [{ open: '"', close: '"' }],
|
||||
surroundingPairs: [{ open: '"', close: '"' }],
|
||||
comments: {
|
||||
lineComment: "//",
|
||||
},
|
||||
});
|
||||
|
||||
editor.defineTheme("phantasmal-world", {
|
||||
|
Loading…
Reference in New Issue
Block a user