alecthomas / alecthomas/participle

Document how to parse indentation based grammars

Offen
#20 16 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Go
Sterne
3.9k
Forks
213
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi I want to check if the prevoius char is a `:`. The exact example code I have is this:

```
Prefix: !
```

I want basicly to be able to check based on if the previous char is a `:` the `!` should get a string and later reuse the look back logic to check if I am inside an array which is defined like in yaml meaning to make sure the last 2 lines of the following example don't get into the array:

```
Commands:
- Trigger: afk
Response: "{{user}} just went afk"
- Trigger: [join_event]
Response: "Welcome to the Room {{last_joined_user}}"
Homeserver: matrix.org
HomeRoom: {{name}}
```

(Commands defines a Array with 2 objects in it which both have two key value pairs in them. HomeServer and HomeRoom are outside of that array)

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.