Skip to content

Fix handling module beginning with v and pragma with version.#10

Merged
charsbar merged 1 commit intodomm:masterfrom
yak1ex:module_beginning_with_v
Aug 21, 2013
Merged

Fix handling module beginning with v and pragma with version.#10
charsbar merged 1 commit intodomm:masterfrom
yak1ex:module_beginning_with_v

Conversation

@yak1ex
Copy link
Contributor

@yak1ex yak1ex commented Aug 12, 2013

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 <version> and the rest, 'ersion' is left. The rule <use_stuff> is matched because the rule <version> is matched but the regex /[;}]/ in the rule <token_use> is not matched to 'ersion'. Thus, the rule <token_use> fails to match completely (don't backtrack).
    • Fix: Adjust regexp of <version> 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 <pragma>, the rule <import_list> is matched to just a letter '0' then <token_use> fails the way similar to above.
    • Fix: Remove the rule <pragma> to fall back to the rule <module>. I think this is fair because a pragma is just a module.

charsbar added a commit that referenced this pull request Aug 21, 2013
Fix handling module beginning with v and pragma with version.
@charsbar charsbar merged commit 148d4ff into domm:master Aug 21, 2013
@charsbar
Copy link
Collaborator

Thanks and sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants