mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Improved documentation, removed union fram change note.
This commit is contained in:
@@ -3,6 +3,10 @@ package com.semmle.js.ast.regexp;
|
||||
import com.semmle.js.ast.SourceLocation;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A character class intersection in a regular expression available only with the `v` flag.
|
||||
* Example: [[abc]&&[ab]&&[b]] matches character `b` only.
|
||||
*/
|
||||
public class CharacterClassIntersection extends RegExpTerm {
|
||||
private final List<RegExpTerm> elements;
|
||||
|
||||
|
||||
@@ -3,8 +3,11 @@ package com.semmle.js.ast.regexp;
|
||||
import com.semmle.js.ast.SourceLocation;
|
||||
|
||||
/**
|
||||
* A '\q{}' escape sequence in a regular expression, which is a special extension
|
||||
* to standard regular expressions.
|
||||
* A quoted string escape sequence '\q{}' in a regular expression.
|
||||
* This feature is a non-standard extension that requires the 'v' flag.
|
||||
*
|
||||
* Example: [\q{abc|def}] creates a character class that matches either the string
|
||||
* "abc" or "def". Within the quoted string, only the alternation operator '|' is supported.
|
||||
*/
|
||||
public class CharacterClassQuotedString extends RegExpTerm {
|
||||
private final RegExpTerm term;
|
||||
@@ -17,7 +20,7 @@ public class CharacterClassQuotedString extends RegExpTerm {
|
||||
public RegExpTerm getTerm() {
|
||||
return term;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void accept(Visitor v) {
|
||||
v.visit(this);
|
||||
|
||||
@@ -3,6 +3,10 @@ package com.semmle.js.ast.regexp;
|
||||
import com.semmle.js.ast.SourceLocation;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A character class subtraction in a regular expression available only with the `v` flag.
|
||||
* Example: [[abc]--[a]--[b]] matches character `c` only.
|
||||
*/
|
||||
public class CharacterClassSubtraction extends RegExpTerm {
|
||||
private final List<RegExpTerm> elements;
|
||||
|
||||
|
||||
@@ -297,8 +297,8 @@ public class RegExpParser {
|
||||
disjuncts.add(this.parseAlternativeInsideQuotedString());
|
||||
}
|
||||
if (disjuncts.size() == 1) return disjuncts.get(0);
|
||||
return this.finishTerm(new Disjunction(loc, disjuncts));
|
||||
}
|
||||
return this.finishTerm(new Disjunction(loc, disjuncts));
|
||||
}
|
||||
|
||||
private RegExpTerm parseAlternativeInsideQuotedString() {
|
||||
SourceLocation loc = new SourceLocation(pos());
|
||||
|
||||
Reference in New Issue
Block a user