NeoMutt  2024-04-25-1-g3de005
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
parse.h File Reference

Expando Parsing. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ExpandoParseError
 Buffer for parsing errors. More...
 

Functions

void node_tree_parse (struct ExpandoNode **root, const char *string, const struct ExpandoDefinition *defs, struct ExpandoParseError *error)
 Parse a format string into ExpandoNodes.
 

Detailed Description

Expando Parsing.

Authors
  • Tóth János
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file parse.h.

Function Documentation

◆ node_tree_parse()

void node_tree_parse ( struct ExpandoNode **  root,
const char *  string,
const struct ExpandoDefinition defs,
struct ExpandoParseError error 
)

Parse a format string into ExpandoNodes.

Parameters
[in,out]rootParent ExpandoNode
[in]stringString to parse
[in]defsExpando definitions
[out]errorBuffer for errors

Definition at line 304 of file parse.c.

306{
307 if (!string || !*string)
308 {
309 node_append(root, node_new());
310 return;
311 }
312
313 const char *end = NULL;
314 const char *start = string;
315
316 while (*start)
317 {
318 struct ExpandoNode *node = node_parse(start, NULL, CON_NO_CONDITION, &end, defs, error);
319 if (!node)
320 break;
321
322 node_append(root, node);
323 start = end;
324 }
325
326 node_padding_repad(root);
327}
static struct ExpandoNode * node_parse(const char *str, const char *end, enum ExpandoConditionStart condition_start, const char **parsed_until, const struct ExpandoDefinition *defs, struct ExpandoParseError *error)
Parse a format string into ExpandoNodes.
Definition: parse.c:125
struct ExpandoNode * node_new(void)
Create a new empty ExpandoNode.
Definition: node.c:39
void node_append(struct ExpandoNode **root, struct ExpandoNode *new_node)
Append an ExpandoNode to an existing node.
Definition: node.c:133
@ CON_NO_CONDITION
Parser is not currently in a condition.
void node_padding_repad(struct ExpandoNode **parent)
Rearrange Padding in a tree of ExpandoNodes.
Definition: node_padding.c:275
Basic Expando Node.
Definition: node.h:69
const char * end
End of string data.
Definition: node.h:80
const char * start
Start of string data.
Definition: node.h:79
+ Here is the call graph for this function:
+ Here is the caller graph for this function: