Howdy,
After studying <http://www.barebones.com/support/develop/clm.html> a while,
I took a stab at doing a code-less language module (CLM) for nginx config
files. The version I have so far is at
<https://gist.github.com/isao/8983629>
It's serviceable, highlights quoted strings, keywords/tokens, and comments.
But I ended up having to use String-Based Patterns and hard-coding known
tokens in BBLMKeywordList and BBLMPredefinedNameList.
This is less than ideal for a couple of reasons. One is I don't want to
maintain the token/keyword list (which depend on how nginx is compiled).
Another is, for example, "pid" is a directive, but the string "pid" ends up
highlighted in the pid value. i.e. "pid" is highlighted at both the
beginning and end of this line
pid /var/run/nginx.pid;
I did try regex based patterns, but git stuck... Thing is, the hueristic
should be fairly simple. Here's an example config file:
<https://gist.github.com/isao/8983629#file-z-example-conf> Here's a
simplified psuedo-example:
directive value or values;
block_directive
{
directive value;
directive values values values;
# etc.
}
block_directive_2 { # some comment
foo bar;
}
Ideally, I'd like the simple directives like this match ^(\w+)\s+(.+);$ to
be matched like a function prototype, and the block directives to be
treated like functions, so that I can navigate to them with the function
popup.
** Or, at least, I'd be more than happy if I can just get a pattern where
^(\w+) is treated as a token, and everything after that on the same line is
treated like a string/value (except comments and curly braces). **
Thanks in advance for any help!
Cheers,
Isao
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].