script::Expr

Extract the expression that sp begins with.

Synopsis

Declared in <script/parsing.h>

std::span<char const>
Expr(std::span<char const>& sp);

Description

This function will return the initial part of sp, up to (but not including) the first comma or closing brace, skipping ones that are surrounded by braces. So for example, for "foo(bar(1),2),3" the initial part "foo(bar(1),2)" will be returned. sp will be updated to skip the initial part that is returned.

Return Value

The leading expression of sp.

Parameters

NameDescription
spThe input span; it is advanced past the returned expression.