Skip to content

Commit

Permalink
perf(Types): Assertion Node improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Demali-876 committed Nov 15, 2024
1 parent ab1c696 commit a7d9233
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions src/Types.mo
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,26 @@ module{
public type Transition = (State, Symbol, State);

public type Assertion = {
assertion: {
#Anchor: AnchorType;
#Lookaround: {
expr: AST;
isPositive: Bool;
isAhead: Bool;
};
};
position: Nat;
captureIndex: ?Nat;
assertion: {
#Anchor: {
aType: AnchorType;
position: State;
};
#Lookaround: {
startState: State;
acceptStates: [State];
isPositive: Bool;
isAhead: Bool;
position: State;
};
#Group: {
captureIndex: Nat;
startState: State;
endStates: [State];
};
};
};

public type CompiledRegex = {
states : [State];
transitions : [Transition];
Expand All @@ -150,12 +159,12 @@ module{
#NoMatch;
};
position: (Nat, Nat);
capturedGroups: ?[?Text];
capturedGroups: ?[(Text,Nat)];
spans: [(Nat, Nat)];
lastIndex: Nat;
};
public type Flags = {
caseInsensitive: ?Bool;
multiline: ?Bool;
caseSensitive: Bool;
multiline: Bool;
};
}

0 comments on commit a7d9233

Please sign in to comment.