groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] GroffHub


From: John Gardner
Subject: Re: [Groff] GroffHub
Date: Sat, 23 Jul 2016 00:59:09 +1000

>
> *CSTR 54 has a list of the original ones.  :-)*


Haha, don't worry, I was actually going through it page-by-page when I
wrote this. =) I simply meant that I forgot about how that particular macro
should affect highlighting.

*After a .ft with no arguments, it seems.*


Okay, you've just pointed out a very important oversight with how the
site's parsing engine handles certain lookaheads. Thank you.

GitHub's highlighting is driven by a different regular expression engine to
the one Atom uses, so there're some discrepancies with how newlines are
handled. I'll double-check each expression using (?=\n) and make sure it's
using (?=\n|$) to cater for the differences.

On 22 July 2016 at 23:47, Ralph Corderoy <address@hidden> wrote:

> Hi John,
>
> > > That's why .ig doesn't cause subsequent lines to be ignored.
> >
> > Uh, actually, I completely forgot about that macro...
>
> CSTR 54 has a list of the original ones.  :-)
>
> > That actually *can*
> > be handled in a line-based fashion, because TextMate operates by opening
> > "scopes" in response to patterns. Thanks for picking up on that!
>
> It's like .de rather than just ignoring its content, e.g.
>
>     $ nroff | grep .
>     .nr x 1 10
>     \n+x
>     .ig gy
>     \n+x
>     .gy
>     \n+x
>     ^D
>     11 31
>     $
>
> > > And why \\fB inside a .de is treated as \fB.
> >
> > That was actually a conscious exception on my part. Many roff macros need
> > heavy escaping, so I made all `\` characters match as one character.
>
> Ah, OK.  I think one common error is forgetting to have sufficient \ in
> a macro definition.  (What do others think?)  Having \fB and \\fB appear
> different inside a .de scope would help show that.  But I also see that
> having the fB be recognised is useful too.
>
> > > Why is .PS orange versus .PE's purple?
> >
> > Hrm, could you show me where you're seeing that, please? =)
>
> After a .ft with no arguments, it seems.
>
>
> https://github-lightshow.herokuapp.com/?utf8=%E2%9C%93&scope=from-url&grammar_url=https%3A%2F%2Fgithub.com%2FAlhadis%2Flanguage-roff%2Fblob%2Fstatic%2Froff.json&grammar_text=&code_source=from-text&code_url=https%3A%2F%2Fgithub.com%2Frust-lang%2Frust%2Fblob%2Fmaster%2Fman%2Frustdoc.1&code=.de+MO+ed%0D%0A%5C%5CfBerror%5CfP+%5C%5CfIok%5C%5CfP%0D%0A.ed%0D%0A.ig+gy%0D%0A.nothing+special%2C+but+%5Cn%2Br%0D%0A.gy%0D%0A.ft+B%0D%0A.ft%0D%0A.PS%0D%0Abox+box+box%0D%0A.PE
>
> Cheers, Ralph.
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]