# Matcher

A matcher check the sequence of characters in a string to build a special kind of token.  But sometimes you don't want to build tokens but you wanna seperate them or ignore phrases. This can be done by implementing an IgnoreMatcher. The ignore matcher advances the lexer to a certain position without building a token.

```csharp
protected override void InitLexer(LexerConfig lexer)
{
        lexer.MatchBoolean(ignoreCasing: true);
        lexer.MatchString("'", "'");
        lexer.MatchNumber(allowHex: true, allowBin: true);
}
```

The lexer provides several default methods for ignoring characters or matching specific kinds of tokens with various configuration options. Here is a list of all methods:The lexer provides several default methods for ignoring characters or matching specific kinds of tokens with various configuration options. Here is a list of all methods:

| Method      | Description                                                                                | Example                         |
| ----------- | ------------------------------------------------------------------------------------------ | ------------------------------- |
| AddSymbols  | Add Symbols like punctuators or operators                                                  | lexer.AddSymbols(":", ".")      |
| AddKeywords | Add keywords to be recognized by syntax highligthing. Keywords will be treated as symbols. | lexer.AddKeywords("let", "mut") |

{% hint style="info" %}
Only symbols that are not recoginition symbols of parselets have to be explicitly added to the lexer.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://furesoft.gitbook.io/silverfly/basics/lexer/markdown.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
