hoaproject / Regex

The Hoa\Regex library.
https://hoa-project.net/
310 stars 17 forks source link

Fix generate space (\s) character. #20

Closed Metalaka closed 9 years ago

Metalaka commented 9 years ago

\s token was previously considered like \h. Now \s will be interpreted as \h or \v.

Hywan commented 9 years ago

@Metalaka I don't understand where the bug was. We already has this choice for s to be interpreted as h or v in the switch. Not there is no break, this is the trick.

However, I understand this is error prone and then your patch is welcomed. Is it why you had in mind?

Metalaka commented 9 years ago

Please look result of http://3v4l.org/DsOA7

The previous line $value = $this->_sampler->getInteger(0, 1) ? 'h' : 'v'; is totally useless since there is no break, so the following case is directly executed and the choice (h or v) is not used.

Hywan commented 9 years ago

Ok :-].

Hywan commented 9 years ago

Can you please reword your commit message based on http://hoa-project.net/Literature/Contributor/Guide.html#Commiting_a_patch:

It must answer to the following questions:

  1. What was the issue?
  2. How to address this issue?
  3. How did we address the issue?

Thanks!

Metalaka commented 9 years ago

Done.

Hywan commented 9 years ago

Excellent, thanks!

Hywan commented 9 years ago

Merged in https://github.com/hoaproject/Regex/commit/ad0d5269fbb4ee931c513c0edbc2810b22fc7d00.