documentation: Describe NOTEs
Describe how/why notes are used in the code. Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -87,6 +87,21 @@ where `<component>` is one of:
|
|||||||
|
|
||||||
where `<subcomponent>` can be more free-form and `<change>` is a pithy description of the changes in the commit.
|
where `<subcomponent>` can be more free-form and `<change>` is a pithy description of the changes in the commit.
|
||||||
|
|
||||||
|
#### Notes To Self
|
||||||
|
|
||||||
|
While coding, it may be useful to leave ourselves notes. Every note is formatted like:
|
||||||
|
|
||||||
|
|
||||||
|
```Swift
|
||||||
|
/// NOTE: note text
|
||||||
|
```
|
||||||
|
|
||||||
|
where `NOTE` can be:
|
||||||
|
|
||||||
|
1. `TODO`: Remind us `TODO` something.
|
||||||
|
2. `ASSUME`: Remind us that we are making an assumption.
|
||||||
|
3. `NB`: Remind us that we need to remember something when reading this code.
|
||||||
|
|
||||||
#### Testing
|
#### Testing
|
||||||
|
|
||||||
To run the P4RSE tests:
|
To run the P4RSE tests:
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ extension Declaration: CompilableDeclaration {
|
|||||||
let declaration_compilers: [String: CompilableDeclaration.Type] = [
|
let declaration_compilers: [String: CompilableDeclaration.Type] = [
|
||||||
"function_declaration": FunctionDeclaration.self,
|
"function_declaration": FunctionDeclaration.self,
|
||||||
"control_declaration": Control.self,
|
"control_declaration": Control.self,
|
||||||
"type_declaration": StructDeclaration.self, // Assume that type declarations are struct declarations.
|
"type_declaration": StructDeclaration.self, // ASSUME: Type declarations are struct declarations.
|
||||||
]
|
]
|
||||||
|
|
||||||
guard let declaration_compiler = declaration_compilers[node.nodeType!] else {
|
guard let declaration_compiler = declaration_compilers[node.nodeType!] else {
|
||||||
@@ -274,7 +274,7 @@ extension P4Lang.Parser: CompilableDeclaration {
|
|||||||
let type_node = currentChild
|
let type_node = currentChild
|
||||||
var parser_name: Common.Identifier? = .none
|
var parser_name: Common.Identifier? = .none
|
||||||
|
|
||||||
// Assume that the parameter list is empty!
|
// TODO: Handle parser parameter lists.
|
||||||
var parameter_list = ParameterList()
|
var parameter_list = ParameterList()
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|||||||
Reference in New Issue
Block a user