# #pragma syntax directive

Source: https://ref.dm-lang.org/DM/preprocessor/pragma/syntax
Added in BYOND 516.

### Format
> `#pragma syntax <C|DM> [for|switch]`

Changes the syntax used to parse certain statements. This can be more natural for users who prefer non-DM style, and can sometimes do things that regular DM syntax can't do.

Changing the [`for()` loop](https://ref.dm-lang.org/proc/for/loop.md) syntax to C will use semicolons to separate the Init, Test, Inc sections instead of commas. That means commas can be used to chain multiple statements together instead.

In [switch()](https://ref.dm-lang.org/proc/switch.md), C syntax changes the if/else statements to use C's `case` and/or `default` keywords, followed by a colon, and the [`break` statement](https://ref.dm-lang.org/proc/break.md) is required to skip to the end of the switch unless you want to fall through to the next case. Fall-through behavior isn't possible in the default DM syntax.

```dm
#pragma push
#pragma syntax C switch

switch(thing)
    case 1:
        usr << "This is case 1!"
        break
    case 2, 3:
        usr << "This is case 2 or 3."
        // no break, fall through
    case 4 to 6:
        usr << "This is case 4 through 6 (or maybe 2 or 3)."
        break
    default:
        usr << "This is a different case.

#pragma pop
```

### See also
- [#pragma directive](https://ref.dm-lang.org/DM/preprocessor/pragma/index.md)
- [for loop proc](https://ref.dm-lang.org/proc/for/loop.md)
- [switch proc](https://ref.dm-lang.org/proc/switch.md)
