File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,27 @@ just run `make coverage` and it should open the coverage report in a browser
85
85
window for you (via xdg-open).
86
86
87
87
88
+ ## Guidelines and coding recommandations
89
+
90
+ This section sums up useful guidelines and recommendations conerning the various
91
+ parts of the code.
92
+
93
+ ### Lexers
94
+
95
+ - Lexers should alwyas have a fallback case that raises the ` Error ` exception
96
+ (else, ocamllex-generated parsers raise weird errors when no match can be found)
97
+
98
+ ### Parsers
99
+
100
+ - In general, parsers should be as simple as possible and, as much as possible
101
+ strive to only generate a structured representation of the input, without doing
102
+ anything smart or semantic-related. Instead, most (if not all) of the processing
103
+ should be done during typechecking. For instance, if a language does not define
104
+ a specific syntax rule for equality, and instead just treat equality as a regular
105
+ application (either a regular prefix application, or a generic infix appllication),
106
+ then a parser should generate a regular application node (and ** not** use the ` Equal `
107
+ builtin).
108
+
88
109
89
110
## Hand-written syntax error messages
90
111
You can’t perform that action at this time.
0 commit comments