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

6-bit coding




Carl --

I like your idea of restricting the 6-bit to handle only balanced
S-expressions underneath.  Here is a simple way to handle this that I
thought of:

* Keep a running count of how many "mode-switches" there have been
  (e.g. 8-bit to 6-bit, or vice versa). Each region of input can be
  identified with the corresponding count.

* When parsing a list, note the count at the time you scan the 
  "(", and also when you scan the ")".  Compare these and check
  that they are the same.

This is sufficient to avoid having funny parenthesizations
happening inside a base-64 blob that you don't see.

You could extend this to check the first and last character of tokens
or raw strings, but I don't think that is necessary, and may be
even undesirable...

Does this work for you?

Cheers,
	Ron

Follow-Ups: