> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.setinwhenclause.md).

# SetInWhenClause(bool)

Method in [IndentAwareLexer](/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer.md)

## Summary

Sets a value indicating whether the lexer is currently lexing an expression that's part of a 'when' clause.

```csharp
public virtual void SetInWhenClause(bool val);
```

## Remarks

This value can be accessed by calling [IsInWhenClause()](/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.isinwhenclause.md) .

## Parameters

| Name       | Description       |
| ---------- | ----------------- |
| `bool` val | The value to set. |
