Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » B3 » repository syntax
repository syntax [message #606991] Wed, 19 May 2010 12:08
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Have worked on the syntax of repository declaration. When Thomas and I
reviewed the original proposal, it became apparent that the various
initialization elements did not follow a common set of easily deductible
rules (it was more like "make it really easy to write what is most common").

So, I played around with some rules, the idea we had during the review was:
- Use ':' instead of '='
- Use ': singleValue' for single values
- Use '[ value, value]' for list
- Use '{ ... }' for compound

repositories {
cvs my_cvs_3 {
connection : "" ;
branches [
main {
timestamp : "20100516213854+0200";
update-policy : no-update;
include [ "some/path/",
aName ];
exclude [ ~/.*/ ,
"some/path/"]; }
Having rewritten some of the previous syntax into this, I found several
things that I did not like - so here is take 2:

Take 2
- no grouping "repositories", just state them one after another, the
order is not important anyway.
- use more keywords (having a list of predicates where the
differentiator is if it is a regexp or not is not very readable (and
prevents the use of SimplePattern).
- instead of list with just "," between elements, repeat the keyword
(much easier to read, esp. when list is longer and elements are not uniform)
- Assignment (with ':' or '=') is unnecessary and mostly clutters the
specification. I found this to be quite irritating when using code
completion (an extra step always required before fully understanding
what the keyword stands for.
- each 'statement' ends with ';' for elements that have a single value,
and with '}' when a block is/can used. I.e. when a block can be used but
nothing is specified, the element ends with '{}' I think this is clearer
as it indicates that there is potentially more stuff, and since it is
empty there are some additional defaults. I think this is a good hint.

repository cvs my_cvs_4 {
connection "" ;
branch aBranchCalledWanda { }
branch aBranchAlsoCalledWanda { }
branch main {
timestamp "20100516213854+0200";
update-policy no-update;
include {
name "some/path/" ;
name aName ;
pattern "*.middle.*" ;
exclude {
pattern ~/.*apa/ ;
pattern ~/.*bepa/ ;
name aBadName;

I think is is more readable, esp, when there is no syntax coloring to
aid the reader.

- henrik
Previous Topic:new b3 version checked in - guice added and one more test green
Next Topic:repository syntax
Goto Forum:

Current Time: Mon May 29 08:35:25 GMT 2023

Powered by FUDForum. Page generated in 0.01563 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top