GNOME Bugzilla – Bug 345911
Support for OCL files
Last modified: 2007-07-03 10:21:24 UTC
Object Constraint Language[1] is a formal language to describe expressions on UML models. [1]http://www.omg.org/technology/documents/formal/ocl.htm
Created attachment 67996 [details] Proposed OCL syntax
My fault, this bug doesn't belongs to gnome-mime-data, belongs to gtksourceview. Sorry
Moved bug from gnome-mime-data to gtksourceview.
Thanks for the lang file. We have a policy of holding up inclusions of lang files until the mime type is included in the mime db. I see you already filed the relative bug in bugzilla.freedesktop.org, so we are blocking on: http://bugs.freedesktop.org/show_bug.cgi?id=7327
Changing default asignee and QA to gtksourceview-maint@gnome.bugs (correct asignee). Sorry for the spam
FreeDesktop team have applied the patch: http://bugs.freedesktop.org/show_bug.cgi?id=7327
Hi Mario, sorry if this is taking so long, we were waiting for the freedesktop mime type... the next version of gtksourceview will have a new more powerful format for lang files: http://live.gnome.org/GtkSourceView/NewLangFormat, can you update your file? It should be really easy in this case... Also, to have your lang file included in gtksourceview it should licensed under LGPL license
Sure Paolo. I'll update both lang file and its license as soon as possible.
Created attachment 91008 [details] OCL Language file Language file upgraded to use new Gtksourceview syntax.
Comment on attachment 91008 [details] OCL Language file File looks mostly ok, except for a couple of things noted below: > <!-- Comments --> > <context id="comment" style-ref="comment"> > <start>--</start> > <end>$</end> > <include> > <context id="comment-continue"> > <match>\\\n</match> > </context> I have not tested, but I doubt that trying to match \n works. You probably want something like <context id="line-continue" style-ref="escape"> <start>\\$</start> <end>^</end> </context> In fact that is defined in def.lang and so you should probably just use <context ref="def:line-continue"/> > <context ref="def:comment:*"/> This looks strange too... apart from the fact that I don't see any contetx matching def:comment:*, I don't think that blanket context inclusion is a good idea: in the future def: contexts could be added that you don't want there. I think you should just include <context ref="def:in-comment"/> > </include> > </context> > > <!-- Strings --> > <context id="string" end-at-line-end="true" style-ref="string"> > <start>"</start> > <end>"</end> > <include> > <context id="string-continue" style-ref="escape"> > <match>\\\n</match> > </context> same as above: use def:line-continue > <context ref="def:c-style-escape"/> > </include> > </context> > > <!-- Operators used on all types --> > <context id="operators" style-ref="keyword"> You probably want style-ref="operators" here since you defined such style
Created attachment 91052 [details] OCL Language file, fixed I've updated the lang file based on your comments and some other minor problems are solved. BTW. Is possible to validate syntax with this new engine and show an error? For example show error on if 1 = 1 endif because "then" is missing due to the rule is defined as: if 1 = 1 then endif
Thanks I committed the file. (with some really minor modifications, in particular we prefer to avoid using the style def:preprocessor for something like operators) > BTW. Is possible to validate syntax with this new engine and show an error? For > example show error on Well, engine understands regexes, so it depends if you manage to express the error condition with a regex... for instance in C we detect '*/' when not ending a comment, but with contexts that can nest it may be way more difficult.