Hi,
I've adapted the Python Properties file for SciTE to Cobra. It does syntax highlighting, folding, and hitting F5 runs the script.
Since I didn't manage to attach the file (all extensions were rejected), I paste it below.
# Define SciTE settings for Cobra files.
# Adapted from Python mode
file.patterns.cobra=*.cobra
filter.cobra=cobra (cobra)|$(file.patterns.cobra)|
lexer.$(file.patterns.cobra)=python
keywordclass.cobra=all and any as assert \
base be body bool branch break \
callable catch char class continue cue \
decimal def down dynamic \
else end ensure enum event every except expect extend \
false finally float for from get global has \
if ignore implements implies import in inherits inlined inout instance int interface invariant is \
listen must namespace nil not number \
objc of off old on or out override \
pass passthrough post print pro \
raise ref require return same set shared step stop struct success \
test this throw to to? trace true try \
use using var vari virtual where where while yield \
keywords.$(file.patterns.cobra)=$(keywordclass.cobra)
statement.indent.$(file.patterns.cobra)=10 :
statement.end.$(file.patterns.cobra)=
statement.lookback.$(file.patterns.cobra)=0
block.start.$(file.patterns.cobra)=
block.end.$(file.patterns.cobra)=
tab.timmy.whinge.level=1
#fold.quotes.cobra=1
comment.block.cobra=#~
# cobra styles
# White space
style.cobra.0=fore:#808080
# Comment
style.cobra.1=fore:#007F00,$(font.comment)
# Number
style.cobra.2=fore:#007F7F
# String
style.cobra.3=fore:#7F007F,$(font.monospace)
# Single quoted string
style.cobra.4=fore:#7F007F,$(font.monospace)
# Keyword
style.cobra.5=fore:#00007F,bold
# Triple quotes
style.cobra.6=fore:#7F0000
# Triple double quotes
style.cobra.7=fore:#7F0000
# Class name definition
style.cobra.8=fore:#0000FF,bold
# Function or method name definition
style.cobra.9=fore:#007F7F,bold
# Operators
style.cobra.10=bold
# Identifiers
style.cobra.11=
# Comment-blocks
style.cobra.12=fore:#7F7F7F
# End of line where string is not closed
style.cobra.13=fore:#000000,$(font.monospace),back:#E0C0E0,eolfilled
# Highlighted identifiers
style.cobra.14=fore:#407090
# Decorators
style.cobra.15=fore:#805000
# Matched Operators
style.cobra.34=fore:#0000FF,bold
style.cobra.35=fore:#FF0000,bold
# Braces are only matched in operator style
braces.cobra.style=10
if PLAT_WIN
cobra=C:\Code\Cobra\bin\cobra.exe
command.go.*.cobra=$(cobra) "$(FileNameExt)"
command.compile.*=$(cobra) -c "$(FileNameExt)"
if PLAT_GTK
cobra=cobra
command.go.*.cobra=$(cobra) "$(FileNameExt)"
command.compile.*=$(cobra) -c "$(FileNameExt)"
Forums
Cobra mode for SciTE
11 posts
• Page 1 of 2 • 1, 2
Re: Cobra mode for SciTE
I added block comments and a bunch of different compilation options that I've used.
# Define SciTE settings for Cobra files.
# Adapted from Python mode
file.patterns.cobra=*.cobra
filter.cobra=cobra (cobra)|$(file.patterns.cobra)|
lexer.$(file.patterns.cobra)=python
keywordclass.cobra=all and any as assert \
base be body bool branch break \
callable catch char class continue cue \
decimal def down dynamic \
else end ensure enum event every except expect extend \
false finally float for from get global has \
if ignore implements implies import in inherits inlined inout instance int interface invariant is \
listen must namespace nil not number \
objc of off old on or out override \
par pass passthrough post print pro \
raise ref require return same set shared step stop struct success \
test this throw to to? trace true try \
use using var vari virtual where where while yield \
keywords.$(file.patterns.cobra)=$(keywordclass.cobra)
statement.indent.$(file.patterns.cobra)=10 :
statement.end.$(file.patterns.cobra)=
statement.lookback.$(file.patterns.cobra)=0
block.start.$(file.patterns.cobra)=
block.end.$(file.patterns.cobra)=
tab.timmy.whinge.level=1
#fold.quotes.cobra=1
comment.block.cobra=#~
comment.stream.start.cobra=/#
comment.stream.end.cobra=#/
# cobra styles
# White space
style.cobra.0=fore:#808080
# Comment
style.cobra.1=fore:#007F00,$(font.comment)
# Number
style.cobra.2=fore:#007F7F
# String
style.cobra.3=fore:#7F007F,$(font.monospace)
# Single quoted string
style.cobra.4=fore:#7F007F,$(font.monospace)
# Keyword
style.cobra.5=fore:#00007F,bold
# Triple quotes
style.cobra.6=fore:#7F0000
# Triple double quotes
style.cobra.7=fore:#7F0000
# Class name definition
style.cobra.8=fore:#0000FF,bold
# Function or method name definition
style.cobra.9=fore:#007F7F,bold
# Operators
style.cobra.10=bold
# Identifiers
style.cobra.11=
# Comment-blocks
style.cobra.12=fore:#7F7F7F
# End of line where string is not closed
style.cobra.13=fore:#000000,$(font.monospace),back:#E0C0E0,eolfilled
# Highlighted identifiers
style.cobra.14=fore:#407090
# Decorators
style.cobra.15=fore:#805000
# Matched Operators
style.cobra.34=fore:#0000FF,bold
style.cobra.35=fore:#FF0000,bold
# Braces are only matched in operator style
braces.cobra.style=10
cobra=C:\Cobra\bin\cobra.bat
cobraert=C:\Cobra\bin\cobraERT.bat
cobrawin = C:\Cobra\bin\cobra-win.bat
objExplorer =C:\Cobra\bin\ObjectExplorer-WinForms.cobra
command.go.*.cobra=$(cobra) "$(FilePath)"
command.build.*.cobra=$(cobra) -c -turbo "$(FilePath)"
command.compile.*=$(cobra) -c "$(FilePath)"
command.name.0.*.cobra=Test
command.0.*.cobra=$(cobra) -test "$(FilePath)"
command.save.before.0.*.cobra=yes
command.name.1.*.cobra=Object Explorer
command.1.*.cobra=$(cobra) -ref:System.Windows.Forms -ref:System.Drawing "$(objExplorer)" "$(FilePath)"
command.save.before.1.*.cobra=yes
command.name.2.*.cobra=Compile ERT
command.2.*.cobra=$(cobraert) -c -turbo "$(FilePath)"
command.save.before.2.*.cobra=yes
command.name.3.*.cobra=Compile Library
command.3.*.cobra=$(cobraert) -c -target:lib "$(FilePath)"
command.save.before.3.*.cobra=yes
# Define SciTE settings for Cobra files.
# Adapted from Python mode
file.patterns.cobra=*.cobra
filter.cobra=cobra (cobra)|$(file.patterns.cobra)|
lexer.$(file.patterns.cobra)=python
keywordclass.cobra=all and any as assert \
base be body bool branch break \
callable catch char class continue cue \
decimal def down dynamic \
else end ensure enum event every except expect extend \
false finally float for from get global has \
if ignore implements implies import in inherits inlined inout instance int interface invariant is \
listen must namespace nil not number \
objc of off old on or out override \
par pass passthrough post print pro \
raise ref require return same set shared step stop struct success \
test this throw to to? trace true try \
use using var vari virtual where where while yield \
keywords.$(file.patterns.cobra)=$(keywordclass.cobra)
statement.indent.$(file.patterns.cobra)=10 :
statement.end.$(file.patterns.cobra)=
statement.lookback.$(file.patterns.cobra)=0
block.start.$(file.patterns.cobra)=
block.end.$(file.patterns.cobra)=
tab.timmy.whinge.level=1
#fold.quotes.cobra=1
comment.block.cobra=#~
comment.stream.start.cobra=/#
comment.stream.end.cobra=#/
# cobra styles
# White space
style.cobra.0=fore:#808080
# Comment
style.cobra.1=fore:#007F00,$(font.comment)
# Number
style.cobra.2=fore:#007F7F
# String
style.cobra.3=fore:#7F007F,$(font.monospace)
# Single quoted string
style.cobra.4=fore:#7F007F,$(font.monospace)
# Keyword
style.cobra.5=fore:#00007F,bold
# Triple quotes
style.cobra.6=fore:#7F0000
# Triple double quotes
style.cobra.7=fore:#7F0000
# Class name definition
style.cobra.8=fore:#0000FF,bold
# Function or method name definition
style.cobra.9=fore:#007F7F,bold
# Operators
style.cobra.10=bold
# Identifiers
style.cobra.11=
# Comment-blocks
style.cobra.12=fore:#7F7F7F
# End of line where string is not closed
style.cobra.13=fore:#000000,$(font.monospace),back:#E0C0E0,eolfilled
# Highlighted identifiers
style.cobra.14=fore:#407090
# Decorators
style.cobra.15=fore:#805000
# Matched Operators
style.cobra.34=fore:#0000FF,bold
style.cobra.35=fore:#FF0000,bold
# Braces are only matched in operator style
braces.cobra.style=10
cobra=C:\Cobra\bin\cobra.bat
cobraert=C:\Cobra\bin\cobraERT.bat
cobrawin = C:\Cobra\bin\cobra-win.bat
objExplorer =C:\Cobra\bin\ObjectExplorer-WinForms.cobra
command.go.*.cobra=$(cobra) "$(FilePath)"
command.build.*.cobra=$(cobra) -c -turbo "$(FilePath)"
command.compile.*=$(cobra) -c "$(FilePath)"
command.name.0.*.cobra=Test
command.0.*.cobra=$(cobra) -test "$(FilePath)"
command.save.before.0.*.cobra=yes
command.name.1.*.cobra=Object Explorer
command.1.*.cobra=$(cobra) -ref:System.Windows.Forms -ref:System.Drawing "$(objExplorer)" "$(FilePath)"
command.save.before.1.*.cobra=yes
command.name.2.*.cobra=Compile ERT
command.2.*.cobra=$(cobraert) -c -turbo "$(FilePath)"
command.save.before.2.*.cobra=yes
command.name.3.*.cobra=Compile Library
command.3.*.cobra=$(cobraert) -c -target:lib "$(FilePath)"
command.save.before.3.*.cobra=yes
- torial
- Posts: 229
- Location: IA
Re: Cobra mode for SciTE
Thanks. Feel free to attach this to the SciTE wiki page and update any notes there as you see fit.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: Cobra mode for SciTE
Already did it yesterday -- added the detail about modifying the Global Properties as well, so that a new user to SciTE would have some ideas as to how to proceed. BUT, the first bullet point is mangled / new lined and don't know why...
- torial
- Posts: 229
- Location: IA
Re: Cobra mode for SciTE
I believe that has to do with the vertical bars, |, on the line. The wiki is interpreting those to create a table . I'm not sure what the proper text would be though.
- todd.a
- Site Admin
- Posts: 81
- Location: Chicago, IL
Re: Cobra mode for SciTE
Perfect... that gave me the clue.. wrap them in {{{ / }}} and then it worked just fine.
- torial
- Posts: 229
- Location: IA
Re: Cobra mode for SciTE
torial wrote:Already did it yesterday...
Maybe I'm just not seeing it, but I don't see any attachment at that page. I do see the links to the forums which is nice, but attachments to the editor support wiki pages are nice because you don't have to wade through any discussions to locate the latest--it's right there on the page. See GtkEditors at the bottom, for example.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: Cobra mode for SciTE
Ok, I attached my Global properties, and the cobra.properties. And left the old stuff in (plus the discussion on manually modifying the Global properties) in case someone doesn't wish to stomp over their Global properties file.
- torial
- Posts: 229
- Location: IA
Re: Cobra mode for SciTE
I updated the SciTE wiki page -- added a "cobraproj" filetype to SciTE, that allows a cobraproj file to act as a files list for compilation purposes. This greatly eases development across multiple files for SciTE. Compilation needs to be done from the cobraproj file.
- torial
- Posts: 229
- Location: IA
11 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 18 guests