From fc3c36eba83c2fa31862c4b023a244fd7024fa22 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 1 Sep 2022 03:23:19 +0000 Subject: [PATCH] Update 'How to Parse' --- How-to-Parse.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/How-to-Parse.md b/How-to-Parse.md index 4ae0e98..199df13 100644 --- a/How-to-Parse.md +++ b/How-to-Parse.md @@ -24,6 +24,4 @@ Each of these methods must: 5. Advance the operation struct to the element *after* the end, if need be - For example, a method meant to tokenize a string should advance the parser to the rune *after* the closing quotation. This ensures that methods can be properly called one after another. -Methods can return their results in one of two ways. The first, most robust, and most obvious way is for them to simply *return* the result. Sometimes, however, this option is not preferable. In this case, the method should take in a parameter called `into`, which should be a pointer of the "container" in which to put the result. For example, the method `ParsingOperation.parseEnumMembers()` takes in a pointer to an enum struct where the enum members need to go. As it parses each enum member, it adds it to the enum section's member slice. This approach is primarily for methods that parse *multiple* things, and in order to ensure good error handling, it is advisable to handle the parsing of individual items in a separate method. - -# Error Handling \ No newline at end of file +Methods can return their results in one of two ways. The first, most robust, and most obvious way is for them to simply *return* the result. Sometimes, however, this option is not preferable. In this case, the method should take in a parameter called `into`, which should be a pointer of the "container" in which to put the result. For example, the method `ParsingOperation.parseEnumMembers()` takes in a pointer to an enum struct where the enum members need to go. As it parses each enum member, it adds it to the enum section's member slice. This approach is primarily for methods that parse *multiple* things, and in order to ensure good error handling, it is advisable to handle the parsing of individual items in a separate method. \ No newline at end of file