├── .gitignore ├── .vscode ├── launch.json └── tasks.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── emuera ├── exmeth.erb └── exvar.erh ├── images └── screenshot.png ├── language-configuration.json ├── package-lock.json ├── package.json ├── snippets └── erabasic.json ├── src ├── completion.ts ├── declaration.ts ├── definition.ts ├── extension.ts └── symbol.ts ├── syntaxes └── erabasic.tmLanguage.json ├── tsconfig.json └── tslint.json /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | out 3 | node_modules 4 | .vscode-test/ 5 | *.vsix 6 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [{ 8 | "name": "Run Extension", 9 | "type": "extensionHost", 10 | "request": "launch", 11 | "runtimeExecutable": "${execPath}", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ], 15 | "outFiles": [ 16 | "${workspaceFolder}/out/**/*.js" 17 | ], 18 | "preLaunchTask": "npm: watch" 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to the "erabasic" extension will be documented in this file. 3 | 4 | ## [0.4.0] - 2020-06-06 5 | ### Added 6 | - Simple Code Completion: L10N に対応 7 | - Go to Definition/Symbols: UTF-8, UTF-16 の BOM 判定を追加 8 | - Go to Definition/Symbols: 組み込みの変数と式中関数を追加 9 | 10 | ## [0.3.0] - 2020-05-12 11 | ### Added 12 | - Emuera v1.824 までの追加命令/関数に対応 13 | 14 | ## [0.2.0] - 2017-11-12 15 | ### Added 16 | - Multi-root Workspaces に対応 17 | - Go to Definition に対応 18 | - Go to Symbols の候補に #DEFINE を追加 19 | 20 | ## [0.1.1] - 2017-11-05 21 | ### Changed 22 | - Go to Symbols in Workspace: files.encoding を即時反映するように変更 23 | 24 | ### Fixed 25 | - Go to Symbols in Workspace: files.encoding に utf8bom を指定すると動作しないのを修正 26 | - Go to Symbols in Workspace: 編集中のドキュメントが反映されないのを修正 27 | 28 | ## [0.1.0] - 2017-10-21 29 | ### Added 30 | - Snippets に制御文を追加 31 | - Code Completion (固定) に対応 32 | - Go to Symbols in File/Workspace に対応 33 | 34 | ## [0.0.4] - 2017-10-15 35 | ### Changed 36 | - 制御文と命令文の分類を再度見直し。「サクラエディタ設定ファイル」に合わせる 37 | 38 | ## [0.0.3] - 2017-10-15 39 | ### Added 40 | - 変数宣言のキーワードに対応 41 | 42 | ### Changed 43 | - 識別子の判定を Emuera に準拠 44 | - 制御文と命令文の分類を見直し 45 | 46 | ## [0.0.2] - 2017-10-01 47 | ### Fixed 48 | - eramaker 由来の命令が抜けていたのを修正 49 | - 命令形式の式中関数が抜けていたのを修正 50 | - THROW 命令の引数の解釈が間違っていたのを修正 51 | 52 | ## [0.0.1] - 2017-09-30 53 | - Initial release 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 sasami 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EraBasic 2 | Language Support for EraBasic. 3 | 4 | ![Screenshot](images/screenshot.png) 5 | 6 | ## Features 7 | - Syntax Highlighting 8 | - Snippets 9 | - Simple Code Completion 10 | - Go to Definition 11 | - Go to Symbols in File/Workspace 12 | -------------------------------------------------------------------------------- /emuera/exmeth.erb: -------------------------------------------------------------------------------- 1 | ; Note: These declarations are pseudo-EraBasic for illustrative purposes. 2 | 3 | @GETCHARA(CHARA_NO) 4 | ; BUILTIN FUNCTION 5 | #DIM CHARA_NO 6 | #DIM INDEX 7 | ; ... 8 | RETURN INDEX 9 | 10 | @FINDCHARA(CHARA_VAR, VALUE, START = 0, END = CHARANUM) 11 | ; BUILTIN FUNCTION 12 | #DIM REF CHARA_VAR ; or #DIMS REF CHARA_VAR 13 | #DIM VALUE ; or #DIMS VALUE 14 | #DIM START 15 | #DIM END 16 | #DIM INDEX 17 | ; ... 18 | RETURN INDEX 19 | 20 | @FINDLASTCHARA(CHARA_VAR, VALUE, START = 0, END = CHARANUM) 21 | ; BUILTIN FUNCTION 22 | #DIM REF CHARA_VAR ; or #DIMS REF CHARA_VAR 23 | #DIM VALUE ; or #DIMS VALUE 24 | #DIM START 25 | #DIM END 26 | #DIM INDEX 27 | ; ... 28 | RETURN INDEX 29 | 30 | @CSVNAME(CHARA_NO) 31 | ; BUILTIN FUNCTIONS 32 | #DIM CHARA_NO 33 | #DIMS VALUE 34 | ; ... 35 | RETURN VALUE 36 | 37 | @CSVCALLNAME(CHARA_NO) 38 | ; BUILTIN FUNCTIONS 39 | #DIM CHARA_NO 40 | #DIMS VALUE 41 | ; ... 42 | RETURN VALUE 43 | 44 | @CSVNICKNAME(CHARA_NO) 45 | ; BUILTIN FUNCTIONS 46 | #DIM CHARA_NO 47 | #DIMS VALUE 48 | ; ... 49 | RETURN VALUE 50 | 51 | @CSVMASTERNAME(CHARA_NO) 52 | ; BUILTIN FUNCTIONS 53 | #DIM CHARA_NO 54 | #DIMS VALUE 55 | ; ... 56 | RETURN VALUE 57 | 58 | @CSVCSTR(CHARA_NO, INDEX) 59 | ; BUILTIN FUNCTIONS 60 | #DIM CHARA_NO 61 | #DIM INDEX 62 | #DIMS VALUE 63 | ; ... 64 | RETURN VALUE 65 | 66 | @CSVBASE(CHARA_NO, INDEX) 67 | ; BUILTIN FUNCTION 68 | #DIM CHARA_NO 69 | #DIM INDEX 70 | #DIM VALUE 71 | ; ... 72 | RETURN VALUE 73 | 74 | @CSVABL(CHARA_NO, INDEX) 75 | ; BUILTIN FUNCTION 76 | #DIM CHARA_NO 77 | #DIM INDEX 78 | #DIM VALUE 79 | ; ... 80 | RETURN VALUE 81 | 82 | @CSVTALENT(CHARA_NO, INDEX) 83 | ; BUILTIN FUNCTION 84 | #DIM CHARA_NO 85 | #DIM INDEX 86 | #DIM VALUE 87 | ; ... 88 | RETURN VALUE 89 | 90 | @CSVMARK(CHARA_NO, INDEX) 91 | ; BUILTIN FUNCTION 92 | #DIM CHARA_NO 93 | #DIM INDEX 94 | #DIM VALUE 95 | ; ... 96 | RETURN VALUE 97 | 98 | @CSVEXP(CHARA_NO, INDEX) 99 | ; BUILTIN FUNCTION 100 | #DIM CHARA_NO 101 | #DIM INDEX 102 | #DIM VALUE 103 | ; ... 104 | RETURN VALUE 105 | 106 | @CSVRELATION(CHARA_NO, INDEX) 107 | ; BUILTIN FUNCTION 108 | #DIM CHARA_NO 109 | #DIM INDEX 110 | #DIM VALUE 111 | ; ... 112 | RETURN VALUE 113 | 114 | @CSVJUEL(CHARA_NO, INDEX) 115 | ; BUILTIN FUNCTION 116 | #DIM CHARA_NO 117 | #DIM INDEX 118 | #DIM VALUE 119 | ; ... 120 | RETURN VALUE 121 | 122 | @CSVEQUIP(CHARA_NO, INDEX) 123 | ; BUILTIN FUNCTION 124 | #DIM CHARA_NO 125 | #DIM INDEX 126 | #DIM VALUE 127 | ; ... 128 | RETURN VALUE 129 | 130 | @CSVCFLAG(CHARA_NO, INDEX) 131 | ; BUILTIN FUNCTION 132 | #DIM CHARA_NO 133 | #DIM INDEX 134 | #DIM VALUE 135 | ; ... 136 | RETURN VALUE 137 | 138 | @EXISTCSV(CHARA_NO) 139 | ; BUILTIN FUNCTION 140 | #DIM CHARA_NO 141 | #DIM BOOL 142 | ; ... 143 | RETURN BOOL 144 | 145 | @GETNUM(CSV_VAR, LABEL) 146 | ; BUILTIN FUNCTION 147 | #DIM REF CSV_VAR ; or #DIMS REF CSV_VAR 148 | #DIMS LABEL 149 | #DIM INDEX 150 | ; ... 151 | RETURN INDEX 152 | 153 | @STRLENS(TEXT) 154 | ; BUILTIN FUNCTION 155 | #DIMS TEXT 156 | #DIM LEN 157 | ; ... 158 | RETURN LEN 159 | 160 | @STRLENSU(TEXT) 161 | ; BUILTIN FUNCTION 162 | #DIMS TEXT 163 | #DIM LEN 164 | ; ... 165 | RETURN LEN 166 | 167 | @SUBSTRING(TEXT, START = 0, LEN = -1) 168 | ; BUILTIN FUNCTIONS 169 | #DIMS TEXT 170 | #DIM START 171 | #DIM LEN 172 | #DIMS SUB 173 | ; ... 174 | RETURN SUB 175 | 176 | @SUBSTRINGU(TEXT, START = 0, LEN = -1) 177 | ; BUILTIN FUNCTIONS 178 | #DIMS TEXT 179 | #DIM START 180 | #DIM LEN 181 | #DIMS SUB 182 | ; ... 183 | RETURN SUB 184 | 185 | @CHARATU(TEXT, POS = 0) 186 | ; BUILTIN FUNCTIONS 187 | #DIMS TEXT 188 | #DIM POS 189 | #DIMS CHAR 190 | ; ... 191 | RETURN CHAR 192 | 193 | @STRFIND(TEXT, SUB, START = 0) 194 | ; BUILTIN FUNCTION 195 | #DIMS TEXT 196 | #DIMS SUB 197 | #DIM POS 198 | ; ... 199 | RETURN POS 200 | 201 | @STRFINDU(TEXT, SUB, START = 0) 202 | ; BUILTIN FUNCTION 203 | #DIMS TEXT 204 | #DIMS SUB 205 | #DIM POS 206 | ; ... 207 | RETURN POS 208 | 209 | @STRCOUNT(TEXT, WORD) 210 | ; BUILTIN FUNCTION 211 | #DIMS TEXT 212 | #DIMS WORD ; regexp 213 | #DIM COUNT 214 | ; ... 215 | RETURN COUNT 216 | 217 | @UNICODE(CODEPOINT) 218 | ; BUILTIN FUNCTIONS 219 | #DIM CODEPOINT 220 | #DIMS CHAR 221 | ; ... 222 | RETURN CHAR 223 | 224 | @ENCODETOUNI(TEXT, POS = 0) 225 | ; BUILTIN FUNCTION 226 | #DIMS TEXT 227 | #DIM POS 228 | #DIM CODEPOINT 229 | ; ... 230 | RETURN CODEPOINT 231 | 232 | @REPLACE(TEXT, OLD, NEW) 233 | ; BUILTIN FUNCTIONS 234 | #DIMS TEXT 235 | #DIMS OLD ; regexp 236 | #DIMS NEW 237 | #DIMS NTEXT 238 | ; ... 239 | RETURN NTEXT 240 | 241 | @ESCAPE(TEXT) 242 | ; BUILTIN FUNCTIONS 243 | #DIMS TEXT 244 | #DIMS NTEXT 245 | ; ... 246 | RETURN NTEXT 247 | 248 | @VARSIZE(VARNAME, DIMENSION = 0) 249 | ; BUILTIN FUNCTION 250 | #DIMS VARNAME 251 | #DIM DIMENSION 252 | #DIM SIZE 253 | ; ... 254 | RETURN SIZE 255 | 256 | @GETTIME() 257 | ; BUILTIN FUNCTION 258 | #DIM DATETIME 259 | ; ... 260 | RETURN DATETIME 261 | 262 | @GETTIMES() 263 | ; BUILTIN FUNCTIONS 264 | #DIMS DATETIME 265 | ; ... 266 | RETURN DATETIME 267 | 268 | @GETMILLISECOND() 269 | ; BUILTIN FUNCTION 270 | #DIM ELAPSED 271 | ; ... 272 | RETURN ELAPSED 273 | 274 | @GETSECOND() 275 | ; BUILTIN FUNCTION 276 | #DIM ELAPSED 277 | ; ... 278 | RETURN ELAPSED 279 | 280 | @CHKFONT(FONTNAME) 281 | ; BUILTIN FUNCTION 282 | #DIMS FONTNAME 283 | #DIM EXISTS 284 | ; ... 285 | RETURN EXISTS 286 | 287 | @POWER(BASE_, EXP_) 288 | ; BUILTIN FUNCTION 289 | #DIM BASE_ 290 | #DIM EXP_ 291 | #DIM RET 292 | ; ... 293 | RETURN RET 294 | 295 | @RAND(MIN_ = 0, MAX_) 296 | ; BUILTIN FUNCTION 297 | #DIM MIN_ 298 | #DIM MAX_ 299 | #DIM RET 300 | ; ... 301 | RETURN RET 302 | 303 | @ABS(NUM) 304 | ; BUILTIN FUNCTION 305 | #DIM NUM 306 | #DIM RET 307 | ; ... 308 | RETURN RET 309 | 310 | @SIGN(NUM) 311 | ; BUILTIN FUNCTION 312 | #DIM NUM 313 | #DIM RET 314 | ; ... 315 | RETURN RET 316 | 317 | @MAX(NUM1, NUM2, ...) 318 | ; BUILTIN FUNCTION 319 | #DIM NUM1 320 | #DIM NUM2 321 | #DIM RET 322 | ; ... 323 | RETURN RET 324 | 325 | @MIN(NUM1, NUM2, ...) 326 | ; BUILTIN FUNCTION 327 | #DIM NUM1 328 | #DIM NUM2 329 | #DIM RET 330 | ; ... 331 | RETURN RET 332 | 333 | @LIMIT(NUM, MIN_, MAX_) 334 | ; BUILTIN FUNCTION 335 | #DIM NUM 336 | #DIM MIN_ 337 | #DIM MAX_ 338 | #DIM RET 339 | ; ... 340 | RETURN RET 341 | 342 | @INRANGE(NUM, MIN_, MAX_) 343 | ; BUILTIN FUNCTION 344 | #DIM NUM 345 | #DIM MIN_ 346 | #DIM MAX_ 347 | #DIM BOOL 348 | ; ... 349 | RETURN BOOL 350 | 351 | @SQRT(NUM) 352 | ; BUILTIN FUNCTION 353 | #DIM NUM 354 | #DIM RET 355 | ; ... 356 | RETURN RET 357 | 358 | @GETBIT(NUM, BIT) 359 | ; BUILTIN FUNCTION 360 | #DIM NUM 361 | #DIM BIT 362 | #DIM RET 363 | ; ... 364 | RETURN RET 365 | 366 | @CBRT(NUM) 367 | ; BUILTIN FUNCTION 368 | #DIM NUM 369 | #DIM RET 370 | ; ... 371 | RETURN RET 372 | 373 | @LOG(NUM) 374 | ; BUILTIN FUNCTION 375 | #DIM NUM 376 | #DIM RET 377 | ; ... 378 | RETURN RET 379 | 380 | @LOG10(NUM) 381 | ; BUILTIN FUNCTION 382 | #DIM NUM 383 | #DIM RET 384 | ; ... 385 | RETURN RET 386 | 387 | @EXPONENT(NUM) 388 | ; BUILTIN FUNCTION 389 | #DIM NUM 390 | #DIM RET 391 | ; ... 392 | RETURN RET 393 | 394 | @GETFONT() 395 | ; BUILTIN FUNCTIONS 396 | #DIMS FONTNAME 397 | ; ... 398 | RETURN FONTNAME 399 | 400 | @GETCOLOR() 401 | ; BUILTIN FUNCTION 402 | #DIM RGB 403 | ; ... 404 | RETURN RGB 405 | 406 | @GETDEFCOLOR() 407 | ; BUILTIN FUNCTION 408 | #DIM RGB 409 | ; ... 410 | RETURN RGB 411 | 412 | @GETBGCOLOR() 413 | ; BUILTIN FUNCTION 414 | #DIM RGB 415 | ; ... 416 | RETURN RGB 417 | 418 | @GETDEFBGCOLOR() 419 | ; BUILTIN FUNCTION 420 | #DIM RGB 421 | ; ... 422 | RETURN RGB 423 | 424 | @GETFOCUSCOLOR() 425 | ; BUILTIN FUNCTION 426 | #DIM RGB 427 | ; ... 428 | RETURN RGB 429 | 430 | @GETSTYLE() 431 | ; BUILTIN FUNCTION 432 | #DIM FONTSTYLE 433 | ; ... 434 | RETURN FONTSTYLE 435 | 436 | @CURRENTALIGN() 437 | ; BUILTIN FUNCTIONS 438 | #DIMS ALIGN 439 | ; ... 440 | RETURN ALIGN 441 | 442 | @CURRENTREDRAW() 443 | ; BUILTIN FUNCTION 444 | #DIM ACTIVE 445 | ; ... 446 | RETURN ACTIVE 447 | 448 | @TOSTR(NUM, FORMAT = "") 449 | ; BUILTIN FUNCTIONS 450 | #DIM NUM 451 | #DIMS FORMAT 452 | #DIMS TEXT 453 | ; ... 454 | RETURN TEXT 455 | 456 | @GETPALAMLV(VALUE, MAX_LV) 457 | ; BUILTIN FUNCTION 458 | #DIM VALUE 459 | #DIM MAX_LV 460 | #DIM CUR_LV 461 | ; ... 462 | RETURN CUR_LV 463 | 464 | @GETEXPLV(VALUE, MAX_LV) 465 | ; BUILTIN FUNCTION 466 | #DIM VALUE 467 | #DIM MAX_LV 468 | #DIM CUR_LV 469 | ; ... 470 | RETURN CUR_LV 471 | 472 | @TOUPPER(TEXT) 473 | ; BUILTIN FUNCTIONS 474 | #DIMS TEXT 475 | #DIMS NTEXT 476 | ; ... 477 | RETURN NTEXT 478 | 479 | @TOLOWER(TEXT) 480 | ; BUILTIN FUNCTION 481 | #DIMS TEXT 482 | #DIMS NTEXT 483 | ; ... 484 | RETURN NTEXT 485 | 486 | @TOHALF(TEXT) 487 | ; BUILTIN FUNCTION 488 | #DIMS TEXT 489 | #DIMS NTEXT 490 | ; ... 491 | RETURN NTEXT 492 | 493 | @TOFULL(TEXT) 494 | ; BUILTIN FUNCTION 495 | #DIMS TEXT 496 | #DIMS NTEXT 497 | ; ... 498 | RETURN NTEXT 499 | 500 | @SUMARRAY(ARRAY, START = 0, END = *) 501 | ; BUILTIN FUNCTION 502 | #DIM REF ARRAY 503 | #DIM START 504 | #DIM END 505 | #DIM RET 506 | ; ... 507 | RETURN RET 508 | 509 | @MATCH(ARRAY, VALUE, START = 0, END = *) 510 | ; BUILTIN FUNCTION 511 | #DIM REF ARRAY ; or #DIMS REF ARRAY 512 | #DIM VALUE ; or #DIMS VALUE 513 | #DIM START 514 | #DIM END 515 | #DIM COUNT 516 | ; ... 517 | RETURN COUNT 518 | 519 | @MAXARRAY(ARRAY, START = 0, END = *) 520 | ; BUILTIN FUNCTION 521 | #DIM REF ARRAY 522 | #DIM START 523 | #DIM END 524 | #DIM VALUE 525 | ; ... 526 | RETURN VALUE 527 | 528 | @MINARRAY(ARRAY, START = 0, END = *) 529 | ; BUILTIN FUNCTION 530 | #DIM REF ARRAY 531 | #DIM START 532 | #DIM END 533 | #DIM VALUE 534 | ; ... 535 | RETURN VALUE 536 | 537 | @SUMCARRAY(CHARA_ARR, START = 0, END = CHARANUM) 538 | ; BUILTIN FUNCTION 539 | #DIM REF CHARA_ARR 540 | #DIM START 541 | #DIM END 542 | #DIM RET 543 | ; ... 544 | RETURN RET 545 | 546 | @CMATCH(CHARA_ARR, VALUE, START = 0, END = CHARANUM) 547 | ; BUILTIN FUNCTION 548 | #DIM REF CHARA_ARR ; or #DIMS REF CHARA_ARR 549 | #DIM VALUE ; or #DIMS VALUE 550 | #DIM START 551 | #DIM END 552 | #DIM COUNT 553 | ; ... 554 | RETURN COUNT 555 | 556 | @MAXCARRAY(CHARA_ARR, START = 0, END = CHARANUM) 557 | ; BUILTIN FUNCTION 558 | #DIM REF CHARA_ARR 559 | #DIM START 560 | #DIM END 561 | #DIM VALUE 562 | ; ... 563 | RETURN VALUE 564 | 565 | @MINCARRAY(CHARA_ARR, START = 0, END = CHARANUM) 566 | ; BUILTIN FUNCTION 567 | #DIM REF CHARA_ARR 568 | #DIM START 569 | #DIM END 570 | #DIM VALUE 571 | ; ... 572 | RETURN VALUE 573 | 574 | @ISNUMERIC(TEXT) 575 | ; BUILTIN FUNCTION 576 | #DIMS TEXT 577 | #DIM BOOL 578 | ; ... 579 | RETURN BOOL 580 | 581 | @TOINT(TEXT) 582 | ; BUILTIN FUNCTION 583 | #DIMS TEXT 584 | #DIM NUM 585 | ; ... 586 | RETURN NUM 587 | 588 | @CHKDATA(SAVE_NO) 589 | ; BUILTIN FUNCTION 590 | #DIM SAVE_NO 591 | #DIM ERR 592 | ; ... 593 | RETURN ERR 594 | 595 | @CHKCHARADATA(FILENAME) 596 | ; BUILTIN FUNCTION 597 | #DIMS FILENAME 598 | #DIM ERR 599 | ; ... 600 | RETURN ERR 601 | 602 | @FIND_CHARADATA(FILENAME) 603 | ; BUILTIN FUNCTION 604 | #DIMS FILENAME ; glob 605 | #DIM COUNT 606 | ; ... 607 | RETURN COUNT 608 | 609 | @SAVENOS() 610 | ; BUILTIN FUNCTION 611 | #DIM VALUE 612 | ; ... 613 | RETURN VALUE 614 | 615 | @PRINTCPERLINE() 616 | ; BUILTIN FUNCTION 617 | #DIM VALUE 618 | ; ... 619 | RETURN VALUE 620 | 621 | @LINEISEMPTY() 622 | ; BUILTIN FUNCTION 623 | #DIM BOOL 624 | ; ... 625 | RETURN BOOL 626 | 627 | @GROUPMATCH(SAMPLE, VALUE1, VALUE2, ...) 628 | ; BUILTIN FUNCTION 629 | #DIM SAMPLE ; or #DIMS SAMPLE 630 | #DIM VALUE1 ; or #DIMS VALUE1 631 | #DIM VALUE2 ; or #DIMS VALUE2 632 | #DIM COUNT 633 | ; ... 634 | RETURN COUNT 635 | 636 | @NOSAMES(VALUE1, VALUE2, ...) 637 | ; BUILTIN FUNCTION 638 | #DIM VALUE1 ; or #DIMS VALUE1 639 | #DIM VALUE2 ; or #DIMS VALUE2 640 | #DIM BOOL 641 | ; ... 642 | RETURN BOOL 643 | 644 | @ALLSAMES(VALUE1, VALUE2, ...) 645 | ; BUILTIN FUNCTION 646 | #DIM VALUE1 ; or #DIMS VALUE1 647 | #DIM VALUE2 ; or #DIMS VALUE2 648 | #DIM BOOL 649 | ; ... 650 | RETURN BOOL 651 | 652 | @ISSKIP() 653 | ; BUILTIN FUNCTION 654 | #DIM BOOL 655 | ; ... 656 | RETURN BOOL 657 | 658 | ; Deprecated in Emuera 1.810 659 | @MOUSESKIP() 660 | ; BUILTIN FUNCTION 661 | #DIM BOOL 662 | ; ... 663 | RETURN BOOL 664 | 665 | @MESSKIP() 666 | ; BUILTIN FUNCTION 667 | #DIM BOOL 668 | ; ... 669 | RETURN BOOL 670 | 671 | @CONVERT(NUM, BASE_) 672 | ; BUILTIN FUNCTIONS 673 | #DIM NUM 674 | #DIM BASE_ 675 | #DIMS HEXSTR 676 | ; ... 677 | RETURN HEXSTR 678 | 679 | @MONEYSTR(NUM, CURRENCY = "") 680 | ; BUILTIN FUNCTIONS 681 | #DIM NUM 682 | #DIMS CURRENCY 683 | #DIMS TEXT 684 | ; ... 685 | RETURN TEXT 686 | 687 | @FINDELEMENT(ARRAY, VALUE, START = 0, END = *, FLAG) 688 | ; BUILTIN FUNCTION 689 | #DIM REF ARRAY ; or #DIMS REF ARRAY 690 | #DIM VALUE ; or #DIMS VALUE 691 | #DIM START 692 | #DIM END 693 | #DIM FLAG ; only when #DIMS REF ARRAY 694 | #DIM INDEX 695 | ; ... 696 | RETURN INDEX 697 | 698 | @FINDLASTELEMENT(ARRAY, VALUE, START = 0, END = *, FLAG) 699 | ; BUILTIN FUNCTION 700 | #DIM REF ARRAY ; or #DIMS REF ARRAY 701 | #DIM VALUE ; or #DIMS VALUE 702 | #DIM START 703 | #DIM END 704 | #DIM FLAG ; only when #DIMS REF ARRAY 705 | #DIM INDEX 706 | ; ... 707 | RETURN INDEX 708 | 709 | @BARSTR(TEXT, MAX_, LEN) 710 | ; BUILTIN FUNCTIONS 711 | #DIMS TEXT 712 | #DIM MAX_ 713 | #DIM LEN 714 | #DIMS NTEXT 715 | ; ... 716 | RETURN NTEXT 717 | 718 | @COLOR_FROMNAME(COLORNAME) 719 | ; BUILTIN FUNCTION 720 | #DIMS COLORNAME 721 | #DIM RGB 722 | ; ... 723 | RETURN RGB 724 | 725 | @COLOR_FROMRGB(R_, G_, B_) 726 | ; BUILTIN FUNCTION 727 | #DIM R_ 728 | #DIM G_ 729 | #DIM B_ 730 | #DIM RGB 731 | ; ... 732 | RETURN RGB 733 | 734 | @INRANGEARRAY(ARRAY, MIN_, MAX_, START = 0, END = *) 735 | ; BUILTIN FUNCTION 736 | #DIM REF ARRAY 737 | #DIM MIN_ 738 | #DIM MAX_ 739 | #DIM START 740 | #DIM END 741 | #DIM COUNT 742 | ; ... 743 | RETURN COUNT 744 | 745 | @INRANGECARRAY(CHARA_ARR, MIN_, MAX_, START = 0, END = CHARANUM) 746 | ; BUILTIN FUNCTION 747 | #DIM REF CHARA_ARR 748 | #DIM MIN_ 749 | #DIM MAX_ 750 | #DIM START 751 | #DIM END 752 | #DIM COUNT 753 | ; ... 754 | RETURN COUNT 755 | 756 | @ARRAYMSORT(ARRAY, ...) 757 | ; BUILTIN FUNCTION 758 | #DIM REF ARRAY 759 | #DIM SUCCESS 760 | ; ... 761 | RETURN SUCCESS 762 | 763 | @GETLINESTR(TEXT) 764 | ; BUILTIN FUNCTIONS 765 | #DIMS TEXT 766 | #DIMS NTEXT 767 | ; ... 768 | RETURN NTEXT 769 | 770 | @PRINTCLENGTH() 771 | ; BUILTIN FUNCTION 772 | #DIM VALUE 773 | ; ... 774 | RETURN VALUE 775 | 776 | @STRFORM(TEXT) 777 | ; BUILTIN FUNCTIONS 778 | #DIMS TEXT 779 | #DIMS NTEXT 780 | ; ... 781 | RETURN NTEXT 782 | 783 | @STRJOIN(ARRAY, SEP = ",", START = 0, LEN = *) 784 | ; BUILTIN FUNCTIONS 785 | #DIMS REF ARRAY 786 | #DIMS SEP 787 | #DIM START 788 | #DIM LEN 789 | #DIMS TEXT 790 | ; ... 791 | RETURN TEXT 792 | 793 | @GETCONFIG(CONFNAME) 794 | ; BUILTIN FUNCTION 795 | #DIMS CANFNAME 796 | #DIM VALUE 797 | ; ... 798 | RETURN VALUE 799 | 800 | @GETCONFIGS(CONFNAME) 801 | ; BUILTIN FUNCTIONS 802 | #DIMS CANFNAME 803 | #DIMS VALUE 804 | ; ... 805 | RETURN VALUE 806 | 807 | @HTML_POPPRINTINGSTR() 808 | ; BUILTIN FUNCTIONS 809 | #DIMS HTML 810 | ; ... 811 | RETURN HTML 812 | 813 | @HTML_GETPRINTEDSTR(LINE_NO) 814 | ; BUILTIN FUNCTIONS 815 | #DIM LINE_NO 816 | #DIMS HTML 817 | ; ... 818 | RETURN HTML 819 | 820 | @HTML_ESCAPE(TEXT) 821 | ; BUILTIN FUNCTIONS 822 | #DIMS TEXT 823 | #DIMS HTML 824 | ; ... 825 | RETURN HTML 826 | 827 | @HTML_TOPLAINTEXT(HTML) 828 | ; BUILTIN FUNCTIONS 829 | #DIMS HTML 830 | #DIMS TEXT 831 | ; ... 832 | RETURN TEXT 833 | 834 | @SAVETEXT(TEXT, FILE_NO, FORCE_SAVEDIR = 0, FORCE_UTF8 = 0) 835 | ; BUILTIN FUNCTION 836 | #DIMS TEXT 837 | #DIM FILE_NO 838 | #DIM FORCE_SAVEDIR 839 | #DIM FORCE_UTF8 840 | #DIM SUCCESS 841 | ; ... 842 | RETURN SUCCESS 843 | 844 | @LOADTEXT(FILE_NO, FORCE_SAVEDIR = 0, FORCE_UTF8 = 0) 845 | ; BUILTIN FUNCTIONS 846 | #DIM FILE_NO 847 | #DIM FORCE_SAVEDIR 848 | #DIM FORCE_UTF8 849 | #DIMS TEXT 850 | ; ... 851 | RETURN TEXT 852 | 853 | @GETKEY(VK_CODE) 854 | ; BUILTIN FUNCTION 855 | #DIM VK_CODE 856 | #DIM PRESSED 857 | ; ... 858 | RETURN PRESSED 859 | 860 | @GETKEYTRIGGERED(VK_CODE) 861 | ; BUILTIN FUNCTION 862 | #DIM VK_CODE 863 | #DIM PRESSED 864 | ; ... 865 | RETURN PRESSED 866 | 867 | @CLIENTWIDTH() 868 | ; BUILTIN FUNCTION 869 | #DIM WIDTH 870 | ; ... 871 | RETURN WIDTH 872 | 873 | @CLIENTHEIGHT() 874 | ; BUILTIN FUNCTION 875 | #DIM HEIGHT 876 | ; ... 877 | RETURN HEIGHT 878 | 879 | @MOUSEX() 880 | ; BUILTIN FUNCTION 881 | #DIM X_ 882 | ; ... 883 | RETURN X_ 884 | 885 | @MOUSEY() 886 | ; BUILTIN FUNCTION 887 | #DIM Y_ 888 | ; ... 889 | RETURN Y_ 890 | 891 | @ISACTIVE() 892 | ; BUILTIN FUNCTION 893 | #DIM BOOL 894 | ; ... 895 | RETURN BOOL 896 | 897 | @SPRITECREATED(SPRITENAME) 898 | ; BUILTIN FUNCTION 899 | #DIMS SPRITENAME 900 | #DIM BOOL 901 | ; ... 902 | RETURN BOOL 903 | 904 | @SPRITEWIDTH(SPRITENAME) 905 | ; BUILTIN FUNCTION 906 | #DIMS SPRITENAME 907 | #DIM WIDTH 908 | ; ... 909 | RETURN WIDTH 910 | 911 | @SPRITEHEIGHT(SPRITENAME) 912 | ; BUILTIN FUNCTION 913 | #DIMS SPRITENAME 914 | #DIM HEIGHT 915 | ; ... 916 | RETURN HEIGHT 917 | 918 | @SPRITEPOSX(SPRITENAME) 919 | ; BUILTIN FUNCTION 920 | #DIMS SPRITENAME 921 | #DIM X_ 922 | ; ... 923 | RETURN X_ 924 | 925 | @SPRITEPOSY(SPRITENAME) 926 | ; BUILTIN FUNCTION 927 | #DIMS SPRITENAME 928 | #DIM Y_ 929 | ; ... 930 | RETURN Y_ 931 | 932 | @SPRITESETPOS(SPRITENAME, X_, Y_) 933 | ; BUILTIN FUNCTION 934 | #DIMS SPRITENAME 935 | #DIM X_ 936 | #DIM Y_ 937 | #DIM SUCCESS 938 | ; ... 939 | RETURN SUCCESS 940 | 941 | @SPRITEMOVE(SPRITENAME, DX, DY) 942 | ; BUILTIN FUNCTION 943 | #DIMS SPRITENAME 944 | #DIM DX 945 | #DIM DY 946 | #DIM SUCCESS 947 | ; ... 948 | RETURN SUCCESS 949 | 950 | @GCREATE(GRAPHIC_ID, WIDTH, HEIGHT) 951 | ; BUILTIN FUNCTION 952 | #DIM GRAPHIC_ID 953 | #DIM WIDTH 954 | #DIM HEIGHT 955 | #DIM SUCCESS 956 | ; ... 957 | RETURN SUCCESS 958 | 959 | @GCREATEFROMFILE(GRAPHIC_ID, FILEPATH) 960 | ; BUILTIN FUNCTION 961 | #DIM GRAPHIC_ID 962 | #DIMS FILEPATH 963 | #DIM SUCCESS 964 | ; ... 965 | RETURN SUCCESS 966 | 967 | @GDISPOSE(GRAPHIC_ID) 968 | ; BUILTIN FUNCTION 969 | #DIM GRAPHIC_ID 970 | #DIM SUCCESS 971 | ; ... 972 | RETURN SUCCESS 973 | 974 | @GCLEAR(GRAPHIC_ID, ARGB) 975 | ; BUILTIN FUNCTION 976 | #DIM GRAPHIC_ID 977 | #DIM ARGB 978 | #DIM SUCCESS 979 | ; ... 980 | RETURN SUCCESS 981 | 982 | @GFILLRECTANGLE(GRAPHIC_ID, X_, Y_, WIDTH, HEIGHT) 983 | ; BUILTIN FUNCTION 984 | #DIM GRAPHIC_ID 985 | #DIM X_ 986 | #DIM Y_ 987 | #DIM WIDTH 988 | #DIM HEIGHT 989 | #DIM SUCCESS 990 | ; ... 991 | RETURN SUCCESS 992 | 993 | @GDRAWG(DST_ID, SRC_ID, DST_X, DST_Y, DST_W, DST_H, SRC_X, SRC_Y, SRC_H, SRC_W, CM = ?) 994 | ; BUILTIN FUNCTION 995 | #DIM DST_ID 996 | #DIM SRC_ID 997 | #DIM DST_X 998 | #DIM DST_Y 999 | #DIM DST_W 1000 | #DIM DST_H 1001 | #DIM SRC_X 1002 | #DIM SRC_Y 1003 | #DIM SRC_H 1004 | #DIM SRC_W 1005 | #DIM REF CM 1006 | #DIM SUCCESS 1007 | ; ... 1008 | RETURN SUCCESS 1009 | 1010 | @GDRAWGWITHMASK(DST_ID, SRC_ID, MASK_ID, DST_X, DST_Y) 1011 | ; BUILTIN FUNCTION 1012 | #DIM DST_ID 1013 | #DIM SRC_ID 1014 | #DIM MASK_ID 1015 | #DIM DST_X 1016 | #DIM DST_Y 1017 | #DIM SUCCESS 1018 | ; ... 1019 | RETURN SUCCESS 1020 | 1021 | @GDRAWSPRITE(GRAPHIC_ID, SPRITENAME, DST_X = ?, DST_Y = ?, DST_W = ?, DST_H = ?, CM = ?) 1022 | ; BUILTIN FUNCTION 1023 | #DIM GRAPHIC_ID 1024 | #DIMS SPRITENAME 1025 | #DIM DST_X 1026 | #DIM DST_Y 1027 | #DIM DST_W 1028 | #DIM DST_H 1029 | #DIM REF CM 1030 | #DIM SUCCESS 1031 | ; ... 1032 | RETURN SUCCESS 1033 | 1034 | @GSETCOLOR(GRAPHIC_ID, ARGB, X_, Y_) 1035 | ; BUILTIN FUNCTION 1036 | #DIM GRAPHIC_ID 1037 | #DIM ARGB 1038 | #DIM X_ 1039 | #DIM Y_ 1040 | #DIM SUCCESS 1041 | ; ... 1042 | RETURN SUCCESS 1043 | 1044 | @GSETBRUSH(GRAPHIC_ID, ARGB) 1045 | ; BUILTIN FUNCTION 1046 | #DIM GRAPHIC_ID 1047 | #DIM ARGB 1048 | #DIM SUCCESS 1049 | ; ... 1050 | RETURN SUCCESS 1051 | 1052 | @GSETFONT(GRAPHIC_ID, FONTNAME, FONTSIZE) 1053 | ; BUILTIN FUNCTION 1054 | #DIM GRAPHIC_ID 1055 | #DIMS FONTNAME 1056 | #DIM FONTSIZE 1057 | #DIM SUCCESS 1058 | ; ... 1059 | RETURN SUCCESS 1060 | 1061 | @GSETPEN(GRAPHIC_ID, ARGB, PENWIDTH) 1062 | ; BUILTIN FUNCTION 1063 | #DIM GRAPHIC_ID 1064 | #DIM ARGB 1065 | #DIM PENWIDTH 1066 | #DIM SUCCESS 1067 | ; ... 1068 | RETURN SUCCESS 1069 | 1070 | @GCREATED(GRAPHIC_ID) 1071 | ; BUILTIN FUNCTION 1072 | #DIM GRAPHIC_ID 1073 | #DIM BOOL 1074 | ; ... 1075 | RETURN BOOL 1076 | 1077 | @GWIDTH(GRAPHIC_ID) 1078 | ; BUILTIN FUNCTION 1079 | #DIM GRAPHIC_ID 1080 | #DIM WIDTH 1081 | ; ... 1082 | RETURN WIDTH 1083 | 1084 | @GHEIGHT(GRAPHIC_ID) 1085 | ; BUILTIN FUNCTION 1086 | #DIM GRAPHIC_ID 1087 | #DIM HEIGHT 1088 | ; ... 1089 | RETURN HEIGHT 1090 | 1091 | @GGETCOLOR(GRAPHIC_ID, X_, Y_) 1092 | ; BUILTIN FUNCTION 1093 | #DIM GRAPHIC_ID 1094 | #DIM X_ 1095 | #DIM Y_ 1096 | #DIM ARGB 1097 | ; ... 1098 | RETURN ARGB 1099 | 1100 | @GSAVE(GRAPHIC_ID, FILE_NO) 1101 | ; BUILTIN FUNCTION 1102 | #DIM GRAPHIC_ID 1103 | #DIM FILE_NO 1104 | #DIM SUCCESS 1105 | ; ... 1106 | RETURN SUCCESS 1107 | 1108 | @GLOAD(GRAPHIC_ID, FILE_NO) 1109 | ; BUILTIN FUNCTION 1110 | #DIM GRAPHIC_ID 1111 | #DIM FILE_NO 1112 | #DIM SUCCESS 1113 | ; ... 1114 | RETURN SUCCESS 1115 | 1116 | @SPRITECREATE(SPRITENAME, GRAPHIC_ID, X_ = ?, Y_ = ?, WIDTH = ? , HEIGHT = ?) 1117 | ; BUILTIN FUNCTION 1118 | #DIMS SPRITENAME 1119 | #DIM GRAPHIC_ID 1120 | #DIM X_ 1121 | #DIM Y_ 1122 | #DIM WIDTH 1123 | #DIM HEIGHT 1124 | #DIM SUCCESS 1125 | ; ... 1126 | RETURN SUCCESS 1127 | 1128 | @SPRITEANIMECREATE(SPRITENAME, WIDTH, HEIGHT) 1129 | ; BUILTIN FUNCTION 1130 | #DIMS SPRITENAME 1131 | #DIM WIDTH 1132 | #DIM HEIGHT 1133 | #DIM SUCCESS 1134 | ; ... 1135 | RETURN SUCCESS 1136 | 1137 | @SPRITEANIMEADDFRAME(SPRITENAME, GRAPHIC_ID, X_, Y_, WIDTH, HEIGHT, OFFSET_X, OFFSET_Y, DELAY) 1138 | ; BUILTIN FUNCTION 1139 | #DIMS SPRITENAME 1140 | #DIM GRAPHIC_ID 1141 | #DIM X_ 1142 | #DIM Y_ 1143 | #DIM WIDTH 1144 | #DIM HEIGHT 1145 | #DIM OFFSET_X 1146 | #DIM OFFSET_Y 1147 | #DIM DELAY 1148 | #DIM SUCCESS 1149 | ; ... 1150 | RETURN SUCCESS 1151 | 1152 | @SPRITEDISPOSE(SPRITENAME) 1153 | ; BUILTIN FUNCTION 1154 | #DIMS SPRITENAME 1155 | #DIM SUCCESS 1156 | ; ... 1157 | RETURN SUCCESS 1158 | 1159 | @SPRITEGETCOLOR(SPRITENAME, X_, Y_) 1160 | ; BUILTIN FUNCTION 1161 | #DIMS SPRITENAME 1162 | #DIM X_ 1163 | #DIM Y_ 1164 | #DIM ARGB 1165 | ; ... 1166 | RETURN ARGB 1167 | 1168 | @CBGSETG(GRAPHIC_ID, X_, Y_, Z_DEPTH) 1169 | ; BUILTIN FUNCTION 1170 | #DIM GRAPHIC_ID 1171 | #DIM X_ 1172 | #DIM Y_ 1173 | #DIM Z_DEPTH 1174 | #DIM SUCCESS 1175 | ; ... 1176 | RETURN SUCCESS 1177 | 1178 | @CBGSETSPRITE(SPRITENAME, X_, Y_, Z_DEPTH) 1179 | ; BUILTIN FUNCTION 1180 | #DIMS SPRITENAME 1181 | #DIM X_ 1182 | #DIM Y_ 1183 | #DIM Z_DEPTH 1184 | #DIM SUCCESS 1185 | ; ... 1186 | RETURN SUCCESS 1187 | 1188 | @CBGCLEAR() 1189 | ; BUILTIN FUNCTION 1190 | #DIM SUCCESS 1191 | ; ... 1192 | RETURN SUCCESS 1193 | 1194 | @CBGCLEARBUTTON() 1195 | ; BUILTIN FUNCTION 1196 | #DIM SUCCESS 1197 | ; ... 1198 | RETURN SUCCESS 1199 | 1200 | @CBGREMOVERANGE(Z_MXN, Z_MAX) 1201 | ; BUILTIN FUNCTION 1202 | #DIM Z_MIN 1203 | #DIM Z_MAX 1204 | #DIM SUCCESS 1205 | ; ... 1206 | RETURN SUCCESS 1207 | 1208 | @CBGREMOVEBMAP() 1209 | ; BUILTIN FUNCTION 1210 | #DIM SUCCESS 1211 | ; ... 1212 | RETURN SUCCESS 1213 | 1214 | @CBGSETBMAPG(GRAPHIC_ID) 1215 | ; BUILTIN FUNCTION 1216 | #DIM GRAPHIC_ID 1217 | #DIM SUCCESS 1218 | ; ... 1219 | RETURN SUCCESS 1220 | 1221 | @CBGSETBUTTONSPRITE(BUTTON, SPRITENAME1, SPRITENAME2, X_, Y_, Z_DEPTH, TOOLTIP = ?) 1222 | ; BUILTIN FUNCTION 1223 | #DIM BUTTON 1224 | #DIMS SPRITENAME1 1225 | #DIMS SPRITENAME2 1226 | #DIM X_ 1227 | #DIM Y_ 1228 | #DIM Z_DEPTH 1229 | #DIMS TOOLTIP 1230 | #DIM SUCCESS 1231 | ; ... 1232 | RETURN SUCCESS 1233 | -------------------------------------------------------------------------------- /emuera/exvar.erh: -------------------------------------------------------------------------------- 1 | ; Note: These declarations are pseudo-EraBasic for illustrative purposes. 2 | 3 | ;; Generic Variables 4 | 5 | #DIM SAVEDATA A, _ 6 | #DIM SAVEDATA B, _ 7 | #DIM SAVEDATA C, _ 8 | #DIM SAVEDATA D, _ 9 | #DIM SAVEDATA E, _ 10 | #DIM SAVEDATA F, _ 11 | #DIM SAVEDATA G, _ 12 | #DIM SAVEDATA H, _ 13 | #DIM SAVEDATA I, _ 14 | #DIM SAVEDATA J, _ 15 | #DIM SAVEDATA K, _ 16 | #DIM SAVEDATA L, _ 17 | #DIM SAVEDATA M, _ 18 | #DIM SAVEDATA N, _ 19 | #DIM SAVEDATA O, _ 20 | #DIM SAVEDATA P, _ 21 | #DIM SAVEDATA Q, _ 22 | #DIM SAVEDATA R, _ 23 | #DIM SAVEDATA S, _ 24 | #DIM SAVEDATA T, _ 25 | #DIM SAVEDATA U, _ 26 | #DIM SAVEDATA V, _ 27 | #DIM SAVEDATA W, _ 28 | #DIM SAVEDATA X, _ 29 | #DIM SAVEDATA Y, _ 30 | #DIM SAVEDATA Z, _ 31 | 32 | #DIM SAVEDATA DITEMTYPE, _, _ 33 | 34 | #DIM SAVEDATA DA, _, _ 35 | #DIM SAVEDATA DB, _, _ 36 | #DIM SAVEDATA DC, _, _ 37 | #DIM SAVEDATA DD, _, _ 38 | #DIM SAVEDATA DE, _, _ 39 | 40 | #DIM SAVEDATA TA, _, _, _ 41 | #DIM SAVEDATA TB, _, _, _ 42 | 43 | #DIM SAVEDATA COUNT, _ 44 | 45 | #DIM SAVEDATA RESULT, _ 46 | #DIMS RESULTS, _ 47 | 48 | ;; Basic Information Varibales 49 | 50 | #DIM SAVEDATA DAY, _ 51 | #DIM SAVEDATA TIME, _ 52 | #DIM SAVEDATA MONEY, _ 53 | 54 | ;; Basic Training Information Variables 55 | 56 | #DIM SAVEDATA MASTER, _ 57 | #DIM SAVEDATA TARGET, _ 58 | #DIM SAVEDATA ASSI, _ 59 | #DIM SAVEDATA ASSIPLAY, _ 60 | #DIM SAVEDATA PLAYER, _ 61 | #DIM CHARANUM 62 | #DIM SAVEDATA SELECTCOM, _ 63 | #DIM SAVEDATA PREVCOM, _ 64 | #DIM SAVEDATA NEXTCOM, _ 65 | 66 | ;; Training Variables 67 | 68 | #DIM SAVEDATA LOSEBASE, _ 69 | #DIM SAVEDATA UP, _ 70 | #DIM SAVEDATA DOWN, _ 71 | #DIM SAVEDATA PALAMLV, _ 72 | #DIM SAVEDATA EXPLV, _ 73 | #DIM SAVEDATA EJAC, _ 74 | 75 | ;; Flags 76 | 77 | #DIM SAVEDATA FLAG, _ 78 | #DIM SAVEDATA TFLAG, _ 79 | 80 | ;; Character Data 81 | 82 | #DIM SAVEDATA CHARADATA NO 83 | #DIM SAVEDATA CHARADATA BASE, _ 84 | #DIM SAVEDATA CHARADATA MAXBASE, _ 85 | #DIM SAVEDATA CHARADATA ABL, _ 86 | #DIM SAVEDATA CHARADATA TALENT, _ 87 | #DIM SAVEDATA CHARADATA EXP, _ 88 | #DIM SAVEDATA CHARADATA MARK, _ 89 | #DIM SAVEDATA CHARADATA RELATION, _ 90 | #DIM SAVEDATA CHARADATA JUEL, _ 91 | #DIM SAVEDATA CHARADATA CFLAG, _ 92 | #DIM SAVEDATA CHARADATA ISASSI 93 | #DIMS SAVEDATA CHARADATA NAME 94 | #DIMS SAVEDATA CHARADATA CALLNAME 95 | #DIM SAVEDATA CHARADATA EQUIP, _ 96 | #DIM SAVEDATA CHARADATA TEQUIP, _ 97 | #DIM SAVEDATA CHARADATA PALAM, _ 98 | #DIM SAVEDATA CHARADATA STAIN, _ 99 | #DIM SAVEDATA CHARADATA EX, _ 100 | #DIM SAVEDATA CHARADATA SOURCE, _ 101 | #DIM SAVEDATA CHARADATA NOWEX, _ 102 | #DIM SAVEDATA CHARADATA GOTJUEL, _ 103 | 104 | #DIMS SAVEDATA CHARADATA NICKNAME 105 | #DIMS SAVEDATA CHARADATA MASTERNAME 106 | 107 | #DIMS SAVEDATA CHARADATA CSTR, _ 108 | #DIM SAVEDATA CHARADATA CUP, _ 109 | #DIM SAVEDATA CHARADATA CDOWN, _ 110 | #DIM SAVEDATA CHARADATA DOWNBASE, _ 111 | #DIM SAVEDATA CHARADATA TCVAR, _ 112 | #DIM SAVEDATA CHARADATA CDFLAG, _ 113 | 114 | ;; Item Data 115 | 116 | #DIM SAVEDATA ITEM, _ 117 | #DIM SAVEDATA ITEMSALES, _ 118 | #DIM SAVEDATA BOUGHT, _ 119 | #DIM SAVEDATA NOITEM, _ 120 | #DIM SAVEDATA PBAND, _ 121 | 122 | ;; Name Data 123 | 124 | #DIMS ABLNAME, _ ; abl.csv 125 | #DIMS TALENTNAME, _ ; talent.csv 126 | #DIMS EXPNAME, _ ; exp.csv 127 | #DIMS MARKNAME, _ ; mark.csv 128 | #DIMS PALAMNAME, _ ; palam.csv 129 | #DIMS ITEMNAME, _ ; item.csv 130 | 131 | #DIM ITEMPRICE, _ ; item.csv 132 | #DIMS TRAINNAME, _ ; train.csv 133 | #DIMS BASENAME, _ ; base.csv 134 | #DIMS EQUIPNAME, _ ; equip.csv 135 | #DIMS TEQUIPNAME, _ ; tequip.csv 136 | #DIMS STAINNAME, _ ; stain.csv 137 | #DIMS EXNAME, _ ; ex.csv 138 | #DIMS SOURCENAME, _ ; source.csv 139 | #DIMS FLAGNAME, _ ; flag.csv 140 | #DIMS TFLAGNAME, _ ; tflag.csv 141 | #DIMS CFLAGNAME, _ ; cflag.csv 142 | #DIMS TCVARNAME, _ ; tcvar.csv 143 | #DIMS STRNAME, _ ; strname.csv 144 | #DIMS TSTRNAME, _ ; tstr.csv 145 | #DIMS CSTRNAME, _ ; cstr.csv 146 | #DIMS SAVESTRNAME, _ ; savestr.csv 147 | #DIMS CDFLAGNAME1, _ ; cdflag1.csv 148 | #DIMS CDFLAGNAME2, _ ; cdflag2.csv 149 | #DIMS GLOBALNAME, _ ; global.csv 150 | #DIMS GLOBALSNAME, _ ; globals.csv 151 | 152 | ;; String Data 153 | 154 | #DIMS STR, _ ; str.csv 155 | #DIMS SAVEDATA SAVESTR, _ ; savestr.csv 156 | 157 | ;; Other Data 158 | 159 | #DIMS GAMEBASE_AUTHOR ; gamebase.csv "作者" 160 | #DIMS GAMEBASE_INFO ; gamebase.csv "追加情報" 161 | #DIMS GAMEBASE_YEAR ; gamebase.csv "製作年" 162 | #DIMS GAMEBASE_TITLE ; gamebase.csv "タイトル" 163 | #DIM GAMEBASE_GAMECODE ; gamebase.csv "コード" 164 | #DIM GAMEBASE_VERSION ; gamebase.csv "バージョン" 165 | #DIM GAMEBASE_ALLOWVERSION ; gamebase.csv "バージョン違い認める" 166 | #DIM GAMEBASE_DEFAULTCHARA ; gamebase.csv "最初から居るキャラ" 167 | #DIM GAMEBASE_NOITEM ; gamebase.csv "アイテムなし" 168 | 169 | #DIMS SAVEDATA WINDOW_TITLE ; gamebase.csv "ウィンドウタイトル" 170 | 171 | #DIMS MONEYLABEL ; _replace.csv "お金の単位" 172 | #DIMS DRAWLINESTR ; _replace.csv "DRAWLINE文字" 173 | 174 | ;; Shared Variable between Savedata 175 | 176 | #DIM GLOBAL SAVEDATA GLOBAL, _ 177 | #DIMS GLOBAL SAVEDATA GLOBALS, _ 178 | 179 | ;; Save & Load Information Variables 180 | 181 | #DIM LASTLOAD_VERSION 182 | #DIM LASTLOAD_NO 183 | #DIMS LASTLOAD_TEXT 184 | 185 | #DIMS SAVEDATA SAVEDATA_TEXT 186 | 187 | ;; Debug Variables 188 | 189 | #DIM __FILE__ 190 | #DIM __FUNCTION__ 191 | #DIM __LINE__ 192 | 193 | ;; Other Variables 194 | 195 | #DIM RAND, * 196 | 197 | #DIMS TSTR, _ 198 | 199 | #DIM SAVEDATA RANDDATA, 625 200 | 201 | #DIM LINECOUNT 202 | 203 | #DIM ISTIMEOUT 204 | 205 | #DIM CONST __INT_MAX__ = 9223372036854775807 206 | #DIM CONST __INT_MIN__ = -9223372036854775808 207 | 208 | #DIM EMUERA_VERSION 209 | -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sasami/vscode-erabasic/c0a205daf911a331bbff61365f50a9680b298613/images/screenshot.png -------------------------------------------------------------------------------- /language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | // symbol used for single line comment. Remove this entry if your language does not support line comments 4 | "lineComment": ";", 5 | // symbols used for start and end a block comment. Remove this entry if your language does not support block comments 6 | "blockComment": [ "[SKIPSTART]", "[SKIPEND]" ] 7 | }, 8 | // symbols used as brackets 9 | "brackets": [ 10 | ["{", "}"], 11 | ["[", "]"], 12 | ["(", ")"] 13 | ], 14 | // symbols that are auto closed when typing 15 | "autoClosingPairs": [ 16 | ["{", "}"], 17 | ["[", "]"], 18 | ["(", ")"], 19 | ["\"", "\""] 20 | ], 21 | // symbols that that can be used to surround a selection 22 | "surroundingPairs": [ 23 | ["{", "}"], 24 | ["[", "]"], 25 | ["(", ")"], 26 | ["\"", "\""] 27 | ], 28 | "folding": { 29 | "markers": { 30 | "start": "^\\s*;\\s*#?region\\b", 31 | "end": "^\\s*;\\s*#?endregion\\b", 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "erabasic", 3 | "version": "0.4.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@babel/code-frame": { 8 | "version": "7.8.3", 9 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", 10 | "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", 11 | "dev": true, 12 | "requires": { 13 | "@babel/highlight": "^7.8.3" 14 | } 15 | }, 16 | "@babel/helper-validator-identifier": { 17 | "version": "7.9.5", 18 | "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", 19 | "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", 20 | "dev": true 21 | }, 22 | "@babel/highlight": { 23 | "version": "7.9.0", 24 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", 25 | "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", 26 | "dev": true, 27 | "requires": { 28 | "@babel/helper-validator-identifier": "^7.9.0", 29 | "chalk": "^2.0.0", 30 | "js-tokens": "^4.0.0" 31 | } 32 | }, 33 | "@types/node": { 34 | "version": "12.12.39", 35 | "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.39.tgz", 36 | "integrity": "sha512-pADGfwnDkr6zagDwEiCVE4yQrv7XDkoeVa4OfA9Ju/zRTk6YNDLGtQbkdL4/56mCQQCs4AhNrBIag6jrp7ZuOg==", 37 | "dev": true 38 | }, 39 | "@types/vscode": { 40 | "version": "1.45.0", 41 | "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.45.0.tgz", 42 | "integrity": "sha512-b0Gyir7sPBCqiKLygAhn/AYVfzWD+SMPkWltBrIuPEyTOxSU1wVApWY/FcxYO2EWTRacoubTl4+gvZf86RkecA==", 43 | "dev": true 44 | }, 45 | "ansi-styles": { 46 | "version": "3.2.1", 47 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 48 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 49 | "dev": true, 50 | "requires": { 51 | "color-convert": "^1.9.0" 52 | } 53 | }, 54 | "argparse": { 55 | "version": "1.0.10", 56 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 57 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 58 | "dev": true, 59 | "requires": { 60 | "sprintf-js": "~1.0.2" 61 | } 62 | }, 63 | "balanced-match": { 64 | "version": "1.0.0", 65 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 66 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 67 | "dev": true 68 | }, 69 | "brace-expansion": { 70 | "version": "1.1.11", 71 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 72 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 73 | "dev": true, 74 | "requires": { 75 | "balanced-match": "^1.0.0", 76 | "concat-map": "0.0.1" 77 | } 78 | }, 79 | "builtin-modules": { 80 | "version": "1.1.1", 81 | "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", 82 | "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", 83 | "dev": true 84 | }, 85 | "chalk": { 86 | "version": "2.4.2", 87 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 88 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 89 | "dev": true, 90 | "requires": { 91 | "ansi-styles": "^3.2.1", 92 | "escape-string-regexp": "^1.0.5", 93 | "supports-color": "^5.3.0" 94 | } 95 | }, 96 | "color-convert": { 97 | "version": "1.9.3", 98 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 99 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 100 | "dev": true, 101 | "requires": { 102 | "color-name": "1.1.3" 103 | } 104 | }, 105 | "color-name": { 106 | "version": "1.1.3", 107 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 108 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 109 | "dev": true 110 | }, 111 | "commander": { 112 | "version": "2.20.3", 113 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", 114 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", 115 | "dev": true 116 | }, 117 | "concat-map": { 118 | "version": "0.0.1", 119 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 120 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 121 | "dev": true 122 | }, 123 | "diff": { 124 | "version": "4.0.2", 125 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", 126 | "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", 127 | "dev": true 128 | }, 129 | "escape-string-regexp": { 130 | "version": "1.0.5", 131 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 132 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 133 | "dev": true 134 | }, 135 | "esprima": { 136 | "version": "4.0.1", 137 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 138 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 139 | "dev": true 140 | }, 141 | "fs.realpath": { 142 | "version": "1.0.0", 143 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 144 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 145 | "dev": true 146 | }, 147 | "glob": { 148 | "version": "7.1.6", 149 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", 150 | "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", 151 | "dev": true, 152 | "requires": { 153 | "fs.realpath": "^1.0.0", 154 | "inflight": "^1.0.4", 155 | "inherits": "2", 156 | "minimatch": "^3.0.4", 157 | "once": "^1.3.0", 158 | "path-is-absolute": "^1.0.0" 159 | } 160 | }, 161 | "has-flag": { 162 | "version": "3.0.0", 163 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 164 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 165 | "dev": true 166 | }, 167 | "iconv-lite": { 168 | "version": "0.4.24", 169 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 170 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 171 | "requires": { 172 | "safer-buffer": ">= 2.1.2 < 3" 173 | } 174 | }, 175 | "inflight": { 176 | "version": "1.0.6", 177 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 178 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 179 | "dev": true, 180 | "requires": { 181 | "once": "^1.3.0", 182 | "wrappy": "1" 183 | } 184 | }, 185 | "inherits": { 186 | "version": "2.0.4", 187 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 188 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 189 | "dev": true 190 | }, 191 | "js-tokens": { 192 | "version": "4.0.0", 193 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 194 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", 195 | "dev": true 196 | }, 197 | "js-yaml": { 198 | "version": "3.13.1", 199 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", 200 | "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", 201 | "dev": true, 202 | "requires": { 203 | "argparse": "^1.0.7", 204 | "esprima": "^4.0.0" 205 | } 206 | }, 207 | "minimatch": { 208 | "version": "3.0.4", 209 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 210 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 211 | "dev": true, 212 | "requires": { 213 | "brace-expansion": "^1.1.7" 214 | } 215 | }, 216 | "minimist": { 217 | "version": "1.2.5", 218 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", 219 | "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", 220 | "dev": true 221 | }, 222 | "mkdirp": { 223 | "version": "0.5.5", 224 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", 225 | "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", 226 | "dev": true, 227 | "requires": { 228 | "minimist": "^1.2.5" 229 | } 230 | }, 231 | "once": { 232 | "version": "1.4.0", 233 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 234 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 235 | "dev": true, 236 | "requires": { 237 | "wrappy": "1" 238 | } 239 | }, 240 | "path-is-absolute": { 241 | "version": "1.0.1", 242 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 243 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 244 | "dev": true 245 | }, 246 | "path-parse": { 247 | "version": "1.0.6", 248 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", 249 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", 250 | "dev": true 251 | }, 252 | "resolve": { 253 | "version": "1.17.0", 254 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", 255 | "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", 256 | "dev": true, 257 | "requires": { 258 | "path-parse": "^1.0.6" 259 | } 260 | }, 261 | "safer-buffer": { 262 | "version": "2.1.2", 263 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 264 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 265 | }, 266 | "semver": { 267 | "version": "5.7.1", 268 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 269 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", 270 | "dev": true 271 | }, 272 | "sprintf-js": { 273 | "version": "1.0.3", 274 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 275 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 276 | "dev": true 277 | }, 278 | "supports-color": { 279 | "version": "5.5.0", 280 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 281 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 282 | "dev": true, 283 | "requires": { 284 | "has-flag": "^3.0.0" 285 | } 286 | }, 287 | "tslib": { 288 | "version": "1.13.0", 289 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", 290 | "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", 291 | "dev": true 292 | }, 293 | "tslint": { 294 | "version": "5.20.1", 295 | "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", 296 | "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", 297 | "dev": true, 298 | "requires": { 299 | "@babel/code-frame": "^7.0.0", 300 | "builtin-modules": "^1.1.1", 301 | "chalk": "^2.3.0", 302 | "commander": "^2.12.1", 303 | "diff": "^4.0.1", 304 | "glob": "^7.1.1", 305 | "js-yaml": "^3.13.1", 306 | "minimatch": "^3.0.4", 307 | "mkdirp": "^0.5.1", 308 | "resolve": "^1.3.2", 309 | "semver": "^5.3.0", 310 | "tslib": "^1.8.0", 311 | "tsutils": "^2.29.0" 312 | } 313 | }, 314 | "tsutils": { 315 | "version": "2.29.0", 316 | "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", 317 | "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", 318 | "dev": true, 319 | "requires": { 320 | "tslib": "^1.8.1" 321 | } 322 | }, 323 | "typescript": { 324 | "version": "3.9.2", 325 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.2.tgz", 326 | "integrity": "sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==", 327 | "dev": true 328 | }, 329 | "wrappy": { 330 | "version": "1.0.2", 331 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 332 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 333 | "dev": true 334 | } 335 | } 336 | } 337 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "erabasic", 3 | "displayName": "EraBasic", 4 | "description": "Language Support for EraBasic", 5 | "license": "MIT", 6 | "version": "0.4.0", 7 | "publisher": "sasami", 8 | "bugs": { 9 | "url": "https://github.com/sasami/vscode-erabasic/issues" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/sasami/vscode-erabasic.git" 14 | }, 15 | "engines": { 16 | "vscode": "^1.34.0" 17 | }, 18 | "categories": [ 19 | "Programming Languages" 20 | ], 21 | "activationEvents": [ 22 | "onLanguage:erabasic" 23 | ], 24 | "main": "./out/extension", 25 | "scripts": { 26 | "build": "vsce package --baseContentUrl . --baseImagesUrl https://rawgit.com/sasami/vscode-erabasic/master/ --out erabasic-latest.vsix", 27 | "vscode:prepublish": "npm run compile", 28 | "compile": "tsc -p ./", 29 | "lint": "tslint -p ./", 30 | "watch": "tsc -watch -p ./" 31 | }, 32 | "contributes": { 33 | "languages": [ 34 | { 35 | "id": "erabasic", 36 | "aliases": [ 37 | "EraBasic", 38 | "erabasic" 39 | ], 40 | "extensions": [ 41 | ".erb", 42 | ".erh" 43 | ], 44 | "configuration": "./language-configuration.json" 45 | } 46 | ], 47 | "grammars": [ 48 | { 49 | "language": "erabasic", 50 | "scopeName": "source.erabasic", 51 | "path": "./syntaxes/erabasic.tmLanguage.json" 52 | } 53 | ], 54 | "snippets": [ 55 | { 56 | "language": "erabasic", 57 | "path": "./snippets/erabasic.json" 58 | } 59 | ] 60 | }, 61 | "dependencies": { 62 | "iconv-lite": "^0.4.24" 63 | }, 64 | "devDependencies": { 65 | "@types/node": "^12.12.0", 66 | "@types/vscode": "^1.34.0", 67 | "tslint": "^5.19.0", 68 | "typescript": "^3.8.3" 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /snippets/erabasic.json: -------------------------------------------------------------------------------- 1 | { 2 | "PRINTDATA Statement": { 3 | "prefix": "PRINTDATA", 4 | "description": "PRINTDATA Statement", 5 | "body": [ 6 | "PRINTDATA", 7 | "\t$0", 8 | "ENDDATA" 9 | ] 10 | }, 11 | "PRINTDATAL Statement": { 12 | "prefix": "PRINTDATAL", 13 | "description": "PRINTDATAL Statement", 14 | "body": [ 15 | "PRINTDATAL", 16 | "\t$0", 17 | "ENDDATA" 18 | ] 19 | }, 20 | "PRINTDATAW Statement": { 21 | "prefix": "PRINTDATAW", 22 | "description": "PRINTDATAW Statement", 23 | "body": [ 24 | "PRINTDATAW", 25 | "\t$0", 26 | "ENDDATA" 27 | ] 28 | }, 29 | "PRINTDATAK Statement": { 30 | "prefix": "PRINTDATAK", 31 | "description": "PRINTDATAK Statement", 32 | "body": [ 33 | "PRINTDATAK", 34 | "\t$0", 35 | "ENDDATA" 36 | ] 37 | }, 38 | "PRINTDATAKL Statement": { 39 | "prefix": "PRINTDATAKL", 40 | "description": "PRINTDATAKL Statement", 41 | "body": [ 42 | "PRINTDATAKL", 43 | "\t$0", 44 | "ENDDATA" 45 | ] 46 | }, 47 | "PRINTDATAKW Statement": { 48 | "prefix": "PRINTDATAKW", 49 | "description": "PRINTDATAKW Statement", 50 | "body": [ 51 | "PRINTDATAKW", 52 | "\t$0", 53 | "ENDDATA" 54 | ] 55 | }, 56 | "PRINTDATAD Statement": { 57 | "prefix": "PRINTDATAD", 58 | "description": "PRINTDATAD Statement", 59 | "body": [ 60 | "PRINTDATAD", 61 | "\t$0", 62 | "ENDDATA" 63 | ] 64 | }, 65 | "PRINTDATADL Statement": { 66 | "prefix": "PRINTDATADL", 67 | "description": "PRINTDATADL Statement", 68 | "body": [ 69 | "PRINTDATADL", 70 | "\t$0", 71 | "ENDDATA" 72 | ] 73 | }, 74 | "PRINTDATADW Statement": { 75 | "prefix": "PRINTDATADW", 76 | "description": "PRINTDATADW Statement", 77 | "body": [ 78 | "PRINTDATADW", 79 | "\t$0", 80 | "ENDDATA" 81 | ] 82 | }, 83 | "STRDATA Statement": { 84 | "prefix": "STRDATA", 85 | "description": "STRDATA Statement", 86 | "body": [ 87 | "STRDATA", 88 | "\t$0", 89 | "ENDDATA" 90 | ] 91 | }, 92 | "DATALIST Statement": { 93 | "prefix": "DATALIST", 94 | "description": "DATALIST Statement", 95 | "body": [ 96 | "DATALIST", 97 | "\t$0", 98 | "ENDLIST" 99 | ] 100 | }, 101 | "SIF Statement": { 102 | "prefix": "SIF", 103 | "description": "SIF Statement", 104 | "body": [ 105 | "SIF ${1:condition}", 106 | "\t$0" 107 | ] 108 | }, 109 | "IF Statement": { 110 | "prefix": "IF", 111 | "description": "IF Statement", 112 | "body": [ 113 | "IF ${1:condition}", 114 | "\t$0", 115 | "ENDIF" 116 | ] 117 | }, 118 | "IF-ELSE Statement": { 119 | "prefix": "IFELSE", 120 | "description": "IF-ELSE Statement", 121 | "body": [ 122 | "IF ${1:condition}", 123 | "\t$0", 124 | "ELSE", 125 | "\t", 126 | "ENDIF" 127 | ] 128 | }, 129 | "REPEAT Statement": { 130 | "prefix": "REPEAT", 131 | "description": "REPEAT Statement", 132 | "body": [ 133 | "REPEAT ${1:count}", 134 | "\t$0", 135 | "REND" 136 | ] 137 | }, 138 | "FOR Statement": { 139 | "prefix": "FOR", 140 | "description": "FOR Statement", 141 | "body": [ 142 | "FOR ${1:count}, ${2:start}, ${3:end}", 143 | "\t$0", 144 | "NEXT" 145 | ] 146 | }, 147 | "WHILE Statement": { 148 | "prefix": "WHILE", 149 | "description": "WHILE Statement", 150 | "body": [ 151 | "WHILE ${1:condition}", 152 | "\t$0", 153 | "WEND" 154 | ] 155 | }, 156 | "DO-LOOP Statement": { 157 | "prefix": "DOLOOP", 158 | "description": "DO-LOOP Statement", 159 | "body": [ 160 | "DO", 161 | "\t$0", 162 | "LOOP ${1:condition}" 163 | ] 164 | }, 165 | "SELECTCASE Statement": { 166 | "prefix": "SELECTCASE", 167 | "description": "SELECTCASE Statement", 168 | "body": [ 169 | "SELECTCASE ${1:key}", 170 | "\tCASE ${2:value}", 171 | "\t\t$0", 172 | "\tCASEELSE", 173 | "\t\t", 174 | "ENDSELECT" 175 | ] 176 | }, 177 | "TRYCCALL Statement": { 178 | "prefix": "TRYCCALL", 179 | "description": "TRYCCALL Statement", 180 | "body": [ 181 | "TRYCCALL ${1:name}", 182 | "\t$0", 183 | "CATCH", 184 | "\t", 185 | "ENDCATCH" 186 | ] 187 | }, 188 | "TRYCJUMP Statement": { 189 | "prefix": "TRYCJUMP", 190 | "description": "TRYCJUMP Statement", 191 | "body": [ 192 | "TRYCJUMP ${1:name}", 193 | "\t$0", 194 | "CATCH", 195 | "\t", 196 | "ENDCATCH" 197 | ] 198 | }, 199 | "TRYCGOTO Statement": { 200 | "prefix": "TRYCGOTO", 201 | "description": "TRYCGOTO Statement", 202 | "body": [ 203 | "TRYCGOTO ${1:name}", 204 | "\t$0", 205 | "CATCH", 206 | "\t", 207 | "ENDCATCH" 208 | ] 209 | }, 210 | "TRYCCALLFORM Statement": { 211 | "prefix": "TRYCCALLFORM", 212 | "description": "TRYCCALLFORM Statement", 213 | "body": [ 214 | "TRYCCALLFORM ${1:name}", 215 | "\t$0", 216 | "CATCH", 217 | "\t", 218 | "ENDCATCH" 219 | ] 220 | }, 221 | "TRYCJUMPFORM Statement": { 222 | "prefix": "TRYCJUMPFORM", 223 | "description": "TRYCJUMPFORM Statement", 224 | "body": [ 225 | "TRYCJUMPFORM ${1:name}", 226 | "\t$0", 227 | "CATCH", 228 | "\t", 229 | "ENDCATCH" 230 | ] 231 | }, 232 | "TRYCGOTOFORM Statement": { 233 | "prefix": "TRYCGOTOFORM", 234 | "description": "TRYCGOTOFORM Statement", 235 | "body": [ 236 | "TRYCGOTOFORM ${1:name}", 237 | "\t$0", 238 | "CATCH", 239 | "\t", 240 | "ENDCATCH" 241 | ] 242 | }, 243 | "TRYCALLLIST Statement": { 244 | "prefix": "TRYCALLLIST", 245 | "description": "TRYCALLLIST Statement", 246 | "body": [ 247 | "TRYCALLLIST", 248 | "\tFUNC ${0:name}", 249 | "ENDFUNC" 250 | ] 251 | }, 252 | "TRYJUMPLIST Statement": { 253 | "prefix": "TRYJUMPLIST", 254 | "description": "TRYJUMPLIST Statement", 255 | "body": [ 256 | "TRYJUMPLIST", 257 | "\tFUNC ${0:name}", 258 | "ENDFUNC" 259 | ] 260 | }, 261 | "TRYGOTOLIST Statement": { 262 | "prefix": "TRYGOTOLIST", 263 | "description": "TRYGOTOLIST Statement", 264 | "body": [ 265 | "TRYGOTOLIST", 266 | "\tFUNC ${0:name}", 267 | "ENDFUNC" 268 | ] 269 | } 270 | } 271 | -------------------------------------------------------------------------------- /src/completion.ts: -------------------------------------------------------------------------------- 1 | import { CompletionItem, CompletionItemKind } from "vscode"; 2 | 3 | const Keyword = CompletionItemKind.Keyword; 4 | const Control = CompletionItemKind.Keyword; 5 | const Command = CompletionItemKind.Function; // 命令と呼ばれてるもののうち、関数では無いもの 6 | const Function = CompletionItemKind.Function; // 関数と呼ばれてるもの (Emueraの仕様上、全ての式中関数は命令としても機能する) 7 | const Variable = CompletionItemKind.Variable; 8 | 9 | type NLSLocale = "ja" | "en"; 10 | 11 | class NLSCompletionItem extends CompletionItem { 12 | nlsDetail?: { [locale in NLSLocale]?: string }; 13 | } 14 | 15 | function localizedComplationItems(items: NLSCompletionItem[]): CompletionItem[] { 16 | const conf = process.env.VSCODE_NLS_CONFIG ? JSON.parse(process.env.VSCODE_NLS_CONFIG) : {}; 17 | const locale = conf.locale || "en"; 18 | return items.map((item) => { 19 | if (item.detail === undefined && item.nlsDetail !== undefined) { 20 | item.detail = item.nlsDetail[locale] || item.nlsDetail["ja"]; 21 | delete item.nlsDetail; 22 | } 23 | return item; 24 | }); 25 | } 26 | 27 | // PRINT系を埋めて力尽きただけなので、気の向くまま埋めちゃって下されば取り込みます。 28 | // もちろん、日本語だけ、英語だけ、detailなんか無くてもOK! 29 | export const BuiltinComplationItems = localizedComplationItems([ 30 | { 31 | label: "PRINT", 32 | kind: Command, 33 | nlsDetail: { "ja": "文字列を表示", "en": "Show String" }, 34 | }, 35 | { 36 | label: "PRINTL", 37 | kind: Command, 38 | nlsDetail: { "ja": "文字列を表示+改行", "en": "Show String + Line Break" }, 39 | }, 40 | { 41 | label: "PRINTW", 42 | kind: Command, 43 | nlsDetail: { "ja": "文字列を表示+待機", "en": "Show String + Wait" }, 44 | }, 45 | { 46 | label: "PRINTK", 47 | kind: Command, 48 | nlsDetail: { "ja": "文字列を表示+カナ強制", "en": "Show String + Forced Kana" }, 49 | }, 50 | { 51 | label: "PRINTKL", 52 | kind: Command, 53 | nlsDetail: { "ja": "文字列を表示+カナ強制+改行", "en": "Show String + Forced Kana + Line Break" }, 54 | }, 55 | { 56 | label: "PRINTKW", 57 | kind: Command, 58 | nlsDetail: { "ja": "文字列を表示+カナ強制+待機", "en": "Show String + Forced Kana + Wait" }, 59 | }, 60 | { 61 | label: "PRINTD", 62 | kind: Command, 63 | nlsDetail: { "ja": "文字列を表示+初期色", "en": "Show String + Initial Color" }, 64 | }, 65 | { 66 | label: "PRINTDL", 67 | kind: Command, 68 | nlsDetail: { "ja": "文字列を表示+初期色+改行", "en": "Show String + Initial Color + Line Break" }, 69 | }, 70 | { 71 | label: "PRINTDW", 72 | kind: Command, 73 | nlsDetail: { "ja": "文字列を表示+初期色+待機", "en": "Show String + Initial Color + Wait" }, 74 | }, 75 | { 76 | label: "PRINTV", 77 | kind: Command, 78 | nlsDetail: { "ja": "数式を表示", "en": "Show Formula" }, 79 | }, 80 | { 81 | label: "PRINTVL", 82 | kind: Command, 83 | nlsDetail: { "ja": "数式を表示+改行", "en": "Show Formula + Line Break" }, 84 | }, 85 | { 86 | label: "PRINTVW", 87 | kind: Command, 88 | nlsDetail: { "ja": "数式を表示+待機", "en": "Show Formula + Wait" }, 89 | }, 90 | { 91 | label: "PRINTVK", 92 | kind: Command, 93 | nlsDetail: { "ja": "数式を表示+カナ強制", "en": "Show Formula + Forced Kana" }, 94 | }, 95 | { 96 | label: "PRINTVKL", 97 | kind: Command, 98 | nlsDetail: { "ja": "数式を表示+カナ強制+改行", "en": "Show Formula + Forced Kana + Line Break" }, 99 | }, 100 | { 101 | label: "PRINTVKW", 102 | kind: Command, 103 | nlsDetail: { "ja": "数式を表示+カナ強制+待機", "en": "Show Formula + Forced Kana + Wait" }, 104 | }, 105 | { 106 | label: "PRINTVD", 107 | kind: Command, 108 | nlsDetail: { "ja": "数式を表示+初期色", "en": "Show Formula + Initial Color" }, 109 | }, 110 | { 111 | label: "PRINTVDL", 112 | kind: Command, 113 | nlsDetail: { "ja": "数式を表示+初期色+改行", "en": "Show Formula + Initial Color + Line Break" }, 114 | }, 115 | { 116 | label: "PRINTVDW", 117 | kind: Command, 118 | nlsDetail: { "ja": "数式を表示+初期色+待機", "en": "Show Formula + Initial Color + Wait" }, 119 | }, 120 | { 121 | label: "PRINTS", 122 | kind: Command, 123 | nlsDetail: { "ja": "文字列式を表示", "en": "Display String Expression" }, 124 | }, 125 | { 126 | label: "PRINTSL", 127 | kind: Command, 128 | nlsDetail: { "ja": "文字列式を表示+改行", "en": "Display String Expression + Line Break" }, 129 | }, 130 | { 131 | label: "PRINTSW", 132 | kind: Command, 133 | nlsDetail: { "ja": "文字列式を表示+待機", "en": "Display String Expression + Wait" }, 134 | }, 135 | { 136 | label: "PRINTSK", 137 | kind: Command, 138 | nlsDetail: { "ja": "文字列式を表示+カナ強制", "en": "Display String Expression + Forced Kana" }, 139 | }, 140 | { 141 | label: "PRINTSKL", 142 | kind: Command, 143 | nlsDetail: { "ja": "文字列式を表示+カナ強制+改行", "en": "Display String Expression + Forced Kana + Line Break" }, 144 | }, 145 | { 146 | label: "PRINTSKW", 147 | kind: Command, 148 | nlsDetail: { "ja": "文字列式を表示+カナ強制+待機", "en": "Display String Expression + Forced Kana + Wait" }, 149 | }, 150 | { 151 | label: "PRINTSD", 152 | kind: Command, 153 | nlsDetail: { "ja": "文字列式を表示+初期色", "en": "Display String Expression + Initial Color" }, 154 | }, 155 | { 156 | label: "PRINTSDL", 157 | kind: Command, 158 | nlsDetail: { "ja": "文字列式を表示+初期色+改行", "en": "Display String Expression + Initial Color + Line Break" }, 159 | }, 160 | { 161 | label: "PRINTSDW", 162 | kind: Command, 163 | nlsDetail: { "ja": "文字列式を表示+初期色+待機", "en": "Display String Expression + Initial Color + Wait" }, 164 | }, 165 | { 166 | label: "PRINTFORM", 167 | kind: Command, 168 | nlsDetail: { "ja": "書式付文字列を表示", "en": "Formatted Show String" }, 169 | }, 170 | { 171 | label: "PRINTFORML", 172 | kind: Command, 173 | nlsDetail: { "ja": "書式付文字列を表示+改行", "en": "Formatted Show String + Line Break" }, 174 | }, 175 | { 176 | label: "PRINTFORMW", 177 | kind: Command, 178 | nlsDetail: { "ja": "書式付文字列を表示+待機", "en": "Formatted Show String + Wait" }, 179 | }, 180 | { 181 | label: "PRINTFORMK", 182 | kind: Command, 183 | nlsDetail: { "ja": "書式付文字列を表示+カナ強制", "en": "Formatted Show String + Forced Kana" }, 184 | }, 185 | { 186 | label: "PRINTFORMKL", 187 | kind: Command, 188 | nlsDetail: { "ja": "書式付文字列を表示+カナ強制+改行", "en": "Formatted Show String + Forced Kana + Line Break" }, 189 | }, 190 | { 191 | label: "PRINTFORMKW", 192 | kind: Command, 193 | nlsDetail: { "ja": "書式付文字列を表示+カナ強制+待機", "en": "Formatted Show String + Forced Kana + Wait" }, 194 | }, 195 | { 196 | label: "PRINTFORMD", 197 | kind: Command, 198 | nlsDetail: { "ja": "書式付文字列を表示+初期色", "en": "Formatted Show String + Initial Color" }, 199 | }, 200 | { 201 | label: "PRINTFORMDL", 202 | kind: Command, 203 | nlsDetail: { "ja": "書式付文字列を表示+初期色+改行", "en": "Formatted Show String + Initial Color + Line Break" }, 204 | }, 205 | { 206 | label: "PRINTFORMDW", 207 | kind: Command, 208 | nlsDetail: { "ja": "書式付文字列を表示+初期色+待機", "en": "Formatted Show String + Initial Color + Wait" }, 209 | }, 210 | { 211 | label: "PRINTFORMS", 212 | kind: Command, 213 | nlsDetail: { "ja": "書式付文字列式を表示", "en": "Formatted Display String Expression" }, 214 | }, 215 | { 216 | label: "PRINTFORMSL", 217 | kind: Command, 218 | nlsDetail: { "ja": "書式付文字列式を表示+改行", "en": "Formatted Display String Expression + Line Break" }, 219 | }, 220 | { 221 | label: "PRINTFORMSW", 222 | kind: Command, 223 | nlsDetail: { "ja": "書式付文字列式を表示+待機", "en": "Formatted Display String Expression + Wait" }, 224 | }, 225 | { 226 | label: "PRINTFORMSK", 227 | kind: Command, 228 | nlsDetail: { "ja": "書式付文字列式を表示+カナ強制", "en": "Formatted Display String Expression + Forced Kana" }, 229 | }, 230 | { 231 | label: "PRINTFORMSKL", 232 | kind: Command, 233 | nlsDetail: { "ja": "書式付文字列式を表示+カナ強制+改行", "en": "Formatted Display String Expression + Forced Kana + Line Break" }, 234 | }, 235 | { 236 | label: "PRINTFORMSKW", 237 | kind: Command, 238 | nlsDetail: { "ja": "書式付文字列式を表示+カナ強制+待機", "en": "Formatted Display String Expression + Forced Kana + Wait" }, 239 | }, 240 | { 241 | label: "PRINTFORMSD", 242 | kind: Command, 243 | nlsDetail: { "ja": "書式付文字列式を表示+初期色", "en": "Formatted Display String Expression + Initial Color" }, 244 | }, 245 | { 246 | label: "PRINTFORMSDL", 247 | kind: Command, 248 | nlsDetail: { "ja": "書式付文字列式を表示+初期色+改行", "en": "Formatted Display String Expression + Initial Color + Line Break" }, 249 | }, 250 | { 251 | label: "PRINTFORMSDW", 252 | kind: Command, 253 | nlsDetail: { "ja": "書式付文字列式を表示+初期色+待機", "en": "Formatted Display String Expression + Initial Color + Wait" }, 254 | }, 255 | { 256 | label: "PRINTSINGLE", 257 | kind: Command, 258 | nlsDetail: { "ja": "文字列を表示", "en": "Show String" }, 259 | }, 260 | { 261 | label: "PRINTSINGLEK", 262 | kind: Command, 263 | nlsDetail: { "ja": "文字列を表示+カナ強制", "en": "Show String + Forced Kana" }, 264 | }, 265 | { 266 | label: "PRINTSINGLED", 267 | kind: Command, 268 | nlsDetail: { "ja": "文字列を表示+初期色", "en": "Show String + Initial Color" }, 269 | }, 270 | { 271 | label: "PRINTSINGLEV", 272 | kind: Command, 273 | nlsDetail: { "ja": "数式を表示", "en": "Show Formula" }, 274 | }, 275 | { 276 | label: "PRINTSINGLEVK", 277 | kind: Command, 278 | nlsDetail: { "ja": "数式を表示+カナ強制", "en": "Show Formula + Forced Kana" }, 279 | }, 280 | { 281 | label: "PRINTSINGLEVD", 282 | kind: Command, 283 | nlsDetail: { "ja": "数式を表示+初期色", "en": "Show Formula + Initial Color" }, 284 | }, 285 | { 286 | label: "PRINTSINGLES", 287 | kind: Command, 288 | nlsDetail: { "ja": "文字列式を表示", "en": "Display String Expression" }, 289 | }, 290 | { 291 | label: "PRINTSINGLESK", 292 | kind: Command, 293 | nlsDetail: { "ja": "文字列式を表示+カナ強制", "en": "Display String Expression + Forced Kana" }, 294 | }, 295 | { 296 | label: "PRINTSINGLESD", 297 | kind: Command, 298 | nlsDetail: { "ja": "文字列式を表示+初期色", "en": "Display String Expression + Initial Color" }, 299 | }, 300 | { 301 | label: "PRINTSINGLEFORM", 302 | kind: Command, 303 | nlsDetail: { "ja": "書式付文字列を表示", "en": "Formatted Show String" }, 304 | }, 305 | { 306 | label: "PRINTSINGLEFORMK", 307 | kind: Command, 308 | nlsDetail: { "ja": "書式付文字列を表示+カナ強制", "en": "Formatted Show String + Forced Kana" }, 309 | }, 310 | { 311 | label: "PRINTSINGLEFORMD", 312 | kind: Command, 313 | nlsDetail: { "ja": "書式付文字列を表示+初期色", "en": "Formatted Show String + Initial Color" }, 314 | }, 315 | { 316 | label: "PRINTSINGLEFORMS", 317 | kind: Command, 318 | nlsDetail: { "ja": "書式付文字列式を表示", "en": "Formatted Display String Expression" }, 319 | }, 320 | { 321 | label: "PRINTSINGLEFORMSK", 322 | kind: Command, 323 | nlsDetail: { "ja": "書式付文字列式を表示+カナ強制", "en": "Formatted Display String Expression + Forced Kana" }, 324 | }, 325 | { 326 | label: "PRINTSINGLEFORMSD", 327 | kind: Command, 328 | nlsDetail: { "ja": "書式付文字列式を表示+初期色", "en": "Formatted Display String Expression + Initial Color" }, 329 | }, 330 | { 331 | label: "PRINTC", 332 | kind: Command, 333 | nlsDetail: { "ja": "文字列を表示+右揃え", "en": "Show String + Right Justified" }, 334 | }, 335 | { 336 | label: "PRINTCK", 337 | kind: Command, 338 | nlsDetail: { "ja": "文字列を表示+右揃え+カナ強制", "en": "Show String + Right Justified + Forced Kana" }, 339 | }, 340 | { 341 | label: "PRINTCD", 342 | kind: Command, 343 | nlsDetail: { "ja": "文字列を表示+右揃え+初期色", "en": "Show String + Right Justified + Initial Color" }, 344 | }, 345 | { 346 | label: "PRINTLC", 347 | kind: Command, 348 | nlsDetail: { "ja": "文字列を表示+左揃え", "en": "Show String + Left Justified" }, 349 | }, 350 | { 351 | label: "PRINTLCK", 352 | kind: Command, 353 | nlsDetail: { "ja": "文字列を表示+左揃え+カナ強制", "en": "Show String + Left Justified + Forced Kana" }, 354 | }, 355 | { 356 | label: "PRINTLCD", 357 | kind: Command, 358 | nlsDetail: { "ja": "文字列を表示+左揃え+初期色", "en": "Show String + Left Justified + Initial Color" }, 359 | }, 360 | { 361 | label: "PRINTFORMC", 362 | kind: Command, 363 | nlsDetail: { "ja": "書式付文字列を表示+右揃え", "en": "Formatted Show String + Right Justified" }, 364 | }, 365 | { 366 | label: "PRINTFORMCK", 367 | kind: Command, 368 | nlsDetail: { "ja": "書式付文字列を表示+右揃え+カナ強制", "en": "Formatted Show String + Right Justified + Forced Kana" }, 369 | }, 370 | { 371 | label: "PRINTFORMCD", 372 | kind: Command, 373 | nlsDetail: { "ja": "書式付文字列を表示+右揃え+初期色", "en": "Formatted Show String + Right Justified + Initial Color" }, 374 | }, 375 | { 376 | label: "PRINTFORMLC", 377 | kind: Command, 378 | nlsDetail: { "ja": "書式付文字列を表示+左揃え", "en": "Formatted Show String + Left Justified" }, 379 | }, 380 | { 381 | label: "PRINTFORMLCK", 382 | kind: Command, 383 | nlsDetail: { "ja": "書式付文字列を表示+左揃え+カナ強制", "en": "Formatted Show String + Left Justified + Forced Kana" }, 384 | }, 385 | { 386 | label: "PRINTFORMLCD", 387 | kind: Command, 388 | nlsDetail: { "ja": "書式付文字列を表示+左揃え+初期色", "en": "Formatted Show String + Left Justified + Initial Color" }, 389 | }, 390 | { 391 | label: "DATA", 392 | kind: Command, 393 | }, 394 | { 395 | label: "DATAFORM", 396 | kind: Command, 397 | }, 398 | { 399 | label: "PRINTBUTTON", 400 | kind: Command, 401 | nlsDetail: { "ja": "ボタンを表示", "en": "Show Button" }, 402 | }, 403 | { 404 | label: "PRINTBUTTONC", 405 | kind: Command, 406 | nlsDetail: { "ja": "ボタンを表示+右揃え", "en": "Show Button + Right Justified" }, 407 | }, 408 | { 409 | label: "PRINTBUTTONLC", 410 | kind: Command, 411 | nlsDetail: { "ja": "ボタンを表示+左揃え", "en": "Show Button + Left Justified" }, 412 | }, 413 | { 414 | label: "PRINTPLAIN", 415 | kind: Command, 416 | nlsDetail: { "ja": "文字列を表示", "en": "Show String" }, 417 | }, 418 | { 419 | label: "PRINTPLAINFORM", 420 | kind: Command, 421 | nlsDetail: { "ja": "書式付文字列を表示", "en": "Formatted Show String" }, 422 | }, 423 | { 424 | label: "CUSTOMDRAWLINE", 425 | kind: Command, 426 | nlsDetail: { "ja": "横線を表示", "en": "Show Line" }, 427 | }, 428 | { 429 | label: "DRAWLINEFORM", 430 | kind: Command, 431 | nlsDetail: { "ja": "横線を表示", "en": "Show Line" }, 432 | }, 433 | { 434 | label: "REUSELASTLINE", 435 | kind: Command, 436 | nlsDetail: { "ja": "最終行を書き換え", "en": "Rewrite Last Line" }, 437 | }, 438 | { 439 | label: "PRINT_ABL", 440 | kind: Command, 441 | nlsDetail: { "ja": "キャラの能力を表示", "en": "Display Character's ABL" }, 442 | }, 443 | { 444 | label: "PRINT_TALENT", 445 | kind: Command, 446 | nlsDetail: { "ja": "キャラの素質を表示", "en": "Display Character's Talent" }, 447 | }, 448 | { 449 | label: "PRINT_MARK", 450 | kind: Command, 451 | nlsDetail: { "ja": "キャラの刻印を表示", "en": "Display Character's Stamp" }, 452 | }, 453 | { 454 | label: "PRINT_EXP", 455 | kind: Command, 456 | nlsDetail: { "ja": "キャラの経験を表示", "en": "Display Character's EXP" }, 457 | }, 458 | { 459 | label: "PRINT_PALAM", 460 | kind: Command, 461 | nlsDetail: { "ja": "キャラの調教中パラメータを表示", "en": "Display Character's PARAMS" }, 462 | }, 463 | { 464 | label: "PRINT_ITEM", 465 | kind: Command, 466 | nlsDetail: { "ja": "所持アイテムを表示", "en": "Display Possessed Items" }, 467 | }, 468 | { 469 | label: "PRINT_SHOPITEM", 470 | kind: Command, 471 | nlsDetail: { "ja": "販売アイテムを表示", "en": "Display Sales Items" }, 472 | }, 473 | { 474 | label: "UPCHECK", 475 | kind: Command, 476 | nlsDetail: { "ja": "調教中パラメータの変化を表示", "en": "Display changes in training parameters" }, 477 | }, 478 | { 479 | label: "DRAWLINE", 480 | kind: Command, 481 | nlsDetail: { "ja": "横線を表示", "en": "Show Line" }, 482 | }, 483 | { 484 | label: "CLEARLINE", 485 | kind: Command, 486 | nlsDetail: { "ja": "行を削除", "en": "Delete Line" }, 487 | }, 488 | { 489 | label: "PRINT_IMG", 490 | kind: Command, 491 | nlsDetail: { "ja": "画像を表示", "en": "Display IMG" }, 492 | }, 493 | { 494 | label: "PRINT_RECT", 495 | kind: Command, 496 | nlsDetail: { "ja": "矩形を表示", "en": "Display Rectangle" }, 497 | }, 498 | { 499 | label: "PRINT_SPACE", 500 | kind: Command, 501 | nlsDetail: { "ja": "空白を表示", "en": "Show Blank" }, 502 | }, 503 | { 504 | label: "SETCOLOR", 505 | kind: Command, 506 | }, 507 | { 508 | label: "RESETCOLOR", 509 | kind: Command, 510 | }, 511 | { 512 | label: "SETBGCOLOR", 513 | kind: Command, 514 | }, 515 | { 516 | label: "RESETBGCOLOR", 517 | kind: Command, 518 | }, 519 | { 520 | label: "SETCOLORBYNAME", 521 | kind: Command, 522 | }, 523 | { 524 | label: "SETBGCOLORBYNAME", 525 | kind: Command, 526 | }, 527 | { 528 | label: "GETCOLOR", 529 | kind: Command, 530 | }, 531 | { 532 | label: "GETDEFCOLOR", 533 | kind: Command, 534 | }, 535 | { 536 | label: "GETBGCOLOR", 537 | kind: Command, 538 | }, 539 | { 540 | label: "GETDEFBGCOLOR", 541 | kind: Command, 542 | }, 543 | { 544 | label: "GETFOCUSCOLOR", 545 | kind: Command, 546 | }, 547 | { 548 | label: "FONTBOLD", 549 | kind: Command, 550 | }, 551 | { 552 | label: "FONTITALIC", 553 | kind: Command, 554 | }, 555 | { 556 | label: "FONTREGULAR", 557 | kind: Command, 558 | }, 559 | { 560 | label: "FONTSTYLE", 561 | kind: Command, 562 | }, 563 | { 564 | label: "GETSTYLE", 565 | kind: Command, 566 | }, 567 | { 568 | label: "CHKFONT", 569 | kind: Command, 570 | }, 571 | { 572 | label: "SETFONT", 573 | kind: Command, 574 | }, 575 | { 576 | label: "GETFONT", 577 | kind: Command, 578 | }, 579 | { 580 | label: "FORCEKANA", 581 | kind: Command, 582 | }, 583 | { 584 | label: "ALIGNMENT", 585 | kind: Command, 586 | }, 587 | { 588 | label: "CURRENTALIGN", 589 | kind: Command, 590 | }, 591 | { 592 | label: "REDRAW", 593 | kind: Command, 594 | }, 595 | { 596 | label: "CURRENTREDRAW", 597 | kind: Command, 598 | }, 599 | { 600 | label: "PRINTCPERLINE", 601 | kind: Command, 602 | }, 603 | { 604 | label: "LINEISEMPTY", 605 | kind: Command, 606 | }, 607 | { 608 | label: "BARSTR", 609 | kind: Command, 610 | }, 611 | { 612 | label: "MONEYSTR", 613 | kind: Command, 614 | }, 615 | { 616 | label: "SKIPDISP", 617 | kind: Command, 618 | }, 619 | { 620 | label: "ISSKIP", 621 | kind: Command, 622 | }, 623 | { 624 | label: "MOUSESKIP", 625 | kind: Command, 626 | }, 627 | { 628 | label: "TOUPPER", 629 | kind: Command, 630 | }, 631 | { 632 | label: "TOLOWER", 633 | kind: Command, 634 | }, 635 | { 636 | label: "TOHALF", 637 | kind: Command, 638 | }, 639 | { 640 | label: "TOFULL", 641 | kind: Command, 642 | }, 643 | { 644 | label: "TOSTR", 645 | kind: Command, 646 | }, 647 | { 648 | label: "ISNUMERIC", 649 | kind: Command, 650 | }, 651 | { 652 | label: "TOINT", 653 | kind: Command, 654 | }, 655 | { 656 | label: "STRLEN", 657 | kind: Command, 658 | }, 659 | { 660 | label: "STRLENU", 661 | kind: Command, 662 | }, 663 | { 664 | label: "STRLENS", 665 | kind: Command, 666 | }, 667 | { 668 | label: "STRLENSU", 669 | kind: Command, 670 | }, 671 | { 672 | label: "STRLENFORM", 673 | kind: Command, 674 | }, 675 | { 676 | label: "STRLENFORMU", 677 | kind: Command, 678 | }, 679 | { 680 | label: "SUBSTRING", 681 | kind: Command, 682 | }, 683 | { 684 | label: "SUBSTRINGU", 685 | kind: Command, 686 | }, 687 | { 688 | label: "CHARATU", 689 | kind: Command, 690 | }, 691 | { 692 | label: "STRFIND", 693 | kind: Command, 694 | }, 695 | { 696 | label: "STRFINDU", 697 | kind: Command, 698 | }, 699 | { 700 | label: "STRCOUNT", 701 | kind: Command, 702 | }, 703 | { 704 | label: "SPLIT", 705 | kind: Command, 706 | }, 707 | { 708 | label: "REPLACE", 709 | kind: Command, 710 | }, 711 | { 712 | label: "ESCAPE", 713 | kind: Command, 714 | }, 715 | { 716 | label: "UNICODE", 717 | kind: Command, 718 | }, 719 | { 720 | label: "ENCODETOUNI", 721 | kind: Command, 722 | }, 723 | { 724 | label: "POWER", 725 | kind: Command, 726 | }, 727 | { 728 | label: "ABS", 729 | kind: Command, 730 | }, 731 | { 732 | label: "SIGN", 733 | kind: Command, 734 | }, 735 | { 736 | label: "SQRT", 737 | kind: Command, 738 | }, 739 | { 740 | label: "GETBIT", 741 | kind: Command, 742 | }, 743 | { 744 | label: "MAX", 745 | kind: Command, 746 | }, 747 | { 748 | label: "MIN", 749 | kind: Command, 750 | }, 751 | { 752 | label: "LIMIT", 753 | kind: Command, 754 | }, 755 | { 756 | label: "INRANGE", 757 | kind: Command, 758 | }, 759 | { 760 | label: "SETBIT", 761 | kind: Command, 762 | }, 763 | { 764 | label: "CLEARBIT", 765 | kind: Command, 766 | }, 767 | { 768 | label: "INVERTBIT", 769 | kind: Command, 770 | }, 771 | { 772 | label: "ADDCHARA", 773 | kind: Command, 774 | }, 775 | { 776 | label: "DELCHARA", 777 | kind: Command, 778 | }, 779 | { 780 | label: "SWAPCHARA", 781 | kind: Command, 782 | }, 783 | { 784 | label: "SORTCHARA", 785 | kind: Command, 786 | }, 787 | { 788 | label: "GETCHARA", 789 | kind: Command, 790 | }, 791 | { 792 | label: "ADDDEFCHARA", 793 | kind: Command, 794 | }, 795 | { 796 | label: "ADDVOIDCHARA", 797 | kind: Command, 798 | }, 799 | { 800 | label: "DELALLCHARA", 801 | kind: Command, 802 | }, 803 | { 804 | label: "PICKUPCHARA", 805 | kind: Command, 806 | }, 807 | { 808 | label: "EXISTCSV", 809 | kind: Command, 810 | }, 811 | { 812 | label: "FINDCHARA", 813 | kind: Command, 814 | }, 815 | { 816 | label: "FINDLASTCHARA", 817 | kind: Command, 818 | }, 819 | { 820 | label: "COPYCHARA", 821 | kind: Command, 822 | }, 823 | { 824 | label: "ADDCOPYCHARA", 825 | kind: Command, 826 | }, 827 | { 828 | label: "VARSIZE", 829 | kind: Command, 830 | }, 831 | { 832 | label: "RESETDATA", 833 | kind: Command, 834 | }, 835 | { 836 | label: "RESETGLOBAL", 837 | kind: Command, 838 | }, 839 | { 840 | label: "RESET_STAIN", 841 | kind: Command, 842 | }, 843 | { 844 | label: "SWAP", 845 | kind: Command, 846 | }, 847 | { 848 | label: "CSVNAME", 849 | kind: Command, 850 | }, 851 | { 852 | label: "CSVCALLNAME", 853 | kind: Command, 854 | }, 855 | { 856 | label: "CSVNICKNAME", 857 | kind: Command, 858 | }, 859 | { 860 | label: "CSVMASTERNAME", 861 | kind: Command, 862 | }, 863 | { 864 | label: "CSVBASE", 865 | kind: Command, 866 | }, 867 | { 868 | label: "CSVCSTR", 869 | kind: Command, 870 | }, 871 | { 872 | label: "CSVABL", 873 | kind: Command, 874 | }, 875 | { 876 | label: "CSVTALENT", 877 | kind: Command, 878 | }, 879 | { 880 | label: "CSVMARK", 881 | kind: Command, 882 | }, 883 | { 884 | label: "CSVEXP", 885 | kind: Command, 886 | }, 887 | { 888 | label: "CSVRELATION", 889 | kind: Command, 890 | }, 891 | { 892 | label: "CSVJUEL", 893 | kind: Command, 894 | }, 895 | { 896 | label: "CSVEQUIP", 897 | kind: Command, 898 | }, 899 | { 900 | label: "CSVCFLAG", 901 | kind: Command, 902 | }, 903 | { 904 | label: "GETNUM", 905 | kind: Command, 906 | }, 907 | { 908 | label: "GETPALAMLV", 909 | kind: Command, 910 | }, 911 | { 912 | label: "GETEXPLV", 913 | kind: Command, 914 | }, 915 | { 916 | label: "FINDELEMENT", 917 | kind: Command, 918 | }, 919 | { 920 | label: "FINDLASTELEMENT", 921 | kind: Command, 922 | }, 923 | { 924 | label: "VARSET", 925 | kind: Command, 926 | }, 927 | { 928 | label: "CVARSET", 929 | kind: Command, 930 | }, 931 | { 932 | label: "ARRAYSHIFT", 933 | kind: Command, 934 | }, 935 | { 936 | label: "ARRAYREMOVE", 937 | kind: Command, 938 | }, 939 | { 940 | label: "ARRAYSORT", 941 | kind: Command, 942 | }, 943 | { 944 | label: "ARRAYCOPY", 945 | kind: Command, 946 | }, 947 | { 948 | label: "CUPCHECK", 949 | kind: Command, 950 | }, 951 | { 952 | label: "SAVEDATA", 953 | kind: Command, 954 | }, 955 | { 956 | label: "LOADDATA", 957 | kind: Command, 958 | }, 959 | { 960 | label: "DELDATA", 961 | kind: Command, 962 | }, 963 | { 964 | label: "CHKDATA", 965 | kind: Command, 966 | }, 967 | { 968 | label: "SAVENOS", 969 | kind: Command, 970 | }, 971 | { 972 | label: "SAVEGLOBAL", 973 | kind: Command, 974 | }, 975 | { 976 | label: "LOADGLOBAL", 977 | kind: Command, 978 | }, 979 | { 980 | label: "OUTPUTLOG", 981 | kind: Command, 982 | }, 983 | { 984 | label: "SAVECHARA", 985 | kind: Command, 986 | }, 987 | { 988 | label: "LOADCHARA", 989 | kind: Command, 990 | }, 991 | { 992 | label: "CHKCHARADATA", 993 | kind: Command, 994 | }, 995 | { 996 | label: "FIND_CHARADATA", 997 | kind: Command, 998 | }, 999 | { 1000 | label: "GETTIME", 1001 | kind: Command, 1002 | }, 1003 | { 1004 | label: "GETMILLISECOND", 1005 | kind: Command, 1006 | }, 1007 | { 1008 | label: "GETSECOND", 1009 | kind: Command, 1010 | }, 1011 | { 1012 | label: "FORCEWAIT", 1013 | kind: Command, 1014 | }, 1015 | { 1016 | label: "INPUT", 1017 | kind: Command, 1018 | }, 1019 | { 1020 | label: "INPUTS", 1021 | kind: Command, 1022 | }, 1023 | { 1024 | label: "TINPUT", 1025 | kind: Command, 1026 | }, 1027 | { 1028 | label: "TINPUTS", 1029 | kind: Command, 1030 | }, 1031 | { 1032 | label: "TWAIT", 1033 | kind: Command, 1034 | }, 1035 | { 1036 | label: "ONEINPUT", 1037 | kind: Command, 1038 | }, 1039 | { 1040 | label: "ONEINPUTS", 1041 | kind: Command, 1042 | }, 1043 | { 1044 | label: "TONEINPUT", 1045 | kind: Command, 1046 | }, 1047 | { 1048 | label: "TONEINPUTS", 1049 | kind: Command, 1050 | }, 1051 | { 1052 | label: "WAITANYKEY", 1053 | kind: Command, 1054 | }, 1055 | { 1056 | label: "BREAK", 1057 | kind: Command, 1058 | }, 1059 | { 1060 | label: "CONTINUE", 1061 | kind: Command, 1062 | }, 1063 | { 1064 | label: "RANDOMIZE", 1065 | kind: Command, 1066 | }, 1067 | { 1068 | label: "DUMPRAND", 1069 | kind: Command, 1070 | }, 1071 | { 1072 | label: "INITRAND", 1073 | kind: Command, 1074 | }, 1075 | { 1076 | label: "BEGIN", 1077 | kind: Command, 1078 | }, 1079 | { 1080 | label: "CALLTRAIN", 1081 | kind: Command, 1082 | }, 1083 | { 1084 | label: "DOTRAIN", 1085 | kind: Command, 1086 | }, 1087 | { 1088 | label: "THROW", 1089 | kind: Command, 1090 | }, 1091 | { 1092 | label: "CALL", 1093 | kind: Command, 1094 | }, 1095 | { 1096 | label: "JUMP", 1097 | kind: Command, 1098 | }, 1099 | { 1100 | label: "GOTO", 1101 | kind: Command, 1102 | }, 1103 | { 1104 | label: "CALLFORM", 1105 | kind: Command, 1106 | }, 1107 | { 1108 | label: "JUMPFORM", 1109 | kind: Command, 1110 | }, 1111 | { 1112 | label: "GOTOFORM", 1113 | kind: Command, 1114 | }, 1115 | { 1116 | label: "TRYCALL", 1117 | kind: Command, 1118 | }, 1119 | { 1120 | label: "TRYJUMP", 1121 | kind: Command, 1122 | }, 1123 | { 1124 | label: "TRYGOTO", 1125 | kind: Command, 1126 | }, 1127 | { 1128 | label: "TRYCALLFORM", 1129 | kind: Command, 1130 | }, 1131 | { 1132 | label: "TRYJUMPFORM", 1133 | kind: Command, 1134 | }, 1135 | { 1136 | label: "TRYGOTOFORM", 1137 | kind: Command, 1138 | }, 1139 | { 1140 | label: "CALLF", 1141 | kind: Command, 1142 | }, 1143 | { 1144 | label: "CALLFORMF", 1145 | kind: Command, 1146 | }, 1147 | { 1148 | label: "CALLEVENT", 1149 | kind: Command, 1150 | }, 1151 | { 1152 | label: "FUNC", 1153 | kind: Command, 1154 | }, 1155 | { 1156 | label: "RETURN", 1157 | kind: Command, 1158 | }, 1159 | { 1160 | label: "RETURNFORM", 1161 | kind: Command, 1162 | }, 1163 | { 1164 | label: "RETURNF", 1165 | kind: Command, 1166 | }, 1167 | { 1168 | label: "DEBUGPRINT", 1169 | kind: Command, 1170 | }, 1171 | { 1172 | label: "DEBUGPRINTL", 1173 | kind: Command, 1174 | }, 1175 | { 1176 | label: "DEBUGPRINTFORM", 1177 | kind: Command, 1178 | }, 1179 | { 1180 | label: "DEBUGPRINTFORML", 1181 | kind: Command, 1182 | }, 1183 | { 1184 | label: "DEBUGCLEAR", 1185 | kind: Command, 1186 | }, 1187 | { 1188 | label: "ASSERT", 1189 | kind: Command, 1190 | }, 1191 | { 1192 | label: "TOOLTIP_SETCOLOR", 1193 | kind: Command, 1194 | }, 1195 | { 1196 | label: "TOOLTIP_SETDELAY", 1197 | kind: Command, 1198 | }, 1199 | { 1200 | label: "HTML_PRINT", 1201 | kind: Command, 1202 | }, 1203 | { 1204 | label: "HTML_TAGSPLIT", 1205 | kind: Command, 1206 | }, 1207 | { 1208 | label: "CLEARTEXTBOX", 1209 | kind: Command, 1210 | }, 1211 | { 1212 | label: "STOPCALLTRAIN", 1213 | kind: Command, 1214 | }, 1215 | { 1216 | label: "TIMES", 1217 | kind: Command, 1218 | }, 1219 | { 1220 | label: "BAR", 1221 | kind: Command, 1222 | }, 1223 | { 1224 | label: "BARL", 1225 | kind: Command, 1226 | }, 1227 | { 1228 | label: "PUTFORM", 1229 | kind: Command, 1230 | }, 1231 | { 1232 | label: "SAVEGAME", 1233 | kind: Command, 1234 | }, 1235 | { 1236 | label: "LOADGAME", 1237 | kind: Command, 1238 | }, 1239 | { 1240 | label: "WAIT", 1241 | kind: Command, 1242 | }, 1243 | { 1244 | label: "RESTART", 1245 | kind: Command, 1246 | }, 1247 | { 1248 | label: "QUIT", 1249 | kind: Command, 1250 | }, 1251 | { 1252 | label: "TOOLTIP_SETDURATION", 1253 | kind: Command, 1254 | }, 1255 | { 1256 | label: "AWAIT", 1257 | kind: Command, 1258 | }, 1259 | { 1260 | label: "STRJOIN", 1261 | kind: Function, 1262 | }, 1263 | { 1264 | label: "GETKEY", 1265 | kind: Function, 1266 | }, 1267 | { 1268 | label: "GETKEYTRIGGERED", 1269 | kind: Function, 1270 | }, 1271 | { 1272 | label: "MOUSEX", 1273 | kind: Function, 1274 | }, 1275 | { 1276 | label: "MOUSEY", 1277 | kind: Function, 1278 | }, 1279 | { 1280 | label: "ISACTIVE", 1281 | kind: Function, 1282 | }, 1283 | { 1284 | label: "SAVETEXT", 1285 | kind: Function, 1286 | }, 1287 | { 1288 | label: "LOADTEXT", 1289 | kind: Function, 1290 | }, 1291 | { 1292 | label: "SPRITECREATED", 1293 | kind: Function, 1294 | }, 1295 | { 1296 | label: "SPRITEWIDTH", 1297 | kind: Function, 1298 | }, 1299 | { 1300 | label: "SPRITEHEIGHT", 1301 | kind: Function, 1302 | }, 1303 | { 1304 | label: "SPRITEPOSX", 1305 | kind: Function, 1306 | }, 1307 | { 1308 | label: "SPRITEPOSY", 1309 | kind: Function, 1310 | }, 1311 | { 1312 | label: "SPRITESETPOS", 1313 | kind: Function, 1314 | }, 1315 | { 1316 | label: "SPRITEMOVE", 1317 | kind: Function, 1318 | }, 1319 | { 1320 | label: "ARRAYMSORT", 1321 | kind: Function, 1322 | }, 1323 | { 1324 | label: "GCREATED", 1325 | kind: Function, 1326 | }, 1327 | { 1328 | label: "GWIDTH", 1329 | kind: Function, 1330 | }, 1331 | { 1332 | label: "GHEIGHT", 1333 | kind: Function, 1334 | }, 1335 | { 1336 | label: "GGETCOLOR", 1337 | kind: Function, 1338 | }, 1339 | { 1340 | label: "GCREATE", 1341 | kind: Function, 1342 | }, 1343 | { 1344 | label: "GCREATEFROMFILE", 1345 | kind: Function, 1346 | }, 1347 | { 1348 | label: "GDISPOSE", 1349 | kind: Function, 1350 | }, 1351 | { 1352 | label: "GCLEAR", 1353 | kind: Function, 1354 | }, 1355 | { 1356 | label: "GFILLRECTANGLE", 1357 | kind: Function, 1358 | }, 1359 | { 1360 | label: "GDRAWSPRITE", 1361 | kind: Function, 1362 | }, 1363 | { 1364 | label: "GSETCOLOR", 1365 | kind: Function, 1366 | }, 1367 | { 1368 | label: "GDRAWG", 1369 | kind: Function, 1370 | }, 1371 | { 1372 | label: "GDRAWGWITHMASK", 1373 | kind: Function, 1374 | }, 1375 | { 1376 | label: "GSETBRUSH", 1377 | kind: Function, 1378 | }, 1379 | { 1380 | label: "GSETFONT", 1381 | kind: Function, 1382 | }, 1383 | { 1384 | label: "GSETPEN", 1385 | kind: Function, 1386 | }, 1387 | { 1388 | label: "GSAVE", 1389 | kind: Function, 1390 | }, 1391 | { 1392 | label: "GLOAD", 1393 | kind: Function, 1394 | }, 1395 | { 1396 | label: "SPRITECREATE", 1397 | kind: Function, 1398 | }, 1399 | { 1400 | label: "SPRITEANIMECREATE", 1401 | kind: Function, 1402 | }, 1403 | { 1404 | label: "SPRITEANIMEADDFRAME", 1405 | kind: Function, 1406 | }, 1407 | { 1408 | label: "SPRITEDISPOSE", 1409 | kind: Function, 1410 | }, 1411 | { 1412 | label: "SPRITEGETCOLOR", 1413 | kind: Function, 1414 | }, 1415 | { 1416 | label: "CBGSETG", 1417 | kind: Function, 1418 | }, 1419 | { 1420 | label: "CBGSETSPRITE", 1421 | kind: Function, 1422 | }, 1423 | { 1424 | label: "CBGCLEAR", 1425 | kind: Function, 1426 | }, 1427 | { 1428 | label: "CBGREMOVERANGE", 1429 | kind: Function, 1430 | }, 1431 | { 1432 | label: "CBGSETBUTTONSPRITE", 1433 | kind: Function, 1434 | }, 1435 | { 1436 | label: "CBGCLEARBUTTON", 1437 | kind: Function, 1438 | }, 1439 | { 1440 | label: "CBGSETBMAPG", 1441 | kind: Function, 1442 | }, 1443 | { 1444 | label: "CBGREMOVEBMAP", 1445 | kind: Function, 1446 | }, 1447 | { 1448 | label: "INPUTMOUSEKEY", 1449 | kind: Command, 1450 | }, 1451 | { 1452 | label: "SETANIMETIMER", 1453 | kind: Command, 1454 | }, 1455 | { 1456 | label: "GETTIMES", 1457 | kind: Function, 1458 | }, 1459 | { 1460 | label: "RAND", 1461 | kind: Function, 1462 | }, 1463 | { 1464 | label: "CBRT", 1465 | kind: Function, 1466 | }, 1467 | { 1468 | label: "LOG", 1469 | kind: Function, 1470 | }, 1471 | { 1472 | label: "LOG10", 1473 | kind: Function, 1474 | }, 1475 | { 1476 | label: "EXPONENT", 1477 | kind: Function, 1478 | }, 1479 | { 1480 | label: "SUMARRAY", 1481 | kind: Function, 1482 | }, 1483 | { 1484 | label: "MATCH", 1485 | kind: Function, 1486 | }, 1487 | { 1488 | label: "MAXARRAY", 1489 | kind: Function, 1490 | }, 1491 | { 1492 | label: "MINARRAY", 1493 | kind: Function, 1494 | }, 1495 | { 1496 | label: "SUMCARRAY", 1497 | kind: Function, 1498 | }, 1499 | { 1500 | label: "CMATCH", 1501 | kind: Function, 1502 | }, 1503 | { 1504 | label: "MAXCARRAY", 1505 | kind: Function, 1506 | }, 1507 | { 1508 | label: "MINCARRAY", 1509 | kind: Function, 1510 | }, 1511 | { 1512 | label: "GROUPMATCH", 1513 | kind: Function, 1514 | }, 1515 | { 1516 | label: "NOSAMES", 1517 | kind: Function, 1518 | }, 1519 | { 1520 | label: "ALLSAMES", 1521 | kind: Function, 1522 | }, 1523 | { 1524 | label: "MESSKIP", 1525 | kind: Function, 1526 | }, 1527 | { 1528 | label: "CONVERT", 1529 | kind: Function, 1530 | }, 1531 | { 1532 | label: "COLOR_FROMNAME", 1533 | kind: Function, 1534 | }, 1535 | { 1536 | label: "COLOR_FROMRGB", 1537 | kind: Function, 1538 | }, 1539 | { 1540 | label: "INRANGEARRAY", 1541 | kind: Function, 1542 | }, 1543 | { 1544 | label: "INRANGECARRAY", 1545 | kind: Function, 1546 | }, 1547 | { 1548 | label: "GETLINESTR", 1549 | kind: Function, 1550 | }, 1551 | { 1552 | label: "PRINTCLENGTH", 1553 | kind: Function, 1554 | }, 1555 | { 1556 | label: "STRFORM", 1557 | kind: Function, 1558 | }, 1559 | { 1560 | label: "GETCONFIG", 1561 | kind: Function, 1562 | }, 1563 | { 1564 | label: "GETCONFIGS", 1565 | kind: Function, 1566 | }, 1567 | { 1568 | label: "HTML_POPPRINTINGSTR", 1569 | kind: Function, 1570 | }, 1571 | { 1572 | label: "HTML_GETPRINTEDSTR", 1573 | kind: Function, 1574 | }, 1575 | { 1576 | label: "HTML_ESCAPE", 1577 | kind: Function, 1578 | }, 1579 | { 1580 | label: "HTML_TOPLAINTEXT", 1581 | kind: Function, 1582 | }, 1583 | { 1584 | label: "CLIENTWIDTH", 1585 | kind: Function, 1586 | }, 1587 | { 1588 | label: "CLIENTHEIGHT", 1589 | kind: Function, 1590 | }, 1591 | { 1592 | label: "PRINTDATA", 1593 | kind: Control, 1594 | }, 1595 | { 1596 | label: "PRINTDATAL", 1597 | kind: Control, 1598 | }, 1599 | { 1600 | label: "PRINTDATAW", 1601 | kind: Control, 1602 | }, 1603 | { 1604 | label: "PRINTDATAK", 1605 | kind: Control, 1606 | }, 1607 | { 1608 | label: "PRINTDATAKL", 1609 | kind: Control, 1610 | }, 1611 | { 1612 | label: "PRINTDATAKW", 1613 | kind: Control, 1614 | }, 1615 | { 1616 | label: "PRINTDATAD", 1617 | kind: Control, 1618 | }, 1619 | { 1620 | label: "PRINTDATADL", 1621 | kind: Control, 1622 | }, 1623 | { 1624 | label: "PRINTDATADW", 1625 | kind: Control, 1626 | }, 1627 | { 1628 | label: "STRDATA", 1629 | kind: Control, 1630 | }, 1631 | { 1632 | label: "ENDDATA", 1633 | kind: Control, 1634 | }, 1635 | { 1636 | label: "DATALIST", 1637 | kind: Control, 1638 | }, 1639 | { 1640 | label: "ENDLIST", 1641 | kind: Control, 1642 | }, 1643 | { 1644 | label: "NOSKIP", 1645 | kind: Control, 1646 | }, 1647 | { 1648 | label: "ENDNOSKIP", 1649 | kind: Control, 1650 | }, 1651 | { 1652 | label: "SIF", 1653 | kind: Control, 1654 | }, 1655 | { 1656 | label: "IF", 1657 | kind: Control, 1658 | }, 1659 | { 1660 | label: "ELSEIF", 1661 | kind: Control, 1662 | }, 1663 | { 1664 | label: "ELSE", 1665 | kind: Control, 1666 | }, 1667 | { 1668 | label: "ENDIF", 1669 | kind: Control, 1670 | }, 1671 | { 1672 | label: "REPEAT", 1673 | kind: Control, 1674 | }, 1675 | { 1676 | label: "REND", 1677 | kind: Control, 1678 | }, 1679 | { 1680 | label: "FOR", 1681 | kind: Control, 1682 | }, 1683 | { 1684 | label: "NEXT", 1685 | kind: Control, 1686 | }, 1687 | { 1688 | label: "WHILE", 1689 | kind: Control, 1690 | }, 1691 | { 1692 | label: "WEND", 1693 | kind: Control, 1694 | }, 1695 | { 1696 | label: "DO", 1697 | kind: Control, 1698 | }, 1699 | { 1700 | label: "LOOP", 1701 | kind: Control, 1702 | }, 1703 | { 1704 | label: "SELECTCASE", 1705 | kind: Control, 1706 | }, 1707 | { 1708 | label: "CASE", 1709 | kind: Control, 1710 | }, 1711 | { 1712 | label: "IS", 1713 | kind: Control, 1714 | }, 1715 | { 1716 | label: "TO", 1717 | kind: Control, 1718 | }, 1719 | { 1720 | label: "CASEELSE", 1721 | kind: Control, 1722 | }, 1723 | { 1724 | label: "ENDSELECT", 1725 | kind: Control, 1726 | }, 1727 | { 1728 | label: "TRYCJUMP", 1729 | kind: Control, 1730 | }, 1731 | { 1732 | label: "TRYCCALL", 1733 | kind: Control, 1734 | }, 1735 | { 1736 | label: "TRYCGOTO", 1737 | kind: Control, 1738 | }, 1739 | { 1740 | label: "TRYCJUMPFORM", 1741 | kind: Control, 1742 | }, 1743 | { 1744 | label: "TRYCCALLFORM", 1745 | kind: Control, 1746 | }, 1747 | { 1748 | label: "TRYCGOTOFORM", 1749 | kind: Control, 1750 | }, 1751 | { 1752 | label: "CATCH", 1753 | kind: Control, 1754 | }, 1755 | { 1756 | label: "ENDCATCH", 1757 | kind: Control, 1758 | }, 1759 | { 1760 | label: "TRYCALLLIST", 1761 | kind: Control, 1762 | }, 1763 | { 1764 | label: "TRYJUMPLIST", 1765 | kind: Control, 1766 | }, 1767 | { 1768 | label: "TRYGOTOLIST", 1769 | kind: Control, 1770 | }, 1771 | { 1772 | label: "ENDFUNC", 1773 | kind: Control, 1774 | }, 1775 | { 1776 | label: "#DIM", 1777 | kind: Keyword, 1778 | }, 1779 | { 1780 | label: "#DIMS", 1781 | kind: Keyword, 1782 | }, 1783 | { 1784 | label: "#SINGLE", 1785 | kind: Keyword, 1786 | }, 1787 | { 1788 | label: "#PRI", 1789 | kind: Keyword, 1790 | }, 1791 | { 1792 | label: "#LATER", 1793 | kind: Keyword, 1794 | }, 1795 | { 1796 | label: "#ONLY", 1797 | kind: Keyword, 1798 | }, 1799 | { 1800 | label: "#FUNCTION", 1801 | kind: Keyword, 1802 | }, 1803 | { 1804 | label: "#FUNCTIONS", 1805 | kind: Keyword, 1806 | }, 1807 | { 1808 | label: "#LOCALSIZE", 1809 | kind: Keyword, 1810 | }, 1811 | { 1812 | label: "#LOCALSSIZE", 1813 | kind: Keyword, 1814 | }, 1815 | { 1816 | label: "#DEFINE", 1817 | kind: Keyword, 1818 | }, 1819 | { 1820 | label: "IF_DEBUG", 1821 | kind: Keyword, 1822 | }, 1823 | { 1824 | label: "IF_NDEBUG", 1825 | kind: Keyword, 1826 | }, 1827 | { 1828 | label: "SKIPSTART", 1829 | kind: Keyword, 1830 | }, 1831 | { 1832 | label: "SKIPEND", 1833 | kind: Keyword, 1834 | }, 1835 | { 1836 | label: "SAVEDATA", 1837 | kind: Keyword, 1838 | }, 1839 | { 1840 | label: "CHARADATA", 1841 | kind: Keyword, 1842 | }, 1843 | { 1844 | label: "GLOBAL", 1845 | kind: Keyword, 1846 | }, 1847 | { 1848 | label: "DYNAMIC", 1849 | kind: Keyword, 1850 | }, 1851 | { 1852 | label: "STATIC", 1853 | kind: Keyword, 1854 | }, 1855 | { 1856 | label: "CONST", 1857 | kind: Keyword, 1858 | }, 1859 | { 1860 | label: "REF", 1861 | kind: Keyword, 1862 | }, 1863 | { 1864 | label: "SHOP", 1865 | kind: Keyword, 1866 | }, 1867 | { 1868 | label: "TRAIN", 1869 | kind: Keyword, 1870 | }, 1871 | { 1872 | label: "ABLUP", 1873 | kind: Keyword, 1874 | }, 1875 | { 1876 | label: "AFTERTRAIN", 1877 | kind: Keyword, 1878 | }, 1879 | { 1880 | label: "TURNEND", 1881 | kind: Keyword, 1882 | }, 1883 | { 1884 | label: "FIRST", 1885 | kind: Keyword, 1886 | }, 1887 | { 1888 | label: "TITLE", 1889 | kind: Keyword, 1890 | }, 1891 | { 1892 | label: "LEFT", 1893 | kind: Keyword, 1894 | }, 1895 | { 1896 | label: "CENTER", 1897 | kind: Keyword, 1898 | }, 1899 | { 1900 | label: "RIGHT", 1901 | kind: Keyword, 1902 | }, 1903 | { 1904 | label: "FORWARD", 1905 | kind: Keyword, 1906 | }, 1907 | { 1908 | label: "BACK", 1909 | kind: Keyword, 1910 | }, 1911 | { 1912 | label: "DAY", 1913 | kind: Variable, 1914 | }, 1915 | { 1916 | label: "MONEY", 1917 | kind: Variable, 1918 | }, 1919 | { 1920 | label: "ITEM", 1921 | kind: Variable, 1922 | }, 1923 | { 1924 | label: "FLAG", 1925 | kind: Variable, 1926 | }, 1927 | { 1928 | label: "TFLAG", 1929 | kind: Variable, 1930 | }, 1931 | { 1932 | label: "UP", 1933 | kind: Variable, 1934 | }, 1935 | { 1936 | label: "PALAMLV", 1937 | kind: Variable, 1938 | }, 1939 | { 1940 | label: "EXPLV", 1941 | kind: Variable, 1942 | }, 1943 | { 1944 | label: "EJAC", 1945 | kind: Variable, 1946 | }, 1947 | { 1948 | label: "DOWN", 1949 | kind: Variable, 1950 | }, 1951 | { 1952 | label: "RESULT", 1953 | kind: Variable, 1954 | }, 1955 | { 1956 | label: "COUNT", 1957 | kind: Variable, 1958 | }, 1959 | { 1960 | label: "TARGET", 1961 | kind: Variable, 1962 | }, 1963 | { 1964 | label: "ASSI", 1965 | kind: Variable, 1966 | }, 1967 | { 1968 | label: "MASTER", 1969 | kind: Variable, 1970 | }, 1971 | { 1972 | label: "NOITEM", 1973 | kind: Variable, 1974 | }, 1975 | { 1976 | label: "LOSEBASE", 1977 | kind: Variable, 1978 | }, 1979 | { 1980 | label: "SELECTCOM", 1981 | kind: Variable, 1982 | }, 1983 | { 1984 | label: "ASSIPLAY", 1985 | kind: Variable, 1986 | }, 1987 | { 1988 | label: "PREVCOM", 1989 | kind: Variable, 1990 | }, 1991 | { 1992 | label: "TIME", 1993 | kind: Variable, 1994 | }, 1995 | { 1996 | label: "ITEMSALES", 1997 | kind: Variable, 1998 | }, 1999 | { 2000 | label: "PLAYER", 2001 | kind: Variable, 2002 | }, 2003 | { 2004 | label: "NEXTCOM", 2005 | kind: Variable, 2006 | }, 2007 | { 2008 | label: "PBAND", 2009 | kind: Variable, 2010 | }, 2011 | { 2012 | label: "BOUGHT", 2013 | kind: Variable, 2014 | }, 2015 | { 2016 | label: "A", 2017 | kind: Variable, 2018 | }, 2019 | { 2020 | label: "B", 2021 | kind: Variable, 2022 | }, 2023 | { 2024 | label: "C", 2025 | kind: Variable, 2026 | }, 2027 | { 2028 | label: "D", 2029 | kind: Variable, 2030 | }, 2031 | { 2032 | label: "E", 2033 | kind: Variable, 2034 | }, 2035 | { 2036 | label: "F", 2037 | kind: Variable, 2038 | }, 2039 | { 2040 | label: "G", 2041 | kind: Variable, 2042 | }, 2043 | { 2044 | label: "H", 2045 | kind: Variable, 2046 | }, 2047 | { 2048 | label: "I", 2049 | kind: Variable, 2050 | }, 2051 | { 2052 | label: "J", 2053 | kind: Variable, 2054 | }, 2055 | { 2056 | label: "K", 2057 | kind: Variable, 2058 | }, 2059 | { 2060 | label: "L", 2061 | kind: Variable, 2062 | }, 2063 | { 2064 | label: "M", 2065 | kind: Variable, 2066 | }, 2067 | { 2068 | label: "N", 2069 | kind: Variable, 2070 | }, 2071 | { 2072 | label: "O", 2073 | kind: Variable, 2074 | }, 2075 | { 2076 | label: "P", 2077 | kind: Variable, 2078 | }, 2079 | { 2080 | label: "Q", 2081 | kind: Variable, 2082 | }, 2083 | { 2084 | label: "R", 2085 | kind: Variable, 2086 | }, 2087 | { 2088 | label: "S", 2089 | kind: Variable, 2090 | }, 2091 | { 2092 | label: "T", 2093 | kind: Variable, 2094 | }, 2095 | { 2096 | label: "U", 2097 | kind: Variable, 2098 | }, 2099 | { 2100 | label: "V", 2101 | kind: Variable, 2102 | }, 2103 | { 2104 | label: "W", 2105 | kind: Variable, 2106 | }, 2107 | { 2108 | label: "X", 2109 | kind: Variable, 2110 | }, 2111 | { 2112 | label: "Y", 2113 | kind: Variable, 2114 | }, 2115 | { 2116 | label: "Z", 2117 | kind: Variable, 2118 | }, 2119 | { 2120 | label: "GLOBAL", 2121 | kind: Variable, 2122 | }, 2123 | { 2124 | label: "RANDDATA", 2125 | kind: Variable, 2126 | }, 2127 | { 2128 | label: "SAVESTR", 2129 | kind: Variable, 2130 | }, 2131 | { 2132 | label: "TSTR", 2133 | kind: Variable, 2134 | }, 2135 | { 2136 | label: "STR", 2137 | kind: Variable, 2138 | }, 2139 | { 2140 | label: "RESULTS", 2141 | kind: Variable, 2142 | }, 2143 | { 2144 | label: "GLOBALS", 2145 | kind: Variable, 2146 | }, 2147 | { 2148 | label: "SAVEDATA_TEXT", 2149 | kind: Variable, 2150 | }, 2151 | { 2152 | label: "ISASSI", 2153 | kind: Variable, 2154 | }, 2155 | { 2156 | label: "NO", 2157 | kind: Variable, 2158 | }, 2159 | { 2160 | label: "BASE", 2161 | kind: Variable, 2162 | }, 2163 | { 2164 | label: "MAXBASE", 2165 | kind: Variable, 2166 | }, 2167 | { 2168 | label: "ABL", 2169 | kind: Variable, 2170 | }, 2171 | { 2172 | label: "TALENT", 2173 | kind: Variable, 2174 | }, 2175 | { 2176 | label: "EXP", 2177 | kind: Variable, 2178 | }, 2179 | { 2180 | label: "MARK", 2181 | kind: Variable, 2182 | }, 2183 | { 2184 | label: "PALAM", 2185 | kind: Variable, 2186 | }, 2187 | { 2188 | label: "SOURCE", 2189 | kind: Variable, 2190 | }, 2191 | { 2192 | label: "EX", 2193 | kind: Variable, 2194 | }, 2195 | { 2196 | label: "CFLAG", 2197 | kind: Variable, 2198 | }, 2199 | { 2200 | label: "JUEL", 2201 | kind: Variable, 2202 | }, 2203 | { 2204 | label: "RELATION", 2205 | kind: Variable, 2206 | }, 2207 | { 2208 | label: "EQUIP", 2209 | kind: Variable, 2210 | }, 2211 | { 2212 | label: "TEQUIP", 2213 | kind: Variable, 2214 | }, 2215 | { 2216 | label: "STAIN", 2217 | kind: Variable, 2218 | }, 2219 | { 2220 | label: "GOTJUEL", 2221 | kind: Variable, 2222 | }, 2223 | { 2224 | label: "NOWEX", 2225 | kind: Variable, 2226 | }, 2227 | { 2228 | label: "DOWNBASE", 2229 | kind: Variable, 2230 | }, 2231 | { 2232 | label: "CUP", 2233 | kind: Variable, 2234 | }, 2235 | { 2236 | label: "CDOWN", 2237 | kind: Variable, 2238 | }, 2239 | { 2240 | label: "TCVAR", 2241 | kind: Variable, 2242 | }, 2243 | { 2244 | label: "NAME", 2245 | kind: Variable, 2246 | }, 2247 | { 2248 | label: "CALLNAME", 2249 | kind: Variable, 2250 | }, 2251 | { 2252 | label: "NICKNAME", 2253 | kind: Variable, 2254 | }, 2255 | { 2256 | label: "MASTERNAME", 2257 | kind: Variable, 2258 | }, 2259 | { 2260 | label: "CSTR", 2261 | kind: Variable, 2262 | }, 2263 | { 2264 | label: "CDFLAG", 2265 | kind: Variable, 2266 | }, 2267 | { 2268 | label: "DITEMTYPE", 2269 | kind: Variable, 2270 | }, 2271 | { 2272 | label: "DA", 2273 | kind: Variable, 2274 | }, 2275 | { 2276 | label: "DB", 2277 | kind: Variable, 2278 | }, 2279 | { 2280 | label: "DC", 2281 | kind: Variable, 2282 | }, 2283 | { 2284 | label: "DD", 2285 | kind: Variable, 2286 | }, 2287 | { 2288 | label: "DE", 2289 | kind: Variable, 2290 | }, 2291 | { 2292 | label: "TA", 2293 | kind: Variable, 2294 | }, 2295 | { 2296 | label: "TB", 2297 | kind: Variable, 2298 | }, 2299 | { 2300 | label: "ITEMPRICE", 2301 | kind: Variable, 2302 | }, 2303 | { 2304 | label: "ABLNAME", 2305 | kind: Variable, 2306 | }, 2307 | { 2308 | label: "TALENTNAME", 2309 | kind: Variable, 2310 | }, 2311 | { 2312 | label: "EXPNAME", 2313 | kind: Variable, 2314 | }, 2315 | { 2316 | label: "MARKNAME", 2317 | kind: Variable, 2318 | }, 2319 | { 2320 | label: "PALAMNAME", 2321 | kind: Variable, 2322 | }, 2323 | { 2324 | label: "ITEMNAME", 2325 | kind: Variable, 2326 | }, 2327 | { 2328 | label: "TRAINNAME", 2329 | kind: Variable, 2330 | }, 2331 | { 2332 | label: "BASENAME", 2333 | kind: Variable, 2334 | }, 2335 | { 2336 | label: "SOURCENAME", 2337 | kind: Variable, 2338 | }, 2339 | { 2340 | label: "EXNAME", 2341 | kind: Variable, 2342 | }, 2343 | { 2344 | label: "EQUIPNAME", 2345 | kind: Variable, 2346 | }, 2347 | { 2348 | label: "TEQUIPNAME", 2349 | kind: Variable, 2350 | }, 2351 | { 2352 | label: "FLAGNAME", 2353 | kind: Variable, 2354 | }, 2355 | { 2356 | label: "TFLAGNAME", 2357 | kind: Variable, 2358 | }, 2359 | { 2360 | label: "CFLAGNAME", 2361 | kind: Variable, 2362 | }, 2363 | { 2364 | label: "TCVARNAME", 2365 | kind: Variable, 2366 | }, 2367 | { 2368 | label: "CSTRNAME", 2369 | kind: Variable, 2370 | }, 2371 | { 2372 | label: "STAINNAME", 2373 | kind: Variable, 2374 | }, 2375 | { 2376 | label: "CDFLAGNAME1", 2377 | kind: Variable, 2378 | }, 2379 | { 2380 | label: "CDFLAGNAME2", 2381 | kind: Variable, 2382 | }, 2383 | { 2384 | label: "STRNAME", 2385 | kind: Variable, 2386 | }, 2387 | { 2388 | label: "TSTRNAME", 2389 | kind: Variable, 2390 | }, 2391 | { 2392 | label: "SAVESTRNAME", 2393 | kind: Variable, 2394 | }, 2395 | { 2396 | label: "GLOBALNAME", 2397 | kind: Variable, 2398 | }, 2399 | { 2400 | label: "GLOBALSNAME", 2401 | kind: Variable, 2402 | }, 2403 | { 2404 | label: "GAMEBASE_AUTHER", 2405 | kind: Variable, 2406 | }, 2407 | { 2408 | label: "GAMEBASE_AUTHOR", 2409 | kind: Variable, 2410 | }, 2411 | { 2412 | label: "GAMEBASE_INFO", 2413 | kind: Variable, 2414 | }, 2415 | { 2416 | label: "GAMEBASE_YEAR", 2417 | kind: Variable, 2418 | }, 2419 | { 2420 | label: "GAMEBASE_TITLE", 2421 | kind: Variable, 2422 | }, 2423 | { 2424 | label: "GAMEBASE_GAMECODE", 2425 | kind: Variable, 2426 | }, 2427 | { 2428 | label: "GAMEBASE_VERSION", 2429 | kind: Variable, 2430 | }, 2431 | { 2432 | label: "GAMEBASE_ALLOWVERSION", 2433 | kind: Variable, 2434 | }, 2435 | { 2436 | label: "GAMEBASE_DEFAULTCHARA", 2437 | kind: Variable, 2438 | }, 2439 | { 2440 | label: "GAMEBASE_NOITEM", 2441 | kind: Variable, 2442 | }, 2443 | { 2444 | label: "RAND", 2445 | kind: Variable, 2446 | }, 2447 | { 2448 | label: "CHARANUM", 2449 | kind: Variable, 2450 | }, 2451 | { 2452 | label: "LASTLOAD_TEXT", 2453 | kind: Variable, 2454 | }, 2455 | { 2456 | label: "LASTLOAD_VERSION", 2457 | kind: Variable, 2458 | }, 2459 | { 2460 | label: "LASTLOAD_NO", 2461 | kind: Variable, 2462 | }, 2463 | { 2464 | label: "LINECOUNT", 2465 | kind: Variable, 2466 | }, 2467 | { 2468 | label: "ISTIMEOUT", 2469 | kind: Variable, 2470 | }, 2471 | { 2472 | label: "__INT_MAX__", 2473 | kind: Variable, 2474 | }, 2475 | { 2476 | label: "__INT_MIN__", 2477 | kind: Variable, 2478 | }, 2479 | { 2480 | label: "EMUERA_VERSION", 2481 | kind: Variable, 2482 | }, 2483 | { 2484 | label: "WINDOW_TITLE", 2485 | kind: Variable, 2486 | }, 2487 | { 2488 | label: "MONEYLABEL", 2489 | kind: Variable, 2490 | }, 2491 | { 2492 | label: "DRAWLINESTR", 2493 | kind: Variable, 2494 | }, 2495 | { 2496 | label: "__FILE__", 2497 | kind: Variable, 2498 | }, 2499 | { 2500 | label: "__FUNCTION__", 2501 | kind: Variable, 2502 | }, 2503 | { 2504 | label: "__LINE__", 2505 | kind: Variable, 2506 | }, 2507 | { 2508 | label: "LOCAL", 2509 | kind: Variable, 2510 | }, 2511 | { 2512 | label: "ARG", 2513 | kind: Variable, 2514 | }, 2515 | { 2516 | label: "LOCALS", 2517 | kind: Variable, 2518 | }, 2519 | { 2520 | label: "ARGS", 2521 | kind: Variable, 2522 | }, 2523 | ]); 2524 | -------------------------------------------------------------------------------- /src/declaration.ts: -------------------------------------------------------------------------------- 1 | import * as fs from "fs"; 2 | import * as iconv from "iconv-lite"; 3 | import * as vscode from "vscode"; 4 | 5 | import { Disposable, Event, EventEmitter, ExtensionContext, Position, Range, SymbolKind, Uri, WorkspaceFolder } from "vscode"; 6 | 7 | export class Declaration { 8 | constructor( 9 | public name: string, 10 | public kind: SymbolKind, 11 | public container: Declaration | undefined, 12 | public nameRange: Range, 13 | public bodyRange: Range) { 14 | } 15 | 16 | get isGlobal(): boolean { 17 | return this.container === undefined; 18 | } 19 | 20 | public visible(position: Position): boolean { 21 | return this.container === undefined || this.container.bodyRange.contains(position); 22 | } 23 | } 24 | 25 | function* iterlines(input: string): IterableIterator<[number, string]> { 26 | const lines = input.split(/\r?\n/); 27 | loop: for (let i = 0; i < lines.length; i++) { 28 | const text = lines[i]; 29 | if (/^\s*(?:$|;(?![!#];))/.test(text)) { 30 | continue; 31 | } 32 | if (/^\s*(?:;[!#];\s*)?\[SKIPSTART\]/.test(text)) { 33 | for (i++; i < lines.length; i++) { 34 | if (/^\s*(?:;[!#];\s*)?\[SKIPEND\]/.test(lines[i])) { 35 | continue loop; 36 | } 37 | } 38 | break; 39 | } 40 | yield [i, text]; 41 | } 42 | } 43 | 44 | export function readDeclarations(input: string): Declaration[] { 45 | const symbols: Declaration[] = []; 46 | let funcStart: Declaration; 47 | let funcEndLine: number; 48 | let funcEndChar: number; 49 | for (const [line, text] of iterlines(input)) { 50 | { 51 | const match = /^\s*@([^\s\x21-\x2f\x3a-\x40\x5b-\x5e\x7b-\x7e]+)/.exec(text); 52 | if (match !== null) { 53 | if (funcStart !== undefined) { 54 | funcStart.bodyRange = funcStart.bodyRange.with({ end: new Position(funcEndLine, funcEndChar) }); 55 | } 56 | funcStart = new Declaration( 57 | match[1], 58 | SymbolKind.Function, 59 | undefined, 60 | new Range(line, match[0].length - match[1].length, line, match[0].length), 61 | new Range(line, 0, line, text.length), 62 | ); 63 | symbols.push(funcStart); 64 | continue; 65 | } 66 | funcEndLine = line; 67 | funcEndChar = text.length; 68 | } 69 | { 70 | const match = /^\s*#(DIMS?(?:\s+[A-Z]+)*|DEFINE)\s+([^\s\x21-\x2f\x3a-\x40\x5b-\x5e\x7b-\x7e]+)/.exec(text); 71 | if (match !== null) { 72 | symbols.push(new Declaration( 73 | match[2], 74 | match[1].startsWith("DIM") ? SymbolKind.Variable : SymbolKind.Constant, 75 | funcStart, 76 | new Range(line, match[0].length - match[2].length, line, match[0].length), 77 | new Range(line, 0, line, text.length), 78 | )); 79 | continue; 80 | } 81 | } 82 | } 83 | if (funcStart !== undefined) { 84 | funcStart.bodyRange = funcStart.bodyRange.with({ end: new Position(funcEndLine, funcEndChar) }); 85 | } 86 | return symbols; 87 | } 88 | 89 | class BuiltinDeclarationFiles { 90 | private files: Uri[]; 91 | 92 | constructor(context: ExtensionContext) { 93 | // 他の拡張でも管理下のファイルを直接開くケースがまま見られるため良しとする 94 | this.files = [ 95 | Uri.joinPath(context.extensionUri, "emuera", "exmeth.erb"), 96 | Uri.joinPath(context.extensionUri, "emuera", "exvar.erh"), 97 | ]; 98 | } 99 | 100 | public has(path: string): boolean { 101 | return this.files.find((uri) => uri.fsPath === path) !== undefined; 102 | } 103 | 104 | public uris(): Uri[] { 105 | return this.files; 106 | } 107 | } 108 | 109 | class WorkspaceEncoding { 110 | private encoding: string[][]; 111 | 112 | constructor() { 113 | this.reset(); 114 | } 115 | 116 | public detect(path: string, data: Buffer): string { 117 | if (data[0] === 0xef && data[1] === 0xbb && data[2] === 0xbf) { 118 | return "utf8"; 119 | } 120 | if (data[0] === 0xff && data[1] === 0xfe) { 121 | return "utf16le"; 122 | } 123 | if (data[0] === 0xfe && data[1] === 0xff) { 124 | return "utf16be"; 125 | } 126 | return this.encoding.find((v) => path.startsWith(v[0]))[1]; 127 | } 128 | 129 | public reset() { 130 | this.encoding = []; 131 | for (const folder of vscode.workspace.workspaceFolders) { 132 | this.encoding.push([folder.uri.fsPath, this.getConfiguration(folder.uri)]); 133 | } 134 | } 135 | 136 | private getConfiguration(uri: Uri): string { 137 | const encoding: string = vscode.workspace.getConfiguration("files", uri).get("encoding", "utf8"); 138 | if (encoding === "utf8bom") { 139 | return "utf8"; // iconv-lite はデコード時にデフォルトで bom を削除するためこれで問題ない 140 | } 141 | return encoding; 142 | } 143 | } 144 | 145 | export class DeclarationChangeEvent { 146 | constructor(public uri: Uri, public decls: Declaration[]) { 147 | } 148 | } 149 | 150 | export class DeclarationDeleteEvent { 151 | constructor(public uri: Uri) { 152 | } 153 | } 154 | 155 | export class DeclarationProvider implements Disposable { 156 | private fullscan: boolean = true; 157 | 158 | private dirty: Map = new Map(); 159 | 160 | private syncing: Promise; 161 | 162 | private builtin: BuiltinDeclarationFiles; 163 | private encoding: WorkspaceEncoding; 164 | 165 | private disposable: Disposable; 166 | 167 | private onDidChangeEmitter: EventEmitter = new EventEmitter(); 168 | private onDidDeleteEmitter: EventEmitter = new EventEmitter(); 169 | private onDidResetEmitter: EventEmitter = new EventEmitter(); 170 | 171 | constructor(context: ExtensionContext) { 172 | this.builtin = new BuiltinDeclarationFiles(context); 173 | this.encoding = new WorkspaceEncoding(); 174 | 175 | const subscriptions: Disposable[] = []; 176 | 177 | const watcher = vscode.workspace.createFileSystemWatcher("**/*.[Ee][Rr][BbHh]"); 178 | watcher.onDidCreate(this.onDidChangeFile, this); 179 | watcher.onDidChange(this.onDidChangeFile, this); 180 | watcher.onDidDelete(this.onDidDeleteFile, this); 181 | subscriptions.push(watcher); 182 | 183 | vscode.workspace.onDidChangeConfiguration(this.onDidChangeWorkspace, this, subscriptions); 184 | vscode.workspace.onDidChangeWorkspaceFolders(this.onDidChangeWorkspace, this, subscriptions); 185 | 186 | this.disposable = Disposable.from(...subscriptions); 187 | } 188 | 189 | get onDidChange(): Event { 190 | return this.onDidChangeEmitter.event; 191 | } 192 | 193 | get onDidDelete(): Event { 194 | return this.onDidDeleteEmitter.event; 195 | } 196 | 197 | get onDidReset(): Event { 198 | return this.onDidResetEmitter.event; 199 | } 200 | 201 | public reachable(ws: WorkspaceFolder, path: string): boolean { 202 | return path.startsWith(ws.uri.fsPath) || this.builtin.has(path); 203 | } 204 | 205 | public sync(): Promise { 206 | if (this.syncing === undefined) { 207 | this.syncing = this.flush().then(() => { 208 | this.syncing = undefined; 209 | }); 210 | } 211 | return this.syncing; 212 | } 213 | 214 | public dispose() { 215 | this.disposable.dispose(); 216 | } 217 | 218 | private onDidChangeFile(uri: Uri) { 219 | this.dirty.set(uri.fsPath, uri); 220 | } 221 | 222 | private onDidDeleteFile(uri: Uri) { 223 | this.dirty.delete(uri.fsPath); 224 | this.onDidDeleteEmitter.fire(new DeclarationDeleteEvent(uri)); 225 | } 226 | 227 | private onDidChangeWorkspace() { 228 | this.fullscan = true; 229 | this.dirty.clear(); 230 | this.encoding.reset(); 231 | this.onDidResetEmitter.fire(); 232 | } 233 | 234 | private async flush(): Promise { 235 | if (this.fullscan) { 236 | this.fullscan = false; 237 | for (const uri of this.builtin.uris()) { 238 | this.dirty.set(uri.fsPath, uri); 239 | } 240 | for (const uri of await vscode.workspace.findFiles("**/*.[Ee][Rr][BbHh]")) { 241 | this.dirty.set(uri.fsPath, uri); 242 | } 243 | } 244 | if (this.dirty.size === 0) { 245 | return; 246 | } 247 | for (const [path, uri] of Array.from(this.dirty)) { 248 | const input = await new Promise((resolve, reject) => { 249 | fs.readFile(path, (err, data) => { 250 | if (err) { 251 | if (typeof err === "object" && err.code === "ENOENT") { 252 | resolve(); 253 | } else { 254 | reject(err); 255 | } 256 | } else { 257 | resolve(iconv.decode(data, this.encoding.detect(path, data))); 258 | } 259 | }); 260 | }); 261 | if (input === undefined) { 262 | this.dirty.delete(path); 263 | this.onDidDeleteEmitter.fire(new DeclarationDeleteEvent(uri)); 264 | continue; 265 | } 266 | if (this.dirty.delete(path)) { 267 | this.onDidChangeEmitter.fire(new DeclarationChangeEvent(uri, readDeclarations(input))); 268 | } 269 | } 270 | } 271 | } 272 | -------------------------------------------------------------------------------- /src/definition.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from "vscode"; 2 | 3 | import { Location, Position, TextDocument, Uri } from "vscode"; 4 | 5 | import { Declaration, DeclarationProvider, readDeclarations } from "./declaration"; 6 | 7 | function declToDefinition(uri: Uri, decl: Declaration): Location { 8 | return new Location(uri, decl.nameRange); 9 | } 10 | 11 | class DefinitionInfo { 12 | constructor(public name: string, public location: Location) { 13 | } 14 | } 15 | 16 | export class DefinitionRepository { 17 | private cache: Map = new Map(); 18 | 19 | constructor(private provider: DeclarationProvider) { 20 | provider.onDidChange((e) => { 21 | this.cache.set(e.uri.fsPath, e.decls.filter((d) => d.isGlobal) 22 | .map((d) => new DefinitionInfo(d.name, declToDefinition(e.uri, d)))); 23 | }); 24 | provider.onDidDelete((e) => { 25 | this.cache.delete(e.uri.fsPath); 26 | }); 27 | provider.onDidReset((e) => { 28 | this.cache.clear(); 29 | }); 30 | } 31 | 32 | public sync(): Promise { 33 | return this.provider.sync(); 34 | } 35 | 36 | public *find(document: TextDocument, position: Position): IterableIterator { 37 | const word = this.getWord(document, position); 38 | if (word === undefined) { 39 | return; 40 | } 41 | yield* this.findInCurrentDocument(document, position, word); 42 | const ws = vscode.workspace.getWorkspaceFolder(document.uri); 43 | if (ws === undefined) { 44 | return; 45 | } 46 | const fresh: Set = new Set([document.uri.fsPath]); 47 | for (const doc of vscode.workspace.textDocuments) { 48 | if (!doc.isDirty) { 49 | continue; 50 | } 51 | if (doc === document) { 52 | continue; 53 | } 54 | if (!this.cache.has(doc.uri.fsPath)) { 55 | continue; 56 | } 57 | if (!this.provider.reachable(ws, doc.uri.fsPath)) { 58 | continue; 59 | } 60 | fresh.add(doc.uri.fsPath); 61 | yield* this.findInDocument(doc, word); 62 | } 63 | for (const [path, defs] of this.cache.entries()) { 64 | if (fresh.has(path)) { 65 | continue; 66 | } 67 | if (!this.provider.reachable(ws, path)) { 68 | continue; 69 | } 70 | yield* defs.filter((d) => d.name === word).map((d) => d.location); 71 | } 72 | } 73 | 74 | private getWord(document: TextDocument, position: Position): string { 75 | const range = document.getWordRangeAtPosition(position, /[^\s\x21-\x2f\x3a-\x40\x5b-\x5e\x7b-\x7e]+/); 76 | if (range !== undefined) { 77 | return document.getText(range); 78 | } 79 | } 80 | 81 | private findInCurrentDocument(document: TextDocument, position: Position, word: string): Location[] { 82 | return readDeclarations(document.getText()) 83 | .filter((d) => d.name === word && d.visible(position)) 84 | .map((d) => declToDefinition(document.uri, d)); 85 | } 86 | 87 | private findInDocument(document: TextDocument, word: string): Location[] { 88 | return readDeclarations(document.getText()) 89 | .filter((d) => d.name === word && d.isGlobal) 90 | .map((d) => declToDefinition(document.uri, d)); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/extension.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from "vscode"; 2 | 3 | import { 4 | CancellationToken, CompletionContext, CompletionItem, CompletionItemProvider, Definition, DefinitionProvider, 5 | DocumentSelector, DocumentSymbolProvider, ExtensionContext, Position, SymbolInformation, TextDocument, WorkspaceSymbolProvider, 6 | } from "vscode"; 7 | 8 | import { BuiltinComplationItems } from "./completion"; 9 | import { DeclarationProvider } from "./declaration"; 10 | import { DefinitionRepository } from "./definition"; 11 | import { readSymbolInformations, SymbolInformationRepository } from "./symbol"; 12 | 13 | export function activate(context: ExtensionContext) { 14 | const selector: DocumentSelector = { language: "erabasic" }; 15 | const provider: DeclarationProvider = new DeclarationProvider(context); 16 | context.subscriptions.push(vscode.languages.registerCompletionItemProvider(selector, new EraBasicCompletionItemProvider())); 17 | context.subscriptions.push(vscode.languages.registerDefinitionProvider(selector, new EraBasicDefinitionProvider(provider))); 18 | context.subscriptions.push(vscode.languages.registerDocumentSymbolProvider(selector, new EraBasicDocumentSymbolProvider())); 19 | context.subscriptions.push(vscode.languages.registerWorkspaceSymbolProvider(new EraBasicWorkspaceSymbolProvider(provider))); 20 | context.subscriptions.push(provider); 21 | } 22 | 23 | export function deactivate() { 24 | // Nothing to do 25 | } 26 | 27 | class EraBasicCompletionItemProvider implements CompletionItemProvider { 28 | public provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken, context: CompletionContext): CompletionItem[] { 29 | // 可視範囲のシンボル数がメガテンで 65000 を越えるため諸々見送り 30 | return BuiltinComplationItems; 31 | } 32 | } 33 | 34 | class EraBasicDefinitionProvider implements DefinitionProvider { 35 | private repo: DefinitionRepository; 36 | 37 | constructor(provider: DeclarationProvider) { 38 | this.repo = new DefinitionRepository(provider); 39 | } 40 | 41 | public provideDefinition(document: TextDocument, position: Position, token: CancellationToken): Promise { 42 | return this.repo.sync().then(() => Array.from(this.repo.find(document, position))); 43 | } 44 | } 45 | 46 | class EraBasicDocumentSymbolProvider implements DocumentSymbolProvider { 47 | public provideDocumentSymbols(document: TextDocument, token: CancellationToken): SymbolInformation[] { 48 | return readSymbolInformations(document.uri, document.getText()); 49 | } 50 | } 51 | 52 | class EraBasicWorkspaceSymbolProvider implements WorkspaceSymbolProvider { 53 | private repo: SymbolInformationRepository; 54 | 55 | constructor(provider: DeclarationProvider) { 56 | this.repo = new SymbolInformationRepository(provider); 57 | } 58 | 59 | public provideWorkspaceSymbols(query: string, token: CancellationToken): Promise { 60 | return this.repo.sync().then(() => Array.from(this.repo.find(query))); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/symbol.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from "vscode"; 2 | 3 | import { Location, SymbolInformation, TextDocument, Uri } from "vscode"; 4 | 5 | import { Declaration, DeclarationProvider, readDeclarations } from "./declaration"; 6 | 7 | function declToSymbolInformation(uri: Uri, decl: Declaration): SymbolInformation { 8 | return new SymbolInformation( 9 | decl.name, 10 | decl.kind, 11 | decl.container?.name, 12 | new Location(uri, decl.bodyRange), 13 | ); 14 | } 15 | 16 | export function readSymbolInformations(uri: Uri, input: string): SymbolInformation[] { 17 | return readDeclarations(input).map((d) => declToSymbolInformation(uri, d)); 18 | } 19 | 20 | export class SymbolInformationRepository { 21 | private cache: Map = new Map(); 22 | 23 | constructor(private provider: DeclarationProvider) { 24 | provider.onDidChange((e) => { 25 | this.cache.set(e.uri.fsPath, e.decls 26 | .map((d) => declToSymbolInformation(e.uri, d))); 27 | }); 28 | provider.onDidDelete((e) => { 29 | this.cache.delete(e.uri.fsPath); 30 | }); 31 | provider.onDidReset((e) => { 32 | this.cache.clear(); 33 | }); 34 | } 35 | 36 | public sync(): Promise { 37 | return this.provider.sync(); 38 | } 39 | 40 | public *find(query: string): IterableIterator { 41 | const pattern = this.compileQuery(query); 42 | if (pattern === undefined) { 43 | return; 44 | } 45 | const fresh: Set = new Set(); 46 | for (const doc of vscode.workspace.textDocuments) { 47 | if (!doc.isDirty) { 48 | continue; 49 | } 50 | if (!this.cache.has(doc.uri.fsPath)) { 51 | continue; 52 | } 53 | fresh.add(doc.uri.fsPath); 54 | yield* this.findInDocument(doc, pattern); 55 | } 56 | for (const [path, symbols] of this.cache.entries()) { 57 | if (fresh.has(path)) { 58 | continue; 59 | } 60 | yield* symbols.filter((s) => pattern.test(s.name)); 61 | } 62 | } 63 | 64 | private compileQuery(query: string): RegExp { 65 | if (query.length === 0) { 66 | return; 67 | } 68 | const chars = Array.from(query).map((c) => { 69 | const uc = c.toUpperCase(); 70 | const lc = c.toLowerCase(); 71 | return uc === lc ? c : `[${uc}${lc}]`; 72 | }); 73 | return new RegExp(chars.join(".*")); 74 | } 75 | 76 | private findInDocument(document: TextDocument, pattern: RegExp): SymbolInformation[] { 77 | return readDeclarations(document.getText()) 78 | .filter((d) => pattern.test(d.name)) 79 | .map((d) => declToSymbolInformation(document.uri, d)); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /syntaxes/erabasic.tmLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", 3 | "name": "EraBasic", 4 | "patterns": [ 5 | { 6 | "include": "#preprocessor" 7 | }, 8 | { 9 | "include": "#statement" 10 | }, 11 | { 12 | "include": "#expression" 13 | } 14 | ], 15 | "repository": { 16 | "preprocessor": { 17 | "patterns": [ 18 | { 19 | "include": "#preprocessor-block" 20 | }, 21 | { 22 | "include": "#preprocessor-special-comment" 23 | }, 24 | { 25 | "include": "#preprocessor-attribute" 26 | } 27 | ] 28 | }, 29 | "preprocessor-block": { 30 | "patterns": [ 31 | { 32 | "begin": "^\\s*(;[!#];)?\\s*\\[((?:IF|ELSEIF)\\s+[^\\s\\x21-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x7b-\\x7e]+|IF_DEBUG|IF_NDEBUG|ELSE|ENDIF)\\]", 33 | "beginCaptures": { 34 | "0": { 35 | "name": "meta.preprocessor.erabasic" 36 | } 37 | }, 38 | "end": "$" 39 | }, 40 | { 41 | "name": "comment.block.erabasic", 42 | "begin": "^\\s*(;[!#];)?\\s*\\[SKIPSTART\\]", 43 | "end": "^\\s*(;[!#];)?\\s*\\[SKIPEND\\]", 44 | "captures": { 45 | "0": { 46 | "name": "meta.preprocessor.erabasic" 47 | } 48 | } 49 | } 50 | ] 51 | }, 52 | "preprocessor-special-comment": { 53 | "patterns": [ 54 | { 55 | "begin": "^\\s*;[!#];", 56 | "beginCaptures": { 57 | "0": { 58 | "name": "meta.preprocessor.erabasic" 59 | } 60 | }, 61 | "end": "$", 62 | "patterns": [ 63 | { 64 | "include": "#statement" 65 | } 66 | ] 67 | } 68 | ] 69 | }, 70 | "preprocessor-attribute": { 71 | "patterns": [ 72 | { 73 | "begin": "^\\s*#DIMS?(?:\\s+(?:SAVEDATA|CHARADATA|GLOBAL|DYNAMIC|STATIC|CONST|REF))*\\b", 74 | "beginCaptures": { 75 | "0": { 76 | "name": "meta.preprocessor.erabasic" 77 | } 78 | }, 79 | "end": "$", 80 | "patterns": [ 81 | { 82 | "include": "#expression" 83 | } 84 | ] 85 | }, 86 | { 87 | "begin": "^\\s*#(?:SINGLE|PRI|LATER|ONLY|FUNCTION|FUNCTIONS|LOCALSIZE|LOCALSSIZE|DEFINE)\\b", 88 | "beginCaptures": { 89 | "0": { 90 | "name": "meta.preprocessor.erabasic" 91 | } 92 | }, 93 | "end": "$", 94 | "patterns": [ 95 | { 96 | "include": "#expression" 97 | } 98 | ] 99 | } 100 | ] 101 | }, 102 | "statement": { 103 | "patterns": [ 104 | { 105 | "include": "#comment" 106 | }, 107 | { 108 | "include": "#function-declaration" 109 | }, 110 | { 111 | "include": "#labeled-statement" 112 | }, 113 | { 114 | "include": "#control-statement" 115 | }, 116 | { 117 | "include": "#command-statement" 118 | }, 119 | { 120 | "include": "#assignment-statement" 121 | } 122 | ] 123 | }, 124 | "function-declaration": { 125 | "patterns": [ 126 | { 127 | "begin": "@([^\\s\\x21-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x7b-\\x7e]+)", 128 | "beginCaptures": { 129 | "1": { 130 | "name": "entity.name.function.erabasic" 131 | } 132 | }, 133 | "end": "(?=$)", 134 | "patterns": [ 135 | { 136 | "include": "#expression" 137 | } 138 | ] 139 | } 140 | ] 141 | }, 142 | "labeled-statement": { 143 | "patterns": [ 144 | { 145 | "match": "\\$([^\\s\\x21-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x7b-\\x7e]+)", 146 | "captures": { 147 | "1": { 148 | "name": "entity.name.label.erabasic" 149 | } 150 | } 151 | } 152 | ] 153 | }, 154 | "control-statement": { 155 | "patterns": [ 156 | { 157 | "begin": "\\bCASE\\b", 158 | "beginCaptures": { 159 | "0": { 160 | "name": "keyword.control.erabasic" 161 | } 162 | }, 163 | "end": "$", 164 | "patterns": [ 165 | { 166 | "name": "keyword.control.erabasic", 167 | "match": "\\b(IS|TO)\\b" 168 | }, 169 | { 170 | "include": "#expression" 171 | } 172 | ] 173 | }, 174 | { 175 | "begin": "\\b(TRYCCALL|TRYCJUMP)\\b", 176 | "beginCaptures": { 177 | "0": { 178 | "name": "keyword.control.erabasic" 179 | } 180 | }, 181 | "end": "$", 182 | "patterns": [ 183 | { 184 | "name": "entity.name.function.erabasic", 185 | "match": "[^\\s\\x21-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x7b-\\x7e]+" 186 | }, 187 | { 188 | "begin": "(?=,|\\()", 189 | "end": "(?=$)", 190 | "patterns": [ 191 | { 192 | "include": "#expression" 193 | } 194 | ] 195 | } 196 | ] 197 | }, 198 | { 199 | "begin": "\\b(TRYCCALLFORM|TRYCJUMPFORM)\\b", 200 | "beginCaptures": { 201 | "0": { 202 | "name": "keyword.control.erabasic" 203 | } 204 | }, 205 | "end": "$", 206 | "patterns": [ 207 | { 208 | "name": "entity.name.function.erabasic", 209 | "match": "[^\\s\\x21-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x7b-\\x7e]+" 210 | }, 211 | { 212 | "include": "#form-string" 213 | }, 214 | { 215 | "begin": "(?=,|\\()", 216 | "end": "(?=$)", 217 | "patterns": [ 218 | { 219 | "include": "#expression" 220 | } 221 | ] 222 | } 223 | ] 224 | }, 225 | { 226 | "begin": "\\bTRYCGOTOFORM\\b", 227 | "beginCaptures": { 228 | "0": { 229 | "name": "keyword.control.erabasic" 230 | } 231 | }, 232 | "end": "$", 233 | "patterns": [ 234 | { 235 | "include": "#form-string" 236 | } 237 | ] 238 | }, 239 | { 240 | "begin": "\\b(PRINTDATA|PRINTDATAL|PRINTDATAW|PRINTDATAK|PRINTDATAKL|PRINTDATAKW|PRINTDATAD|PRINTDATADL|PRINTDATADW|STRDATA|ENDDATA|DATALIST|ENDLIST|NOSKIP|ENDNOSKIP|SIF|IF|ELSEIF|ELSE|ENDIF|REPEAT|REND|FOR|NEXT|WHILE|WEND|DO|LOOP|SELECTCASE|CASEELSE|ENDSELECT|TRYCGOTO|CATCH|ENDCATCH|TRYCALLLIST|TRYJUMPLIST|TRYGOTOLIST|ENDFUNC)\\b", 241 | "beginCaptures": { 242 | "0": { 243 | "name": "keyword.control.erabasic" 244 | } 245 | }, 246 | "end": "$", 247 | "patterns": [ 248 | { 249 | "include": "#expression" 250 | } 251 | ] 252 | } 253 | ] 254 | }, 255 | "command-statement": { 256 | "patterns": [ 257 | { 258 | "begin": "\\b(CALL|JUMP|TRYCALL|TRYJUMP|CALLF|CALLEVENT|FUNC)\\b", 259 | "beginCaptures": { 260 | "0": { 261 | "name": "keyword.command.erabasic" 262 | } 263 | }, 264 | "end": "$", 265 | "patterns": [ 266 | { 267 | "name": "entity.name.function.erabasic", 268 | "match": "[^\\s\\x21-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x7b-\\x7e]+" 269 | }, 270 | { 271 | "begin": "(?=,|\\()", 272 | "end": "(?=$)", 273 | "patterns": [ 274 | { 275 | "include": "#expression" 276 | } 277 | ] 278 | } 279 | ] 280 | }, 281 | { 282 | "begin": "\\b(CALLFORM|JUMPFORM|TRYCALLFORM|TRYJUMPFORM|CALLFORMF)\\b", 283 | "beginCaptures": { 284 | "0": { 285 | "name": "keyword.command.erabasic" 286 | } 287 | }, 288 | "end": "$", 289 | "patterns": [ 290 | { 291 | "name": "entity.name.function.erabasic", 292 | "match": "[^\\s\\x21-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x7b-\\x7e]+" 293 | }, 294 | { 295 | "include": "#form-string" 296 | }, 297 | { 298 | "begin": "(?=,|\\()", 299 | "end": "(?=$)", 300 | "patterns": [ 301 | { 302 | "include": "#expression" 303 | } 304 | ] 305 | } 306 | ] 307 | }, 308 | { 309 | "begin": "\\b(PRINT|PRINTL|PRINTW|PRINTK|PRINTKL|PRINTKW|PRINTD|PRINTDL|PRINTDW|PRINTSINGLE|PRINTSINGLEK|PRINTSINGLED|PRINTC|PRINTCK|PRINTCD|PRINTLC|PRINTLCK|PRINTLCD|DATA|PRINTPLAIN|CUSTOMDRAWLINE|SETCOLORBYNAME|SETBGCOLORBYNAME|STRLEN|STRLENU|ESCAPE|DEBUGPRINT|DEBUGPRINTL)\\b", 310 | "beginCaptures": { 311 | "0": { 312 | "name": "keyword.other.command.erabasic" 313 | } 314 | }, 315 | "end": "$" 316 | }, 317 | { 318 | "begin": "\\b(PRINTFORM|PRINTFORML|PRINTFORMW|PRINTFORMK|PRINTFORMKL|PRINTFORMKW|PRINTFORMD|PRINTFORMDL|PRINTFORMDW|PRINTSINGLEFORM|PRINTSINGLEFORMK|PRINTSINGLEFORMD|PRINTFORMC|PRINTFORMCK|PRINTFORMCD|PRINTFORMLC|PRINTFORMLCK|PRINTFORMLCD|DATAFORM|PRINTPLAINFORM|DRAWLINEFORM|REUSELASTLINE|STRLENFORM|STRLENFORMU|ENCODETOUNI|INPUTS|ONEINPUTS|THROW|GOTOFORM|TRYGOTOFORM|RETURNFORM|DEBUGPRINTFORM|DEBUGPRINTFORML|PUTFORM)\\b", 319 | "beginCaptures": { 320 | "0": { 321 | "name": "keyword.other.command.erabasic" 322 | } 323 | }, 324 | "end": "$", 325 | "patterns": [ 326 | { 327 | "include": "#form-string" 328 | } 329 | ] 330 | }, 331 | { 332 | "begin": "\\b(PRINTV|PRINTVL|PRINTVW|PRINTVK|PRINTVKL|PRINTVKW|PRINTVD|PRINTVDL|PRINTVDW|PRINTS|PRINTSL|PRINTSW|PRINTSK|PRINTSKL|PRINTSKW|PRINTSD|PRINTSDL|PRINTSDW|PRINTFORMS|PRINTFORMSL|PRINTFORMSW|PRINTFORMSK|PRINTFORMSKL|PRINTFORMSKW|PRINTFORMSD|PRINTFORMSDL|PRINTFORMSDW|PRINTSINGLEV|PRINTSINGLEVK|PRINTSINGLEVD|PRINTSINGLES|PRINTSINGLESK|PRINTSINGLESD|PRINTSINGLEFORMS|PRINTSINGLEFORMSK|PRINTSINGLEFORMSD|PRINTBUTTON|PRINTBUTTONC|PRINTBUTTONLC|PRINT_ABL|PRINT_TALENT|PRINT_MARK|PRINT_EXP|PRINT_PALAM|PRINT_ITEM|PRINT_SHOPITEM|UPCHECK|DRAWLINE|CLEARLINE|PRINT_IMG|PRINT_RECT|PRINT_SPACE|SETCOLOR|SETCOLOR|RESETCOLOR|SETBGCOLOR|SETBGCOLOR|RESETBGCOLOR|GETCOLOR|GETDEFCOLOR|GETBGCOLOR|GETDEFBGCOLOR|GETFOCUSCOLOR|FONTBOLD|FONTITALIC|FONTREGULAR|FONTSTYLE|GETSTYLE|CHKFONT|SETFONT|GETFONT|FORCEKANA|ALIGNMENT|CURRENTALIGN|REDRAW|CURRENTREDRAW|PRINTCPERLINE|LINEISEMPTY|BARSTR|MONEYSTR|SKIPDISP|ISSKIP|MOUSESKIP|TOUPPER|TOLOWER|TOHALF|TOFULL|TOSTR|ISNUMERIC|TOINT|STRLENS|STRLENSU|SUBSTRING|SUBSTRINGU|CHARATU|STRFIND|STRFINDU|STRCOUNT|SPLIT|REPLACE|UNICODE|POWER|ABS|SIGN|SQRT|GETBIT|MAX|MIN|LIMIT|INRANGE|SETBIT|CLEARBIT|INVERTBIT|ADDCHARA|DELCHARA|SWAPCHARA|SORTCHARA|GETCHARA|ADDDEFCHARA|ADDVOIDCHARA|DELALLCHARA|PICKUPCHARA|EXISTCSV|FINDCHARA|FINDLASTCHARA|COPYCHARA|ADDCOPYCHARA|VARSIZE|RESETDATA|RESETGLOBAL|RESET_STAIN|SWAP|CSVNAME|CSVCALLNAME|CSVNICKNAME|CSVMASTERNAME|CSVBASE|CSVCSTR|CSVABL|CSVTALENT|CSVMARK|CSVEXP|CSVRELATION|CSVJUEL|CSVEQUIP|CSVCFLAG|GETNUM|GETPALAMLV|GETEXPLV|FINDELEMENT|FINDLASTELEMENT|VARSET|CVARSET|ARRAYSHIFT|ARRAYREMOVE|ARRAYSORT|ARRAYCOPY|CUPCHECK|SAVEDATA|LOADDATA|DELDATA|CHKDATA|SAVENOS|SAVEGLOBAL|LOADGLOBAL|OUTPUTLOG|SAVECHARA|LOADCHARA|CHKCHARADATA|FIND_CHARADATA|GETTIME|GETMILLISECOND|GETSECOND|FORCEWAIT|INPUT|TINPUT|TINPUTS|TWAIT|ONEINPUT|TONEINPUT|TONEINPUTS|WAITANYKEY|BREAK|CONTINUE|RANDOMIZE|DUMPRAND|INITRAND|BEGIN|CALLTRAIN|DOTRAIN|GOTO|TRYGOTO|RETURN|RETURNF|DEBUGCLEAR|ASSERT|TOOLTIP_SETCOLOR|TOOLTIP_SETDELAY|HTML_PRINT|HTML_TAGSPLIT|CLEARTEXTBOX|STOPCALLTRAIN|TIMES|BAR|BARL|SAVEGAME|LOADGAME|WAIT|RESTART|QUIT|GETTIMES|RAND|CBRT|LOG|LOG10|EXPONENT|SUMARRAY|MATCH|MAXARRAY|MINARRAY|SUMCARRAY|CMATCH|MAXCARRAY|MINCARRAY|GROUPMATCH|NOSAMES|ALLSAMES|MESSKIP|CONVERT|COLOR_FROMNAME|COLOR_FROMRGB|INRANGEARRAY|INRANGECARRAY|GETLINESTR|PRINTCLENGTH|STRFORM|GETCONFIG|GETCONFIGS|HTML_POPPRINTINGSTR|HTML_GETPRINTEDSTR|HTML_ESCAPE|HTML_TOPLAINTEXT|TOOLTIP_SETDURATION|AWAIT|STRJOIN|GETKEY|GETKEYTRIGGERED|MOUSEX|MOUSEY|ISACTIVE|SAVETEXT|LOADTEXT|SPRITECREATED|SPRITEWIDTH|SPRITEHEIGHT|SPRITEPOSX|SPRITEPOSY|SPRITESETPOS|SPRITEMOVE|ARRAYMSORT|CLIENTWIDTH|CLIENTHEIGHT|GCREATED|GWIDTH|GHEIGHT|GGETCOLOR|GCREATE|GCREATEFROMFILE|GDISPOSE|GCLEAR|GFILLRECTANGLE|GDRAWSPRITE|GSETCOLOR|GDRAWG|GDRAWGWITHMASK|GSETBRUSH|GSETFONT|GSETPEN|GSAVE|GLOAD|SPRITECREATE|SPRITEANIMECREATE|SPRITEANIMEADDFRAME|SPRITEDISPOSE|SPRITEGETCOLOR|CBGSETG|CBGSETSPRITE|CBGCLEAR|CBGREMOVERANGE|CBGSETBUTTONSPRITE|CBGCLEARBUTTON|CBGSETBMAPG|CBGREMOVEBMAP|INPUTMOUSEKEY|SETANIMETIMER)\\b", 333 | "beginCaptures": { 334 | "0": { 335 | "name": "keyword.other.command.erabasic" 336 | } 337 | }, 338 | "end": "$", 339 | "patterns": [ 340 | { 341 | "include": "#expression" 342 | } 343 | ] 344 | } 345 | ] 346 | }, 347 | "assignment-statement": { 348 | "name": "meta.assignment.erabasic", 349 | "patterns": [ 350 | { 351 | "begin": "([^*/%+\\-<>&|\\^'=!]=[^=])(?=\\s*(?:%|{|\\@))", 352 | "beginCaptures": { 353 | "1": { 354 | "name": "keyword.operator.assignment.erabasic" 355 | } 356 | }, 357 | "end": "$", 358 | "patterns": [ 359 | { 360 | "include": "#form-string" 361 | } 362 | ] 363 | }, 364 | { 365 | "begin": "\\*=|/=|%=|\\+=|-=|<<=|>>=|&=|\\|=|\\^=|'=|[^=!<>]=[^=]", 366 | "beginCaptures": { 367 | "0": { 368 | "name": "keyword.operator.assignment.erabasic" 369 | } 370 | }, 371 | "end": "$", 372 | "patterns": [ 373 | { 374 | "include": "#expression" 375 | } 376 | ] 377 | } 378 | ] 379 | }, 380 | "form-string": { 381 | "patterns": [ 382 | { 383 | "include": "#string-conditional-operator" 384 | }, 385 | { 386 | "include": "#string-placeholder" 387 | }, 388 | { 389 | "include": "#numeric-placeholder" 390 | } 391 | ] 392 | }, 393 | "string-conditional-operator": { 394 | "patterns": [ 395 | { 396 | "name": "meta.template.expression.erabasic", 397 | "match": "(\\\\@)(.+?)(\\?)(.*?)(#)(.*?)(\\\\@)", 398 | "captures": { 399 | "1": { 400 | "name": "keyword.other.placeholder.erabasic" 401 | }, 402 | "2": { 403 | "patterns": [ 404 | { 405 | "include": "#expression" 406 | } 407 | ] 408 | }, 409 | "3": { 410 | "name": "keyword.operator.conditional.erabasic" 411 | }, 412 | "4": { 413 | "patterns": [ 414 | { 415 | "include": "#string-placeholder" 416 | }, 417 | { 418 | "include": "#numeric-placeholder" 419 | } 420 | ] 421 | }, 422 | "5": { 423 | "name": "keyword.operator.conditional.erabasic" 424 | }, 425 | "6": { 426 | "patterns": [ 427 | { 428 | "include": "#string-placeholder" 429 | }, 430 | { 431 | "include": "#numeric-placeholder" 432 | } 433 | ] 434 | }, 435 | "7": { 436 | "name": "keyword.other.placeholder.erabasic" 437 | } 438 | } 439 | } 440 | ] 441 | }, 442 | "string-placeholder": { 443 | "patterns": [ 444 | { 445 | "name": "meta.template.expression.erabasic", 446 | "begin": "(?>" 549 | }, 550 | { 551 | "name": "keyword.operator.comparison.erabasic", 552 | "match": "==|!=|<=|>=|<|>" 553 | }, 554 | { 555 | "name": "keyword.operator.logical.erabasic", 556 | "match": "&&|\\|\\|\\^\\^|!&|!\\||!" 557 | }, 558 | { 559 | "name": "keyword.operator.bitwise.erabasic", 560 | "match": "~|&|\\||\\^" 561 | }, 562 | { 563 | "name": "keyword.operator.assignment.erabasic", 564 | "match": "=" 565 | }, 566 | { 567 | "name": "keyword.operator.decrement.erabasic", 568 | "match": "--" 569 | }, 570 | { 571 | "name": "keyword.operator.increment.erabasic", 572 | "match": "\\+\\+" 573 | }, 574 | { 575 | "name": "keyword.operator.arithmetic.erabasic", 576 | "match": "\\*|/|%|\\+|-" 577 | }, 578 | { 579 | "name": "keyword.operator.conditional.erabasic", 580 | "match": "\\?|#" 581 | }, 582 | { 583 | "name": "keyword.operator.subscript.erabasic", 584 | "match": ":" 585 | } 586 | ] 587 | }, 588 | "string-literal": { 589 | "patterns": [ 590 | { 591 | "name": "string.quoted.double.erabasic", 592 | "begin": "@\"", 593 | "beginCaptures": { 594 | "0": { 595 | "name": "punctuation.definition.string.begin.erabasic" 596 | } 597 | }, 598 | "end": "(\")|$", 599 | "endCaptures": { 600 | "1": { 601 | "name": "punctuation.definition.string.end.erabasic" 602 | } 603 | }, 604 | "patterns": [ 605 | { 606 | "include": "#form-string" 607 | }, 608 | { 609 | "name": "constant.character.escape.erabasic", 610 | "match": "\\\\." 611 | } 612 | ] 613 | }, 614 | { 615 | "name": "string.quoted.double.erabasic", 616 | "begin": "\"", 617 | "beginCaptures": { 618 | "0": { 619 | "name": "punctuation.definition.string.begin.erabasic" 620 | } 621 | }, 622 | "end": "(\")|$", 623 | "endCaptures": { 624 | "1": { 625 | "name": "punctuation.definition.string.end.erabasic" 626 | } 627 | }, 628 | "patterns": [ 629 | { 630 | "name": "constant.character.escape.erabasic", 631 | "match": "\\\\." 632 | } 633 | ] 634 | } 635 | ] 636 | }, 637 | "numeric-literal": { 638 | "patterns": [ 639 | { 640 | "name": "constant.numeric.hex.erabasic", 641 | "match": "\\b0(x|X)[0-9a-fA-F]+\\b" 642 | }, 643 | { 644 | "name": "constant.numeric.binary.erabasic", 645 | "match": "\\b0(b|B)[01]+\\b" 646 | }, 647 | { 648 | "name": "constant.numeric.erabasic", 649 | "match": "\\b([0-9]+)\\.[0-9]+\\b" 650 | }, 651 | { 652 | "name": "constant.numeric.erabasic", 653 | "match": "\\b[0-9]+(p|P|e|E)[0-9]+\\b" 654 | }, 655 | { 656 | "name": "constant.numeric.erabasic", 657 | "match": "\\b[0-9]+\\b" 658 | } 659 | ] 660 | }, 661 | "function-call": { 662 | "patterns": [ 663 | { 664 | "begin": "\\b(?:(GETCHARA|FINDCHARA|FINDLASTCHARA|CSVNAME|CSVCALLNAME|CSVNICKNAME|CSVMASTERNAME|CSVCSTR|CSVBASE|CSVABL|CSVTALENT|CSVMARK|CSVEXP|CSVRELATION|CSVJUEL|CSVEQUIP|CSVCFLAG|EXISTCSV|GETNUM|STRLENS|STRLENSU|SUBSTRING|SUBSTRINGU|CHARATU|STRFIND|STRFINDU|STRCOUNT|UNICODE|ENCODETOUNI|REPLACE|ESCAPE|VARSIZE|GETTIME|GETTIMES|GETMILLISECOND|GETSECOND|CHKFONT|POWER|RAND|ABS|SIGN|MAX|MIN|LIMIT|INRANGE|SQRT|GETBIT|CBRT|LOG|LOG10|EXPONENT|GETFONT|GETCOLOR|GETDEFCOLOR|GETBGCOLOR|GETDEFBGCOLOR|GETFOCUSCOLOR|GETSTYLE|CURRENTALIGN|CURRENTREDRAW|TOSTR|GETPALAMLV|GETEXPLV|TOUPPER|TOLOWER|TOHALF|TOFULL|SUMARRAY|MATCH|MAXARRAY|MINARRAY|SUMCARRAY|CMATCH|MAXCARRAY|MINCARRAY|ISNUMERIC|TOINT|CHKDATA|CHKCHARADATA|FIND_CHARADATA|SAVENOS|PRINTCPERLINE|LINEISEMPTY|GROUPMATCH|NOSAMES|ALLSAMES|ISSKIP|MOUSESKIP|MESSKIP|CONVERT|MONEYSTR|FINDELEMENT|FINDLASTELEMENT|BARSTR|COLOR_FROMNAME|COLOR_FROMRGB|INRANGEARRAY|INRANGECARRAY|GETLINESTR|PRINTCLENGTH|STRFORM|GETCONFIG|GETCONFIGS|HTML_POPPRINTINGSTR|HTML_GETPRINTEDSTR|HTML_ESCAPE|HTML_TOPLAINTEXT|STRJOIN|GETKEY|GETKEYTRIGGERED|MOUSEX|MOUSEY|ISACTIVE|SAVETEXT|LOADTEXT|SPRITECREATED|SPRITEWIDTH|SPRITEHEIGHT|SPRITEPOSX|SPRITEPOSY|SPRITESETPOS|SPRITEMOVE|ARRAYMSORT|CLIENTWIDTH|CLIENTHEIGHT|GCREATED|GWIDTH|GHEIGHT|GGETCOLOR|GCREATE|GCREATEFROMFILE|GDISPOSE|GCLEAR|GFILLRECTANGLE|GDRAWSPRITE|GSETCOLOR|GDRAWG|GDRAWGWITHMASK|GSETBRUSH|GSETFONT|GSETPEN|GSAVE|GLOAD|SPRITECREATE|SPRITEANIMECREATE|SPRITEANIMEADDFRAME|SPRITEDISPOSE|SPRITEGETCOLOR|CBGSETG|CBGSETSPRITE|CBGCLEAR|CBGREMOVERANGE|CBGSETBUTTONSPRITE|CBGCLEARBUTTON|CBGSETBMAPG|CBGREMOVEBMAP)|([^\\s\\x21-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x7b-\\x7e]+))\\s*\\(", 665 | "beginCaptures": { 666 | "1": { 667 | "name": "support.function.builtin.erabasic" 668 | }, 669 | "2": { 670 | "name": "entity.name.function.erabasic" 671 | } 672 | }, 673 | "end": "\\)|$", 674 | "patterns": [ 675 | { 676 | "include": "#expression" 677 | } 678 | ] 679 | } 680 | ] 681 | }, 682 | "predefined-variables": { 683 | "patterns": [ 684 | { 685 | "name": "support.variable.global.erabasic", 686 | "match": "\\b(DAY|MONEY|ITEM|FLAG|TFLAG|UP|PALAMLV|EXPLV|EJAC|DOWN|RESULT|COUNT|TARGET|ASSI|MASTER|NOITEM|LOSEBASE|SELECTCOM|ASSIPLAY|PREVCOM|TIME|ITEMSALES|PLAYER|NEXTCOM|PBAND|BOUGHT|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|GLOBAL|RANDDATA|SAVESTR|TSTR|STR|RESULTS|GLOBALS|SAVEDATA_TEXT|ISASSI|NO|BASE|MAXBASE|ABL|TALENT|EXP|MARK|PALAM|SOURCE|EX|CFLAG|JUEL|RELATION|EQUIP|TEQUIP|STAIN|GOTJUEL|NOWEX|DOWNBASE|CUP|CDOWN|TCVAR|NAME|CALLNAME|NICKNAME|MASTERNAME|CSTR|CDFLAG|DITEMTYPE|DA|DB|DC|DD|DE|TA|TB|ITEMPRICE|ABLNAME|TALENTNAME|EXPNAME|MARKNAME|PALAMNAME|ITEMNAME|TRAINNAME|BASENAME|SOURCENAME|EXNAME|EQUIPNAME|TEQUIPNAME|FLAGNAME|TFLAGNAME|CFLAGNAME|TCVARNAME|CSTRNAME|STAINNAME|CDFLAGNAME1|CDFLAGNAME2|STRNAME|TSTRNAME|SAVESTRNAME|GLOBALNAME|GLOBALSNAME|GAMEBASE_AUTHER|GAMEBASE_AUTHOR|GAMEBASE_INFO|GAMEBASE_YEAR|GAMEBASE_TITLE|GAMEBASE_GAMECODE|GAMEBASE_VERSION|GAMEBASE_ALLOWVERSION|GAMEBASE_DEFAULTCHARA|GAMEBASE_NOITEM|RAND|CHARANUM|LASTLOAD_TEXT|LASTLOAD_VERSION|LASTLOAD_NO|LINECOUNT|ISTIMEOUT|__INT_MAX__|__INT_MIN__|EMUERA_VERSION|WINDOW_TITLE|MONEYLABEL|DRAWLINESTR|__FILE__|__FUNCTION__|__LINE__|LOCAL|ARG|LOCALS|ARGS)\\b" 687 | } 688 | ] 689 | }, 690 | "identifier": { 691 | "patterns": [ 692 | { 693 | "name": "entity.name.variable.erabasic", 694 | "match": "[^\\s\\x21-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x7b-\\x7e]+" 695 | } 696 | ] 697 | }, 698 | "punctuation": { 699 | "patterns": [ 700 | { 701 | "name": "punctuation.separator.expression.erabasic", 702 | "match": "," 703 | } 704 | ] 705 | }, 706 | "comment": { 707 | "patterns": [ 708 | { 709 | "name": "comment.line.erabasic", 710 | "begin": ";", 711 | "beginCaptures": { 712 | "0": { 713 | "name": "punctuation.definition.comment.erabasic" 714 | } 715 | }, 716 | "end": "$" 717 | } 718 | ] 719 | } 720 | }, 721 | "scopeName": "source.erabasic" 722 | } 723 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es2019", 5 | "lib": ["ES2019"], 6 | "outDir": "out", 7 | "sourceMap": true, 8 | "rootDir": "src" 9 | }, 10 | "exclude": ["node_modules", ".vscode-test"] 11 | } 12 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-string-throw": true, 4 | "no-unused-expression": true, 5 | "no-duplicate-variable": true, 6 | "curly": true, 7 | "class-name": true, 8 | "semicolon": [true, "always"], 9 | "triple-equals": true 10 | }, 11 | "defaultSeverity": "warning" 12 | } 13 | --------------------------------------------------------------------------------