/gist:5fde506394d862f23626 Secret
Created
July 4, 2015 16:26
Star
You must be signed in to star a gist
<!> does not help
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| grammar TestGrammar { | |
| regex TOP { ^ $<plain>=.*? [ <special> $<plain>=.*? ]*? $ } | |
| regex special { '**' .*? '**' } | |
| # regex special { '**' .*? [ '**' || 'XX' <!> ] } # in these tests this works identically to the above | |
| } | |
| say TestGrammar.parse('test wooohoo XX oops test'); # correct! | |
| # 「test wooohoo XX oops test」 | |
| # plain => 「test wooohoo XX oops test」 | |
| say TestGrammar.parse('test **wooohoo XX oops test'); # correct! | |
| # 「test **wooohoo XX oops test」 | |
| # plain => 「test **wooohoo XX oops test」 | |
| say TestGrammar.parse('test **wooohoo** XX oops test'); # correct! | |
| # 「test **wooohoo** XX oops test」 | |
| # plain => 「test 」 | |
| # special => 「**wooohoo**」 | |
| # plain => 「 XX oops test」 | |
| say TestGrammar.parse('test **wooohoo XX oops** test'); # wrong! | |
| # 「test **wooohoo XX oops** test」 | |
| # plain => 「test 」 | |
| # special => 「**wooohoo XX oops**」 | |
| # plain => 「 test」 | |
| # I want it to be: | |
| # 「test **wooohoo XX oops** test」 | |
| # plain => 「test **wooohoo XX oops** test」 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment