n2a icon indicating copy to clipboard operation
n2a copied to clipboard

Add line comments back into grammar

Open frothga opened this issue 9 years ago • 0 comments

It would be helpful to put comments on the end of equation lines, particularly multi-line equations, where each condition might merit a separate comment. For simplicity, use # as the comment character.

This will require more careful (and perhaps slower) parsing of equation lines. In particular, a hash appearing inside quote marks should be treated as quoted text rather than the start of a comment. The same issue applies to the @ sign that marks conditions.

It would be safe to comment out an entire line. A single-line equation will simply be a blank assignment, which is equivalent to assigning zero. A blank equation should be treated similarly to a revocation. The condition should be completely removed from the list of cases for that variable. The main difference between a commented-out line and a revocation is that the condition remains visible and its contents is not lost.

frothga avatar Nov 20 '16 11:11 frothga