Hi,

I'm following the notes at 
http://www.barebones.com/support/develop/clm.html#Functions to write a CLM 
for Elm (http://elm-lang.org/) <http://elm-lang.org/> but I'm having a bit 
of trouble and have a few questions. I've followed the tips at the end of 
the doc so:

a) plutil -lint is fine.
b) Elm appears in the language pop-up.
c) The syntax is coloured.

However, no functions are found in the functions pop-up.

My questions:

1. The regex syntax looks to be Python flavoured (because of the (?P...) 
modifier) but the whitespace modifier is (x: with a colon and wraps the 
entire regex. Which engine is being used?

2. The regex (I'll include it below) works via the Find dialog but 
obviously not via the Plist. The pattern uses inline modifiers (?s) and 
(?-s) to help capture the function body. However, the aforementioned (?x: 
syntax won't work in the find dialog, (?x) at the beginning, not wrapping 
the regex, is what works so I'm wondering if the single line mode (?s) will 
work in the Plist? I (now) know that Python doesn't support (?-s)

3. I'm assuming multiline mode is on by default in the CLM.

Here is the relevant section of the Plist.

  <key>BBLMScansFunctions</key>
  <true/>
  <key>Function Pattern</key>
  <string><![CDATA[
  (?x:                            # Verbose
    (?P<function>
      (?:                         # Note: type sig expected first!
        (?P<function_name> ^\w+ ) # name
        \s+ : \s+                 # start of types
        (?:
          [A-Z][a-z]+             # Type, e.g. String
          (?: \s+ [a-z]+ )?       # little type, e.g. Html msg
        )
        (?:                       # extra args
          \s+
          (?: \-\>\s+ )?          # e.g. -> Maybe
          [A-Z][a-z]+             # same as above with Type
          (?: \s+ [a-z]+ )?       # and little type
        )*$                       # repeat till end
      )\n
      (?s)                        # single line (dotall) on
      ^.+?\n$                     # method body
      (?-s)                       # single line (dotall) off
      (?=\n$\n|\Z)                # 2 line breaks or eof follows
    )
  )]]>
  </string>

I've tried looking for other examples that make use of regex options but 
I've not found any.

Any help or insight would be much appreciated.

Regards,
iain

-- 
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].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to