···293293294294 /// Starts a `-record` attribute.
295295 /// After this you're supposed to generate a sequence of `record_field`, and
296296- /// once you're done you should end it with `edn_record_attribute`.
296296+ /// once you're done you must end it with `end_record_attribute`.
297297 ///
298298 /// For example:
299299 ///
···329329330330 /// This starts a function type spec.
331331 /// Everything that is generated after this call is interpreted as the
332332- /// annotated type of the function. So this should be followed by a single
332332+ /// annotated type of the function. So this must be followed by a single
333333 /// function type.
334334 ///
335335 /// After that is complete, this has to be closed using `end_function_spec`.
···340340 /// let spec = builder.start_function_spec("wibble", 1)
341341 /// let function_type = builder.start_function_type();
342342 /// builder.int_type();
343343- /// let function_type builder.end_function_type_arguments(function_type);
343343+ /// let function_type = builder.end_function_type_arguments(function_type);
344344 /// builder.variable_type("A");
345345 /// builder.end_function_type(function_type);
346346 /// ```
···393393 /// This starts a function type.
394394 /// Any code generated after this is gonna be an argument type of the open
395395 /// function type until `end_function_type_arguments` is called.
396396- /// After that you should generate a single type that's gonna be the return
396396+ /// After that you must generate a single type that's gonna be the return
397397 /// type, and then end the function.
398398 ///
399399 /// For example:
···419419 /// This means that the next type that is generated is going to be the
420420 /// return type of the open function type.
421421 ///
422422- /// After that you should call `end_function_type` to close the function
422422+ /// After that you must call `end_function_type` to close the function
423423 /// type.
424424 ///
425425 fn end_function_type_arguments(&mut self, function_type: FunctionTypeArguments)
···438438 /// For example:
439439 ///
440440 /// ```ignore
441441- /// let integer = builder.start_named_type("integer");
442442- /// builder.end_named_type(integer);
441441+ /// let type_ = builder.start_named_type("wibble");
442442+ /// builder.end_named_type(type_);
443443 /// ```
444444 ///
445445 /// Corresponds to:
446446 ///
447447 /// ```erl
448448- /// integer().
448448+ /// wibble().
449449 /// ```
450450 ///
451451 fn start_named_type(&mut self, name: &str) -> NamedType;
···546546 ///
547547 fn type_variable(&mut self, name: &str);
548548549549- /// This generated the code for a literal atom type.
549549+ /// This generated the code for a literal atom type (as opposed to the
550550+ /// type `atom()`).
550551 ///
551551- /// For example, the annotation of a function returning the atom `nil` is
552552- /// be defined like this:
552552+ /// For example, the annotation of a function returning the atom `nil`
553553+ /// is be defined like this:
553554 ///
554555 /// ```ignore
555556 /// let function = builder.start_function_type();
···711712 /// Corresponds to:
712713 ///
713714 /// ```erl
714714- /// { ~"Hello", 1 }.
715715+ /// {~"Hello", 1}.
715716 /// ```
716717 ///
717718 fn start_tuple(&mut self) -> Tuple;
···847848 ///
848849 /// ```erl
849850 /// [Hello | [ ~"Giacomo" | []]].
850850- /// % Which, with some syntax sugar, is how we represent a list with two
851851- /// % elements:
852852- /// % [Hello, ~"Giacomo"]
851851+ /// ```
852852+ ///
853853+ /// Which, with some syntax sugar, is how we represent a list with two
854854+ /// elements:
855855+ ///
856856+ /// ```erl
857857+ /// [Hello, ~"Giacomo"]
853858 /// ```
854859 ///
855860 fn cons_list(&mut self);
···904909 /// `start_case` documentation.
905910 fn start_case_clause(&mut self) -> ClausePattern;
906911907907- /// This ends the case clause's pattern. After this you should generate the
912912+ /// This ends the case clause's pattern. After this you must generate the
908913 /// clause guards and then call `end_clause_guards`.
909914 /// If the clause you're generating has no guards you can immediately call
910915 /// that function without generating anything inbetween.
···983988 fn function_reference(&mut self, module: Option<ErlangModuleName>, name: &str, arity: usize);
984989985990 /// This is used to create the code that corresponds to an assignment.
986986- /// A call to this function should always be followed by the generation of
991991+ /// A call to this function must always be followed by the generation of
987992 /// a pattern (the left-hand side of the assignment), and of an expression
988993 /// (the right-hand side of the assignment).
989994 ///
···10041009 fn match_operator(&mut self);
1005101010061011 /// This is used to create the code that corresponds to a match pattern.
10071007- /// A call to this function should always be followed by the generation of
10121012+ /// A call to this function must always be followed by the generation of
10081013 /// a pattern (the left-hand side of the assignment), and of another pattern
10091014 /// (the right-hand side of the assignment).
10101015 ///
···11711176 ///
11721177 /// ```erl
11731178 /// [_ | [ ~"Louis" | []]].
11741174- /// % Which, with some syntax sugar, is how we represent a pattern matching
11751175- /// % on a list with two elements, where the second element is the string
11761176- /// % ~"Louis":
11771177- /// % [_, ~"Louis"]
11791179+ /// ```
11801180+ ///
11811181+ /// Which, with some syntax sugar, is how we represent a pattern matching
11821182+ /// on a list with two elements, where the second element is the string
11831183+ /// `~"Louis"`:
11841184+ ///
11851185+ /// ```erl
11861186+ /// [_, ~"Louis"]
11781187 /// ```
11791188 ///
11801189 fn cons_list_pattern(&mut self);
···11971206 ///
11981207 /// ```erl
11991208 /// ~"ksiąskę".
12001200- /// % Which is the same as <<"ksiąskę"/utf8>>
12011201- /// % Or the same as writing the bytes directly:
12021202- /// % <<107, 115, 105, 196, 133, 115, 107, 196, 153>>
12091209+ /// ```
12101210+ ///
12111211+ /// Which is the same as `<<"ksiąskę"/utf8>>`
12121212+ /// Or the same as writing the bytes directly:
12131213+ ///
12141214+ /// ```erl
12151215+ /// <<107, 115, 105, 196, 133, 115, 107, 196, 153>>
12031216 /// ```
12041217 ///
12051218 fn string(&mut self, string: &str);
···1634164716351648/// How does pretty printing work? Here's a high level overview of how it works:
16361649///
16371637-/// - when a new element is generated we call the `new_x` method.
16501650+/// - When a new element is generated we call the `new_x` method.
16381651/// If I'm generating an integer (or any expression) I call `new_expression`;
16391652/// if I'm generating a pattern I call `new_pattern`.
16401653/// - The `new_x` functions make sure that we're allowed to generate that