Browse Source

Clarify indent levels of lists and update example

pull/19/head
Fredrik Ekre 1 year ago
parent
commit
f48f864502
No known key found for this signature in database
GPG Key ID: DE82E6D5E364C0A2
  1. 14
      README.md

14
README.md

@ -189,8 +189,8 @@ No. Use your <kbd>Enter</kbd> key or refactor your code.
Consistently four spaces for each indentation level. Consistently four spaces for each indentation level.
Standard code blocks (`function`, `for`, `while`, ...) all result an increase of the Standard code blocks (`function`, `for`, `while`, ...) all increase the indentation level by
indentation level until the closing `end`. Examples: one until the closing `end`. Examples:
```diff ```diff
function f() function f()
- for i in 1:2 - for i in 1:2
@ -209,22 +209,28 @@ indentation level until the closing `end`. Examples:
``` ```
Listlike expressions like e.g. tuples, function calls, array literals, etc. also increase Listlike expressions like e.g. tuples, function calls, array literals, etc. also increase
the indentation level until the closing token. This only has an effect if the list span the indentation level by one until the closing token. This only has an effect if the list
multiple lines. Examples: span multiple lines. Examples:
```diff ```diff
x = ( x = (
- a, b, c, d, - a, b, c, d,
- e, f, g, h,
+ a, b, c, d, + a, b, c, d,
+ e, f, g, h,
) )
foo( foo(
- a, b, c, d, - a, b, c, d,
- e, f, g, h,
+ a, b, c, d, + a, b, c, d,
+ e, f, g, h,
) )
[ [
- a, b, c, d, - a, b, c, d,
- e, f, g, h,
+ a, b, c, d, + a, b, c, d,
+ e, f, g, h,
] ]
``` ```

Loading…
Cancel
Save