Commit 4: Correct anchor semantics/docs for default std::regex

In default ECMAScript std::regex (no multiline flag; this parser cannot
detect construction-site flags), ^ and $ anchor to string start/end, not
line boundaries. Update RegExpCaret, RegExpDollar, and RegExpAnchor doc
comments to describe string-start/string-end semantics and note that
multiline is not modelled, mirroring PR #22200. Tokenization unchanged.
.expected files unchanged.

Bundle: github/codeql-action codeql-bundle-v2.26.1 (CodeQL CLI 2.26.1).
This commit is contained in:
copilot-swe-agent[bot]
2026-07-21 12:20:47 +00:00
committed by GitHub
parent 903e9f2b74
commit 8aa1a7b205

View File

@@ -967,6 +967,11 @@ private module Impl implements RegexTreeViewSig {
* A term that matches a specific position between characters in the string.
* ECMAScript anchors: `^` and `$` only.
* (Ruby-only `\A`, `\Z`, `\z` removed)
*
* In the default `std::regex` ECMAScript grammar, `^` and `$` anchor to the
* start and end of the input string. Multiline mode (in which they would
* also match at line boundaries) is a construction-site flag that this
* parser cannot observe, and is therefore not modelled.
*/
class RegExpAnchor extends RegExpSpecialChar {
RegExpAnchor() { this.getChar() = ["^", "$"] }
@@ -975,7 +980,8 @@ private module Impl implements RegexTreeViewSig {
}
/**
* A dollar assertion `$` matching the end of a line.
* A dollar assertion `$` matching the end of the input string
* (multiline mode is not modelled; see `RegExpAnchor`).
*
* Example:
*
@@ -992,7 +998,8 @@ private module Impl implements RegexTreeViewSig {
}
/**
* A caret assertion `^` matching the beginning of a line.
* A caret assertion `^` matching the start of the input string
* (multiline mode is not modelled; see `RegExpAnchor`).
*
* Example:
*