You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then its indentation width is less then the current indentation width,
86
+
and it either matches a previous indentation width or is also less
87
+
than the enclosing indentation width.
85
88
86
89
If an `<outdent>` is inserted, the top element is popped from `IW`.
87
90
If the indentation width of the token on the next line is still less than the new current indentation width, step (2) repeats. Therefore, several `<outdent>` tokens
@@ -105,6 +108,24 @@ if x < 0 then
105
108
Indentation tokens are only inserted in regions where newline statement separators are also inferred:
106
109
at the top-level, inside braces `{...}`, but not inside parentheses `(...)`, patterns or types.
107
110
111
+
**Note:**The rules for leading infix operators above are there to make sure that
112
+
```scala
113
+
one
114
+
+ two.match
115
+
case1=> b
116
+
case2=> c
117
+
+ three
118
+
```
119
+
is parsed as `one + (two.match ...) + three`. Also, that
120
+
```scala
121
+
if x then
122
+
a
123
+
+ b
124
+
+ c
125
+
else d
126
+
```
127
+
is parsed as `if x then a + b + c else d`.
128
+
108
129
###OptionalBracesAroundTemplateBodies
109
130
110
131
TheScala grammar uses the term _template body_ for the definitions of a class, trait, or objectthat are normally enclosed in braces. The braces around a template body can also be omitted by means of the following rule.
0 commit comments