GNOME Bugzilla – Bug 345911
Support for OCL files
Last modified: 2007-07-03 10:21:24 UTC
Object Constraint Language is a formal language to describe expressions on UML models.
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:
Changing default asignee and QA to email@example.com (correct asignee). Sorry for the spam
FreeDesktop team have applied the patch:
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">
> <context id="comment-continue">
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">
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"/>
> <!-- Strings -->
> <context id="string" end-at-line-end="true" style-ref="string">
> <context id="string-continue" style-ref="escape">
same as above: use def:line-continue
> <context ref="def:c-style-escape"/>
> <!-- 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
because "then" is missing due to the rule is defined as:
if 1 = 1 then
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.