Closed Eolien55 closed 1 year ago
I've migrated the lexer as you asked; is the result acceptable?
This looks better. I'll have a more thorough look when I have some time and get back to you. Thanks!
I believe I've gone over all your change requests
I believe the lexer works correctly, and is complete.
If you can get it to lex everything man does and more
I have this test file, and my lexer effectively lexes everything man does, and more.
.NH 1 \" ms's way of declaring headings
A \fBHeading\fP
.so included.1
.PP
Wonderful\*[SUP]Mom macro set's way of making supertext\*[SUPX]
.PS
\" I don't know how pic works
.PE
\[some random escaped text]
\s+(88
.HEADING 1 "First-level heading" \" Mom macro's headings
As a sidenote, I find it quite funny that even Github doesn't highlight troff code correctly.
Added via https://github.com/orbitalquark/scintillua/commit/369ee2bb1b6e8c6a613c45e1ee88779e28060e85. Thanks for your time and patience!
As the title suggests, I wrote an improved version of the
man
lexer, while still retaining most of its features.-man
headers highlighting have been kept, and the rest is way more generic (strings, all-caps/all-lowercase macros, etc.). It should also be noted that this lexer incorporatesgroff
-specific elements, such aswhile
s and other structured programming.What's been added :
-man
macros were recognized)"
; a bit buggy when the string is stopped by a newline rather than a matching"
)\
) recognitionWhat could be improved :
-mom
and-mandoc
) have a special syntax for some macros. Support could potentially added to support those.