durable_rules 0.34.34 → 0.34.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/src/rules/regex.c +6 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d23a2b69698c386b592b25d31c9047e011bafa47
4
- data.tar.gz: 82c5f1f4a37e88c0e4a6ff60364bb93cb735a812
3
+ metadata.gz: d4dac8eb12717b1ab1df781c340385dd775089e2
4
+ data.tar.gz: 203c76635664dfbcabac912ac74093c3a0b5677a
5
5
  SHA512:
6
- metadata.gz: 6d2156f08e81ac88bbc2ed931780e0d7f558af066484e8c2f7c1d1dac143b770ef2b4d4da8bcd0f7a6119b9dfa1e80e8c14ad6ff8b471bb520924973ae66a759
7
- data.tar.gz: 4ddda7262500bd9f504766f62f1880e14380612718c43243ae88416a8d5d8eef5b9a63e99ac905252c8c9a44214daf62bea8c24a36c3aa59e7b483cdb71f26df
6
+ metadata.gz: 5f2c2d3e579ad6d486a4c71879baafb6879260c88b80652600c7de7f061fbdb8c4491e2a4facc9331b16709b2de737893a7f0cc95921bd411a56d3a1e5d9ea9f
7
+ data.tar.gz: c22086988ac401f2f2a3502dac8151d63e5c02128108325dc4e01b3ec9a4427b9edc67aadff855d8a580a7cee62de0e462c7ff43e0c03811fc0a6f21b8fcb720
data/src/rules/regex.c CHANGED
@@ -900,7 +900,7 @@ static unsigned int ensureState(unsigned short *id,
900
900
  unsigned short stateListLength,
901
901
  state **newState) {
902
902
  CREATE_STATE(id, newState);
903
- unsigned short dotTransitions = 0;
903
+ unsigned short cancelSpecificTransitions = 0;
904
904
  for (unsigned short i = 0; i < stateListLength; ++i) {
905
905
  state *targetState = list[i];
906
906
  for (unsigned short ii = 0; ii < targetState->transitionsLength; ++ii) {
@@ -910,8 +910,8 @@ static unsigned int ensureState(unsigned short *id,
910
910
  return result;
911
911
  }
912
912
 
913
- if (targetTransition->symbol == REGEX_DOT) {
914
- ++dotTransitions;
913
+ if (targetTransition->symbol == REGEX_DOT && targetState->isAccept) {
914
+ cancelSpecificTransitions = 1;
915
915
  }
916
916
  }
917
917
 
@@ -928,10 +928,9 @@ static unsigned int ensureState(unsigned short *id,
928
928
  }
929
929
  }
930
930
 
931
- // when merging two states results in two or more dot transitions
932
- // all specific transitions are cancelled, this allows for the
933
- // first match to succeed.
934
- if (dotTransitions > 1) {
931
+ // if the current state has any dot transitions to accept states
932
+ // then all specific transitions are cancelled, this allows for the first match to succeed.
933
+ if (cancelSpecificTransitions) {
935
934
  for (unsigned short i = 0; i < (*newState)->transitionsLength; ++i) {
936
935
  transition *currentTransition = &(*newState)->transitions[i];
937
936
  if (currentTransition->symbol != REGEX_DOT) {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: durable_rules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.34
4
+ version: 0.34.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesus Ruiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-10 00:00:00.000000000 Z
11
+ date: 2017-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake