• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / jasengo / 19653481484

25 Nov 2025 12:05AM UTC coverage: 80.612% (+1.8%) from 78.771%
19653481484

push

github

web-flow
feat: Add `Not` combinator and syslog parsing example (#10)

* feat: Add `Not` combinator and syslog parsing example

Introduces the `Not` parser combinator, which provides negative
lookahead functionality. It succeeds if the inner parser fails
and consumes no input upon success/failure (unless a fatal
error occurs).

Updates the internal `Fail` parser to accept an optional error
cause parameter.

A comprehensive syslog parsing example and infrastructure,
including new test data in `Linux_2k.log`, is included
demonstrating complex usage, particularly using `Not` for
delimited sections (e.g., parsing a message up to attributes).

* fix: Correct type assertion for map attributes

The `v[7]` parameter is now expected to be a pointer to a map
(`*map[string]string`), requiring changes to the type assertion
and subsequent dereferencing when assigning to
`logLine.Attributes`.

* Update parser_test/example3_test.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* refactor: Use unicode checks for word characters

Replaced manual character range checks with `unicode.IsLetter` and
`unicode.IsDigit` for defining acceptable word characters in tests.

Also includes minor cleanups:
* Updates `.gitignore` to exclude `__debug_bin*`.
* Wraps deferred file closing in tests to handle potential errors
  when calling `file.Close()`.
* Removes a redundant `parser.Token` call in `messageP`.

* fix: Correctly consume newlines in log parser

The log parser definition used in `example3_test.go` is updated
to correctly define the boundaries of a single log line,
allowing iteration over a file containing multiple lines.

Key fixes:
*   `messageCharP` now explicitly forbids newline characters.
*   `logLineP` now consumes mandatory trailing whitespace/newlines.
*   Attribute separation is restricted to horizontal space (` \t`).

Additionally, `logLineP` is refactored into a variable definition,
and `State.Remaining()` implemen... (continued)

46 of 58 new or added lines in 4 files covered. (79.31%)

3 existing lines in 1 file now uncovered.

474 of 588 relevant lines covered (80.61%)

0.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.47
/parser/reader.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc