accordproject / template-archive

Smart Legal Contracts & Templating System
https://accordproject.org/projects/cicero/
Apache License 2.0
280 stars 119 forks source link

Commenting functionality #696

Open OliverTod opened 2 years ago

OliverTod commented 2 years ago

Allow commenting for the dual purposes of:

Use Case 1: Notes to other developers

Comments would be programmer-readable explanation or annotation in the cicero template. These comments will be added with the purpose of making the source code easier for humans to understand. The text in the comments are not included in the final rendering(s) of the grammar file.

For this use case, comments will likely only contain plain text - there will not be TemplateMark syntax inside the comments - and only be used in individual lines / code blocks.

Use case 2: Commenting out code

Comments can also be used to comment out a code snippet, meaning to add comment syntax causing that block of code to become a comment, so that it will not be executed by the compiler. This may be done to exclude certain pieces of code from the final template, or (more commonly) it can be used to find the source of an error. By systematically commenting out and running parts of the program, the source of an error can be determined, allowing it to be corrected.

For this use case, comments will likely contain TemplateMark syntax and apply to several lines / code blocks.

Issues

Some issues to discuss / look out for:

OliverTod commented 2 years ago

I thought you would all get a kick out of this part of the wikipedia entry on 'Comment (computer programming):

image