Skip to content

Commit

Permalink
Merge pull request #50 from RaimoNiskanen/dev
Browse files Browse the repository at this point in the history
Update after OTP Technical Board 2023-08-31
  • Loading branch information
RaimoNiskanen authored Sep 1, 2023
2 parents 3fda0ac + 7e4e80e commit 0fabde3
Showing 1 changed file with 71 additions and 27 deletions.
98 changes: 71 additions & 27 deletions eeps/eep-0064.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,16 @@ in the string, and strips the newline preceding the ending line.

If any of the lines do not start with the defined indentation
either because the line is too short or if the prefix differs,
a syntax error is reported.

Requiring that all lines must have exactly the same indentation
characters is a simple solution to not have to define how indentation
white-space (tab vs. space) normalization should be done,
a syntax error is reported. For convenience and to adhere
to editor conventions, however; an empty line may be
completely empty instead of indented, but if it starts with
white-space characters that is not a newline,
they must be the defined indentation.

Requiring that all lines (except empty lines) must have
exactly the same indentation characters is a simple solution
to not have to define how indentation white-space
(tab vs. space) normalization should be done,
and also seems like a reasonable requirement.

### `CR`, `LF` and White-Space
Expand Down Expand Up @@ -268,16 +273,22 @@ The rules above strips one leading and one trailing newline.
This is a simple convention that also gives control over
the string's content:

Example 1:

"""

X

""" = "\n X\n",

""" = "\n X\n"

Example 2:

"""
X
""" = "X",

""" = "X"

Example 3:

"""
""" = ""
Expand All @@ -298,32 +309,65 @@ The rules above facilitates indentation of the content
to adhere to the surrounding code. The ending line
determines the indentation.

Example 1:

"""
This text
has no indentation
This string
is not indented
""" =
"This text\nhas no indentation",

"This string\nis not indented"

Example 2:

"""
This text
has indentation
""" =
" This text\n has indentation",

This string
is indented
""" =
"This string\nis indented"

Example 3:

"""
This text
has an indented first line
""" =
" This text\nhas an indented first line",

This indented string
has an indented first line
""" =
" This indented string\nhas an indented first line"

"""

Example 4:

foo() ->
X =
"""
This indented string
has an indented first line

and an empty line that is not indented
""",
%% That content line 3 is empty instead of indented
%% is only visible if you "touch" the text
%% with the cursor or the mouse
X =
" This indented string\n"
"has an indented first line\n"
"\n"
"and an empty line that is not indented".

Example 5:

"""
This is a syntax error (incorrect indentation)
""",

"""

Example 6:

""" This is a syntax error
(non-white-space on start line)
""",

"""

Example 6:

"""
This is an incomplete string so the scanner will search forward
for the end, and the shell will block waiting for more lines,
Expand Down

0 comments on commit 0fabde3

Please sign in to comment.