matchFirst

Match input with node.

  1. inout(char)[] matchFirst(inout(char)[] input, Node node)
  2. auto ref matchFirst(Data input, Node node)
    @safe ref pure nothrow
    matchFirst
    (
    in return Data input
    ,
    const Node node
    )

Return Value

Type: auto ref

Matched slice or [] if not match.

Examples

ditto

/+const+/ Data x = [1,2];
assert(x.matchFirst(lit(x[0 .. 1])) is x[0 .. $]);
assert(x.matchFirst(lit(x[1 .. 2])) is x[1 .. 2]);

Meta