blitz-foundation / monkey2

zlib License
3 stars 0 forks source link

Docs: line breaks / line continuation #116

Open Pharmhaus-2 opened 5 years ago

Pharmhaus-2 commented 5 years ago

Original Author: D-a-n-i-l-o

The documentation in misc.md says:

Line breaks in code

Lines can currently only be split after ‘[‘, ‘(‘ or ‘,’ tokens.

Monkey2 supports line breaks at many more things, for example:

    Local integer := 1 +
                     2 *
                     3 /
                     4 -
                     5 Mod
                     6

    Local l := "line 1~q"+
               "line 2~q"+
               "line 3~q"+
               "line 4~q"

    Local flag := mojo.app.WindowFlags.Resizable |
                  mojo.app.WindowFlags.HighDPI   |
                  mojo.app.WindowFlags.Center

    If 5 =
           5 Or
                1 <
                    2 And
                          3 >
                              4 Then Print "okay"

Would it be okay to add this to the documentation? (I could do it)

Did I miss any supported line-continuation characters/operators?