Discussion List Archives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ddlm-group] CIF2 Syntax all wrapped up?

James Hester wrote:
> I would answer as follows:
>     2) What are the rules for comments within lists and tables?
> I would treat them as whitespace
One detail is whether the "#" starting a comment requires preceding 
whitespace. Herbert's example is:

     2, #two
     3 #three
     ,4 #four

He suggests that preceding whitespace is there only if needed to 
terminate the preceding token, and not a requirement in the actual 
comment syntax. This looks OK in the above example, but may not be clear 
after a quoted string:

Or, perhaps this is no less clear than the lack of whitespace in a list:

>     4) Why require single or double quotes for table index strings, rather
>     than just follow the normal quoting rules?
> No good reason - so let's just follow the normal rules.
Should quotes be requires at all for the index string? Correct parsing 
only requires quotes if the index string contains a colon. In the 
current draft, that is imposed for all strings, not just table-index 
strings. So, there is no need to mandate quotes here, unless the global 
requirement to quote strings with : is dropped.

Maybe the intention was to disallow multi-line index strings?

>     Some of these are more technical details compared to the other issues.
>     These came up while I was working on a big CIF2 regular-expression,
>     where parsing details have to be considered more carefully.
> Actually, it would be rather good if you could post these regular 
> expressions once we have a final specification, as they are likely to be 
> useful to a broad audience.
I plan to do that. To be fully functional, it has to be done in Perl 
syntax, which has a feature that allows recursion for table and list 
values. Despite that caveat, it will be useful even where the full 
recursive expression will not work.

ddlm-group mailing list

Reply to: [list | sender only]
International Union of Crystallography

Scientific Union Member of the International Science Council (admitted 1947). Member of CODATA, the ISC Committee on Data. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

International Science Council Scientific Freedom Policy

The IUCr observes the basic policy of non-discrimination and affirms the right and freedom of scientists to associate in international scientific activity without regard to such factors as ethnic origin, religion, citizenship, language, political stance, gender, sex or age, in accordance with the Statutes of the International Council for Science.