remove ability to mark if and switch as inline

if and switch are implicitly inline if the condition/target
expression is known at compile time.

instead of:

```
inline if (condition) ...
inline switch (target) ...
```

one can use:

```
if (comptime condition) ...
switch (comptime target) ...
```
This commit is contained in:
Andrew Kelley
2017-02-02 13:23:18 -05:00
parent cd08c1f3be
commit b78c91951a
7 changed files with 29 additions and 64 deletions

View File

@@ -844,14 +844,12 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) {
}
case NodeTypeBreak:
{
const char *inline_str = node->data.break_expr.is_inline ? "inline " : "";
fprintf(ar->f, "%sbreak", inline_str);
fprintf(ar->f, "break");
break;
}
case NodeTypeContinue:
{
const char *inline_str = node->data.continue_expr.is_inline ? "inline " : "";
fprintf(ar->f, "%scontinue", inline_str);
fprintf(ar->f, "continue");
break;
}
case NodeTypeSliceExpr: