Skip to content

2. Advanced Usage

Headline edited this page Oct 3, 2021 · 1 revision

Hi!

This page will talk about some of the specifics of everything packed into the ;compile command. It's quite a complicated command, and it trips up many.

1. The nitty-gritty

Below is going to be the outline for how parsing works, I will put all variables in <> and you should be able to understand the nuances of the grammar to execute more complicated compilations.

Figure 1.1
;compile <language/compiler> <compiler flags> | <one line stdin> < <url to request code from>
<command line arguments>
```
code
```

Or if you need multi-line stdin

Figure 1.2
;compile <language/compiler> <compiler flags> < <url to request code from>
<command line arguments>
```
stdin
```
```
code
```

Putting that all together, a request big can look like:

Figure 1.3
;compile c++ -O3 -Wall -Werror | test2
test1
```cpp
#include <string>
#include <iostream>
int main(int argc, char** argv) {
  std::string str;
  std::getline(std::cin, str);
  std::cout << str << std::endl;
  std::cout << argv[1] << std::endl;
  return 0;
}
```

I encourage you to try this for yourself and see how it works, go ahead and copy what's above and paste it into a message, tinker as needed.

Clone this wiki locally