c9s / r3

libr3 is a high-performance path dispatching library. It compiles your route paths into a prefix tree (trie). By using the constructed prefix trie in the start-up time, you may dispatch your routes with efficiency
http://c9s.github.com/r3/bench.html
MIT License
816 stars 83 forks source link

tree_compile error didn't happend sometimes #45

Closed CindyLinz closed 10 years ago

CindyLinz commented 10 years ago

with

my $t = Router::R3->new(
    '/a/{a:(}' => 1
);

I got:

creating R3 routing tree fail: PCRE compilation failed at offset 7: missing ), pattern: ^/a/(()

(good)

with

my $t = Router::R3->new(
    '/post4/{idx:\d{3}}/{idy}' => 6,
    '/post4/{idx:\d{3}}/{idy:(}' => 7,
);

I got

(nothing)

c9s commented 10 years ago

I found it's caused by the the same slug ID. so it breaks at "{idy:" + ":...."

c9s commented 10 years ago

your first case was fixed. but the second case is caused by another reason. :(

c9s commented 10 years ago

ok it's fixed now XD

c9s commented 10 years ago

fixed