Commit d78b7a0e authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[regexp][cleanup] Using 'using' instead of 'typedef'

Even though both are allowed in the style guide, it recommends to use
'using', as its syntax is more consistent with the rest of C++.
This CL turns all typedefs in src/regexp to 'using' declarations.

R=jgruber@chromium.org

Bug: v8:8834
Change-Id: I2765c3465fec7e8c42c3a84b924522f220ab5676
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545904Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60585}
parent 38ddf33c
......@@ -21,7 +21,7 @@
namespace v8 {
namespace internal {
typedef unibrow::Mapping<unibrow::Ecma262Canonicalize> Canonicalize;
using Canonicalize = unibrow::Mapping<unibrow::Ecma262Canonicalize>;
static bool BackRefMatchesNoCase(Isolate* isolate, int from, int current,
int len, Vector<const uc16> subject,
......
......@@ -1660,14 +1660,9 @@ static bool ShortCutEmitCharacterPair(RegExpMacroAssembler* macro_assembler,
return false;
}
typedef bool EmitCharacterFunction(Isolate* isolate,
RegExpCompiler* compiler,
uc16 c,
Label* on_failure,
int cp_offset,
bool check,
bool preloaded);
using EmitCharacterFunction = bool(Isolate* isolate, RegExpCompiler* compiler,
uc16 c, Label* on_failure, int cp_offset,
bool check, bool preloaded);
// Only emits letters (things that have case). Only used for case independent
// matches.
......
......@@ -258,8 +258,8 @@ class DispatchTable : public ZoneObject {
class Config {
public:
typedef uc32 Key;
typedef Entry Value;
using Key = uc32;
using Value = Entry;
static const uc32 kNoKey;
static const Entry NoValue() { return Value(); }
static inline int Compare(uc32 a, uc32 b) {
......
......@@ -303,7 +303,7 @@ class RegExpCharacterClass final : public RegExpTree {
NEGATED = 1 << 0,
CONTAINS_SPLIT_SURROGATE = 1 << 1,
};
typedef base::Flags<Flag> CharacterClassFlags;
using CharacterClassFlags = base::Flags<Flag>;
RegExpCharacterClass(
Zone* zone, ZoneList<CharacterRange>* ranges, JSRegExp::Flags flags,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment