domm/Module-ExtractUse — pull request #10 by yak1ex (2013-08-12 02:12:28+00:00)
Title: Fix handling module beginning with v and pragma with version.

The following 2 issues are fixed by this pull request. Both are related with using `version` pragma.

- module beginning with v
- pragma with version requirement

Please note that `t/20_parse_self.t` is also adjusted because `version` is ignored in the test.

Details are as follows:

- module beginning with v
- **Issue:** For example, for the case of `use version`, just a letter `'v'` is matched to the rule `` and the rest, `'ersion'` is left. The rule `` is matched because the rule `` is matched but the regex `/[;}]/` in the rule `` is not matched to `'ersion'`. Thus, the rule `` fails to match completely (don't backtrack).
- **Fix:** Adjust regexp of `` not to match to words like `'version'`.
- pragma with version requirement
- **Issue:** Even after the above fix, `use version 0.77` can not be detected. Trying to match to the rule ``, the rule `` is matched to just a letter `'0'` then `` fails the way similar to above.
- **Fix:** Remove the rule `` to fall back to the rule ``. I think this is fair because a pragma is just a module.