CLM rejects function RE accepted in-editor

18 views
Skip to first unread message

Fritz Anderson

unread,
Jun 1, 2014, 4:19:00 PM6/1/14
to bbe...@googlegroups.com
I have a regular expression for a codeless language module that works in the editor, but will not parse when BBEdit tries to load it. I need a fresh pair of eyes.

Consider this file content (but not too long):

(1912) PLEASE (1913) NEXT
DO .2 <- :1~'#65280$#65280'
PLEASE RETRIEVE :2 + .3 + :1 + :3
DO RESUME #2
(1914) PLEASE RESUME #1$"'.1~.1'~#1"
(1913) PLEASE (1914) NEXT

“Functions” run from the initial label up to the parenthesis beginning the next label (or end-of-file).

I’m writing the CLM using the regular-expression options. The following pattern matches every function exactly when I use the find dialog in BBEdit:

(?P<function>(^\((?P<function_name>\d+)\))(?s:.+?(?=\r\(|\Z)))

This gets XML-ified for the plist as

<string>(?P&lt;function&gt;(^\((?P&lt;function_name&gt;\d+)\))(?s:.+?(?=\r\(|\Z)))</string>

(If your mail client broke that line, rest assured it’s all one line.) I’d like to use (?x:...) syntax and CDATA, but I’m cutting out extraneous issues.

The CLM loader rejects the function pattern:

6/1/14 ... The following problem(s) were encountered while loading the language module at /Users/fritza/Dropbox/Application Support/BBEdit/Language Modules/INTERCAL.plist:
6/1/14 ... The Function Pattern was invalid (missing ')' (application error code: 12214)).
6/1/14 ... The reported problems will prevent the language module from loading.

plutil thinks the plist is OK. I’ve checked the plist for extraneous angle brackets and ampersands. Using CDATA doesn’t help.

I need a fresh set of eyes here. What am I missing?

— F

Charlie Garrison

unread,
Jun 1, 2014, 4:49:02 PM6/1/14
to bbe...@googlegroups.com
Good morning,

On 1/06/14 at 3:18 PM -0500, Fritz Anderson
<anderso...@gmail.com> wrote:

>(?P<function>(^\((?P<function_name>\d+)\))(?s:.+?(?=\r\(|\Z)))

The parens don't match, one more opening than closing. Not sure
how the regex works in BBedit, maybe it silently closes last parens.

Charlie

--
Charlie Garrison <garr...@zeta.org.au>
PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

Reply all
Reply to author
Forward
0 new messages