Commit 235590c
authored
feat: add JSONL support to JSON lexer (#1262)
### Description
This PR adds support for JSON Lines (JSONL) to the existing JSON lexer.
Because the existing JSON lexer already handles repeating objects
natively, this implementation simply maps the \`jsonl\` file extension,
alias, and mime type to the \`JSON\` lexer configuration without needing
any underlying state machine changes.
Inspired by walles/moor#407.
### Changes
* **Alias added:** \`jsonl\`
* **File extension added:** \`*.jsonl\`
* **MIME type added:** \`application/jsonl\`
* **Tests:** Added \`jsonl.actual\` and \`jsonl.expected\` validation
files to ensure tokens are correctly extracted across newlines in
\`.jsonl\` files.
### Testing
Ran \`go test ./lexers -run TestLexers\` locally to verify that JSON
Lines objects format accurately and consistently.1 parent f9b5c97 commit 235590c
4 files changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments