[Top][All Lists]

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

Re: [Monotone-devel] basic_io inventory

From: Thomas Moschny
Subject: Re: [Monotone-devel] basic_io inventory
Date: Mon, 30 Apr 2007 10:54:19 +0200
User-agent: KMail/1.9.6

Hi Christian,

Christian Ohler wrote:
> I don't think this is the only valid way of looking at basic_io.
> Stanzas are separated by an empty line; what's wrong with (or "not
> stable" about) relying on that?  You're suggesting to discard this
> information that is already available at the syntactical level just to
> reconstruct it later at a semantical level.

Because that information is redundant, and the definitive source is the 
semantic, not the syntactic level. Graydon pointed out in the IRC session you 
mentioned (and which is linked on the BasicIoFormalization wiki page) that 
the spaces and newlines are only there to make basic_io more readable by 
humans. However, once introduced, spacing needed to be standardized in order 
to make hashing stable. But in principle, basic_io would still carry the same 
information with most of whitespace chars removed (of course you would need 
at least one separating ws between a key token with no string or id token 
following and the next key token).

> > Parsing basic_io typically consists of two steps: First, breaking down
> > the input stream into tokens (key tokens followed by zero or more value
> > tokens), thereby striping all white space and dequoting string values.
> > Second, reading the token stream in an application-dependend manner (see
> > above). In this second step, you should have an idea of the meaning and
> > the possible orderings of the key tokens.
> Which basic_io parsers work this way (returning a stream of key/value
> tokens (that does not contain stanza delimiters) instead of a stream of
> stanzas)?

Monotone's own parser does, see basic_io.{cc|hh}. This is also used by the Lua 
parser. TracMonotone's parser does, too. A copy of it can be found in 
contrib/ The parser in ViewMtn however seems 
to look for stanzas.

> xmtn currently depends on stanzas being separated by an empty line as
> well as on the order of lines within each stanza.

And I guess it also depends on each stanza itself being subdived by newlines. 


Attachment: pgpub7Vk_ICcP.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]