Hello Toma, I gave it a try and came up with this. I set lemmas as functions (they show up in the functions drop down, but are not getting colored), properties as strings, and comments as comments. I'm not sure how to get BBEdit to color more than just strings and comments, but it's a start:
TT.plist, installed in ~/Library/Application Support/BBEdit/Language Modules/ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>BBEditDocumentType</key> <string>CodelessLanguageModule</string> <key>BBLMColorsSyntax</key> <true/> <key>BBLMSuffixMap</key> <array> <dict> <key>BBLMLanguageSuffix</key> <string>.tt</string> </dict> </array> <key>BBLMIsCaseSensitive</key> <false/> <key>BBLMKeywordList</key> <array/> <key>BBLMLanguageCode</key> <string>TT</string> <key>BBLMLanguageDisplayName</key> <string>TT</string> <key>BBLMScansFunctions</key> <true/> <key>BBLMSupportsTextCompletion</key> <true/> <key>BBLMCommentLineDefault</key> <string># </string> <key>Language Features</key> <dict> <key>Function Pattern</key> <string>(?P<function>,(?P<function_name>[^\+#,\.]*)\.)</string> <key>Comment Pattern</key> <string>#.*?$</string> <key>String Pattern</key> <string>(?:\+)([^\+#,\.]*)</string> </dict> <key>com.barebones.DocumentType</key> <string>CodelessLanguageModule</string> </dict> </plist> On Sunday, January 29, 2017 at 11:11:42 AM UTC-5, TT wrote: > > Any chance somebody could point me in the direction of how to use the > regular expressions described in my original posting in December to create > a new syntax definition? > > петак, 09. децембар 2016. 15.13.11 UTC+1, TT је написао/ла: >> >> Hi, >> >> I have a bunch of documents that look like this: >> >> Moscow,Moscow.+N+NProp+Top+Lang=en#comment >> Москве,Москва.+N+NProp+Top+Lang=ru#comment >> >> So, the structure is very clear and easily capturable with regular >> expressions. >> >> The word form is: ^([^,]*), >> The lemma is: ,([^\.]*). >> Properties are: \+([^+#]*) >> And comments: #([^.]*)$ >> >> Now, I would like to create a custom highlighting syntax that would let >> me color words, lemmas, properties and comments (the values captured by the >> regex, i.e. only the portions between parentheses) each in different color. >> That would leave the delimiters (, . + and #) unstyled. >> >> I've looked at the documentation for writing a codeless language syntax, >> but haven't been able to make any sense of it. >> >> Given that I have the regular expressions that I need, could somebody >> point me in the right direction, i.e. give me an example of how to embed >> one of these regexes into the language syntax plist? >> >> I will be much obliged. >> >> All best, >> Toma >> > -- 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.
