NeoMutt  2024-04-25-85-g27bab4
Teaching an old dog new tricks
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...


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.

  • 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

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.

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

Definition at line 301 of file parse.c.

304 if (!string || !*string)
305 {
306 node_append(root, node_new());
307 return;
308 }
310 const char *end = NULL;
311 const char *start = string;
313 while (*start)
314 {
315 struct ExpandoNode *node = node_parse(start, NULL, CON_NO_CONDITION, &end, defs, error);
316 if (!node)
317 break;
319 node_append(root, node);
320 start = end;
321 }
323 node_padding_repad(root);
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:124
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:116
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: