arnaud-lb / MtHaml

Multi target HAML (HAML for PHP, Twig, <your language here>)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Won't compile on Linux

kahurangitama opened this issue · comments

Hi!
Yesterday I'm trying to complie very simple template:

!!!
%html
  %head
    %title test
  %body

On Windows it's compiles, but on Ubuntu (XAMPP for Linux 1.8.1) I've got:

preg_match(): Compilation failed: internal error: previously-checked referenced subpattern not found at offset 358
/opt/lampp/htdocs/modules/haml/vendor/MtHaml/Parser/Buffer.php
...
74 if ($count = preg_match($pattern, $this->line, $match, PREG_OFFSET_CAPTURE)) {
...

I search a bit about this problem and I think what it's related to UTF-8 and preg_match.
But I still have no idea how I can fix it.

commented

Do you have the actual pattern & a stack trace maybe ?

Actually I don't know how I can look at pattern.
I'm using MtHaml as module for PHPixie Framework.
And it says exactly the same as in first my post.

BTW, when I change

%title test

to just

%title

it's passed.
All identation is correct (2 spaces), Unix-style line endings, file saved as UTF-8 (without BOM)

This looks like a PCRE bug. Could you try with an other pcre or php version ?