URLPattern: Translate path-to-regexp parser to c++.
This CL translates the path-to-regexp parser from typescript to c++. Its based on the code here: https://github.com/pillarjs/path-to-regexp/blob/125c43e6481f68cc771a5af22b914acdb8c5ba1f/src/index.ts#L126-L232 We deviate from the path-to-regexp code in some terminology and output structure. In particular, we output a list of Part structures with types of kFixed, kRegex, kSegmentWildcard, or kFullWildcard as discussed in the design doc: https://docs.google.com/document/d/17L6b3zlTHtyxQvOAvbK55gQOi5rrJLERwjt_sKXpzqc/edit#heading=h.ymw6rim68920 Note, this CL does deviate from the design doc as well in that we are translating a more modern version of path-to-regexp than originally planned. This uses a "{...}?" style grouping for applying modifiers. We also do not yet fully include support for the "*" wildcard character. As such the grammar in the design doc does not really apply fully to this CL. Bug: 1141510 Change-Id: I1c3e4ef76587496301d2171fa9f76b51754dce0d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2518206 Commit-Queue: Ben Kelly <wanderview@chromium.org> Reviewed-by:Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/master@{#826968}
Showing
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment