[Moin-user] csound parser - fixed
Jonathan Murphy
typetosmurky at bigpond.com
Thu Feb 8 10:09:27 EST 2007
Figured out what the problem was, I needed to add:
self.addRule("ID","[a-zA-Z_][0-9a-zA-Z_]*")
Jonathan.
Jonathan Murphy <typetosmurky at bigpond.com> writes:
> Hi Folks,
>
> I'm trying to write a Csound parser for the csoundwiki.
>
> http://tobiah.org/csoundwiki/Csound_Home
>
> As a preliminary step, I'm just trying to highlight Csound opcodes and
> comments. It's not working and I don't know why. I'm a Python novice,
> so I'm hoping that it's something obvious that a more experienced
> programmer will be able to point out. This is my effort so far (the
> list of opcodes is truncated so that this post isn't too long):
>
> # -*- coding: iso-8859-1 -*-
> """
> MoinMoin - Csound Parser
>
> @copyright: 2007 Jonathan Murphy
> @license: GNU GPL, see COPYING for details.
>
> """
>
> from MoinMoin.util.ParserBase import ParserBase
>
> Dependencies = []
>
> class Parser(ParserBase):
>
> parsername = "ColorizedCsound"
> extensions = ['.orc', '.sco', '.csd']
> Dependencies = []
>
> def setupRules(self):
> ParserBase.setupRules(self)
>
> self.addRulePair("Comment","/[*]","[*]/")
> self.addRule("Comment",";.*$")
>
> reserved_words = ['ATSadd',
> 'ATSaddnz',
> 'ATSbufread',
> 'ATScross',
> 'ATSinfo',
> 'ATSinterpread',
> 'ATSpartialtap',
> 'ATSread',
> 'ATSreadnz',
> 'ATSsinnoi']
>
> self.addReserved(reserved_words)
>
> Thanks in advance,
> Jonathan.
>
> PS When I say "it isn't working," I just mean that there is no
> highlighting, the parser is installed correctly and gives plain text
> with line numbers, but that's all. I have put up a test page here:
>
> http://tobiah.org/csoundwiki/TestPage
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Moin-user mailing list
> Moin-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/moin-user
More information about the Moin-user
mailing list