rouge-ruby / rouge

A pure Ruby code highlighter that is compatible with Pygments
https://rouge.jneen.net/
Other
3.32k stars 731 forks source link

Disambiguate free pascal and puppet #1845

Closed tancnle closed 2 years ago

tancnle commented 2 years ago

Both free pascal and puppet are sharing the same file extension, that is .pp. This change adds .pp as a possible extension for the pascal lexer and disambiguates between puppet and pascal using keywords.

Addresses https://github.com/rouge-ruby/rouge/issues/1842

tancnle commented 2 years ago

@Alexey-T could you help to review this PR and verify if it addresses the reported issue? 🙏🏼

Alexey-T commented 2 years ago
            function Name : integer;
            begin
              Name := 2;
              Name := Name + 1
            end.

not correct snippet! end with dot is only at the end of UNIT FILE, but end of a function has end;.

tancnle commented 2 years ago

not correct snippet! end with dot is only at the end of UNIT FILE, but end of a function has end;.

Gotcha 👍🏼. Thanks for noting this. I have fixed the snippet in the test and extended the rules to cater for both end; and end.