Class ReplaceStringParser<T>

java.lang.Object
com.oracle.truffle.js.builtins.helper.ReplaceStringParser<T>

public final class ReplaceStringParser<T> extends Object
Helper for parsing replacement value parameters of String.prototype.[@@replace] and RegExp.prototype.[@@replace].
  • Method Details

    • process

      public static <T, R> R process(JSContext context, com.oracle.truffle.api.strings.TruffleString replaceStr, int maxGroupNumber, boolean parseNamedCaptureGroups, ReplaceStringParser.Consumer<T,R> consumer, T node, com.oracle.truffle.api.nodes.Node profileNode, com.oracle.truffle.api.profiles.InlinedBranchProfile hasDollarBranch)
    • parse

      public static ReplaceStringParser.Token[] parse(JSContext context, com.oracle.truffle.api.strings.TruffleString replaceStr, int maxGroupNumber, boolean parseNamedCaptureGroups)
    • processParsed

      public static <T, R> R processParsed(ReplaceStringParser.Token[] tokens, ReplaceStringParser.Consumer<T,R> consumer, T node)
    • process

      public void process(ReplaceStringParser.Consumer<T,?> consumer, T node, com.oracle.truffle.api.nodes.Node profileNode, com.oracle.truffle.api.profiles.InlinedBranchProfile hasDollarBranch, JSContext context)