Skip to content

Commit

Permalink
caseStmtMacros no longer experimental, experimental manual refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Nov 22, 2021
1 parent 1b143f5 commit 6d53ca5
Show file tree
Hide file tree
Showing 7 changed files with 1,415 additions and 1,395 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
x, y, z: int
Baz = object
```
- [Case statement macros](manual.html#macros-case-statement-macros) are no longer experimental,
meaning you no longer need to enable the experimental switch `caseStmtMacros` to use them.

## Compiler changes

Expand Down
2 changes: 1 addition & 1 deletion compiler/options.nim
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ type
notnil,
dynamicBindSym,
forLoopMacros, # not experimental anymore; remains here for backwards compatibility
caseStmtMacros,
caseStmtMacros, # ditto
codeReordering,
compiletimeFFI,
## This requires building nim with `-d:nimHasLibFFI`
Expand Down
8 changes: 4 additions & 4 deletions compiler/semstmts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -987,10 +987,10 @@ proc semCase(c: PContext, n: PNode; flags: TExprFlags): PNode =
else:
popCaseContext(c)
closeScope(c)
if caseStmtMacros in c.features:
result = handleCaseStmtMacro(c, n, flags)
if result != nil:
return result
#if caseStmtMacros in c.features:
result = handleCaseStmtMacro(c, n, flags)
if result != nil:
return result
localError(c.config, n[0].info, errSelectorMustBeOfCertainTypes)
return
for i in 1..<n.len:
Expand Down
Loading

0 comments on commit 6d53ca5

Please sign in to comment.