Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting ackmate format #1508

Open
masad-frost opened this issue Jan 10, 2023 · 0 comments
Open

Documenting ackmate format #1508

masad-frost opened this issue Jan 10, 2023 · 0 comments

Comments

@masad-frost
Copy link

masad-frost commented Jan 10, 2023

Since the "parseable ackmate format" does not have any documentation on what the format is, I thought I'd do the world a favor and document those here.

A. Lines that look like this :string are filename matches, maps to :filepath
B. Lines that look like this number:string are context lines with no matches, it maps to lineNumber:lineContent
C. Lines that look like this number;number number:string are lines with matches, it maps to lineNumber:matchStartIndex matchLength:lineContent
D. Lines can contain multiple matches, and it looks like number;number number{,number number}+:string, which basically means you'll have multiple matchStartIndex matchLength that are comma separated. Here's regex ^(\d+);((\d+ \d+)(,\d+ \d+)*):(.*)$
E. Lines that look like number;string (not to be confused with B which has a colon, this is a semi-colon) is used when there is a multline line match, this maps to lineNumber;lineContent, the match will found at the first match line (see C) spanning from the first E, the matchStartIndex will be referring to the index in the first matched line. Wild.
F. Lines that look like -- are context group separators, can be ignored.

Worth noting that multiline matches don't work when there's an existing match on the beginning of the match.

This was hastily written feel free to ask for clarification.

Here's an example with a context of 1 matching against string wow

:myproject/filename.ext
1:hello
2;0 3:wow
3:friend
--
7:eyy
8;4 7,10 13:abcdwowabcwow
9:byebye

Here's an example with a context of 0 matching against string hello\nworld

:myproject/filename.ext
2;sup hello
3;4 11:world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant