Async-ify base-compiler
* Adds async to a number of methods
* Breaks 'compile' into a few smaller methods for readability
* Remove a few (seemingly!) unnecessary `Promise.all([x])`
- Add language
- Adds Nim compiler
- supports js, c, c++ outputs (objc not tested)
- prevent --run option
- Basic test for nim
Todos:
- monaco profile for Nim
It allows more letters, looks closer to the current length
and has a max try count
Thanks to @jameshamm for a great rundown on what could be done :)
Closes#1706
- Use `const` where it is possible.
- Move regexes into variables and give them a name.
- Eliminate `lineNumber` variable and use the length of the asm array.
- Use `updateDecorations()` function to decorate label usages.
- Update and fix test cases.
Parsing the labels on the server-side is more general, more flexible
and it can be easily tested.
- Store label definitions in a map. The key will be the label name and
the value will be the line number where the label definition can be
found.
- For each line get the labels which are used in the given line and
remove labels which do not have a definition.
- Modify the return value of the `processBinaryAsm` and `process`
function to return with the label definition too.
- Demangle the label usages and the label definitions too.
K1 MPPA uses ;; as a bundle separator (same syntax as IA64,
if it gets added to CE someday...).
The bundle separator must be alone on the line, see for example:
```
ld $r6 = 16[$r20]
addx8d $r9 = $r2, $r5
addw $r10 = $r2, -1
;;
addd $r0 = $r6, $r9
addd $r17 = $r10, 1
cb.wlez $r2? .L3
;;
copyd $r15 = $r0
;;
maddd $r15 = $r17, -8
;;
```
Single ; or ;; followed by any non whitespace before eol still
considered a comment.
E.g. for such directive
.file 1 "/home/user" "example.c"
now will be constructed valid path:
'/home/user/example.c'
instead of this broken path:
'/home/user/ "example.c"'
You can now configure which of the host's environment variables are
passed through to the compilers with compiler explorer property
environmentPassThrough. Defaults to `LD_LIBRARY_PATH`, `HOME` and `PATH`,
as before.
Also upgrades lint to ECMA 2018.
Fixes#502