> 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.md).

# IndentAwareLexer

Class in [Yarn.Compiler](/api/csharp/yarn.compiler.md)

Inherits from `Antlr4.Runtime.Lexer`

## Summary

A Lexer subclass that detects newlines and generates indent and dedent tokens accordingly.

```csharp
public abstract class IndentAwareLexer : Lexer
```

## Constructors

| Name                                                                                                                                                    | Description                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [IndentAwareLexer(ICharStream,TextWriter,TextWriter)](/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer..ctor.md) | Initializes a new instance of the [IndentAwareLexer](/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer.md) class. |

## Methods

| Name                                                                                                                                | Description                                                                                                    |
| ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| [IsInWhenClause()](/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.isinwhenclause.md)       | Returns a value indicating whether the lexer is currently lexing an expression that's part of a 'when' clause. |
| [NextToken()](/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.nexttoken.md)                 |                                                                                                                |
| [SetInWhenClause(bool)](/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.setinwhenclause.md) | Sets a value indicating whether the lexer is currently lexing an expression that's part of a 'when' clause.    |

## Properties

| Name                                                                                                            | Description                                               |
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| [Warnings](/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.warnings.md) | Gets the collection of warnings determined during lexing. |

## Structs

| Name                                                                                                                    | Description                      |
| ----------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| [LexerWarning](/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.lexerwarning.md) | A warning emitted during lexing. |
