updated with some code style and build instructions
This commit is contained in:
parent
9db2cb800d
commit
37c1f93902
1 changed files with 58 additions and 2 deletions
60
README.md
60
README.md
|
@ -4,14 +4,70 @@ experimental type system implementation
|
||||||
|
|
||||||
## getting and building
|
## getting and building
|
||||||
|
|
||||||
|
This will get you a basic build configured for development and debugging in the
|
||||||
|
subdirectory `build-debug/` of repository base:
|
||||||
```sh
|
```sh
|
||||||
git clone https://gitta.log-e.se/lnsol/log-e-sappho.git
|
git clone https://gitta.log-e.se/lnsol/log-e-sappho.git
|
||||||
cd ./log-e-sappho
|
cd ./log-e-sappho
|
||||||
cmake . -B build
|
cmake . --preset=debug
|
||||||
cd build
|
cd build-debug
|
||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To get sane error messages from editors using `clangd` for diagnostics, i.e.
|
||||||
|
using the same compilation flags configured for the build by cmake, in the repo
|
||||||
|
base directory link `compile_commands.json`:
|
||||||
|
```sh
|
||||||
|
ln -s build-debug/compile_commands.json
|
||||||
|
```
|
||||||
|
|
||||||
|
## "Code style"
|
||||||
|
|
||||||
|
I learned C from a guy that used to hack on OpenBSD, and just got used to
|
||||||
|
writing it this way. If you wanna hack on this yourself, use your judgement.
|
||||||
|
Look at the rest of the code and make yours look similar. Like, who cares about
|
||||||
|
rules really? Here are some guidelines tho.
|
||||||
|
|
||||||
|
**80 columns text width.**
|
||||||
|
|
||||||
|
Use **8 spaces wide TABS** (yes, actual TABS, not just 8 spaces) for
|
||||||
|
indentation and when inside `while`-/`if`-/etc. **conditions that span multiple
|
||||||
|
lines, indent 4 spaces + 0 or more TABS**, as to separate condition from body
|
||||||
|
of
|
||||||
|
|
||||||
|
I.e. do
|
||||||
|
```c
|
||||||
|
if (1 /* this is a very long condition */
|
||||||
|
== 2 /* spanning multiple lines */
|
||||||
|
|| 2 < 3 /* and we indent like this) {
|
||||||
|
this = the_way;
|
||||||
|
/* as to increase distinguishability of condition from body */
|
||||||
|
}
|
||||||
|
```
|
||||||
|
not
|
||||||
|
```c
|
||||||
|
if ( /* ... */
|
||||||
|
2 < 3) {
|
||||||
|
eyes = bleeding;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Conditional statements without `{ .. }` is okay (preferred) if the condition
|
||||||
|
fits on one line.
|
||||||
|
|
||||||
|
I.e. do
|
||||||
|
```c
|
||||||
|
if (1 /* short condition that fits on one line */)
|
||||||
|
u = the_best;
|
||||||
|
```
|
||||||
|
and
|
||||||
|
```c
|
||||||
|
if (the_variable_that_has_that_long_name = function_with_a_long_name_too(
|
||||||
|
arg_is_shorter_tho)) {
|
||||||
|
gesture = clapping;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## repository content
|
## repository content
|
||||||
|
|
||||||
This repository contains:
|
This repository contains:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue