Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Hash character always treated as comment unless inside single quotes #1

@oholiab

Description

@oholiab

When attempting to use a #/hash/pound character within a regex I discovered that it and all following characters would be treated as a comment unless the entire regex was enclosed within single quotes. For example:

pattern:    '/#(.+)/'

will parse the regex as intended wheras

pattern:    /'#(.+)'/

for example returns

ERROR: [/mapping/irc/mapping/channel/pattern] '/'': should be '/..../'.

and the same occurs for escaping or no quoting - all characters including and after the hash are treated as comment by the flow control in the kwalify parser as far as I can tell. This is not the way that YAML parses an escaped or regex enclosed hash character.

I don't know if this is the behaviour you are aiming for (I would suggest that keeping in line with the way that YAML parses a hash would be more intuitive), but either the behaviour or the documentation should probably be changed to at least clarify what the expected behaviour is.

EDIT: Kwalify version 0.7.2 on Ruby 1.8.7 also I am dumb for not including my versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions