From 59c87f2df787beb5334c108da4c41e88245ad191 Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Mon, 9 Sep 2013 18:12:50 +0100 Subject: Fix leex module`s inability to build unicode-aware lexers. If you have declared your .xrl file as utf-8 encoded and that some of your definitions contain unicode characters, either leex wouldn`t be able to lex them or compilation of the .xrl file would crash. --- lib/parsetools/src/leex.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parsetools/src/leex.erl b/lib/parsetools/src/leex.erl index 7039aea1ae..4544b34a1e 100644 --- a/lib/parsetools/src/leex.erl +++ b/lib/parsetools/src/leex.erl @@ -436,7 +436,7 @@ parse_defs(_, {eof,L}, St) -> parse_defs(Ifile, {ok,Chars,L}=Line, Ms, St) -> %% This little beauty matches out a macro definition, RE's are so clear. MS = "^[ \t]*([A-Z_][A-Za-z0-9_]*)[ \t]*=[ \t]*([^ \t\r\n]*)[ \t\r\n]*\$", - case re:run(Chars, MS, [{capture,all_but_first,list}]) of + case re:run(Chars, MS, [{capture,all_but_first,list},unicode]) of {match,[Name,Def]} -> %%io:fwrite("~p = ~p\n", [Name,Def]), parse_defs(Ifile, nextline(Ifile, L, St), [{Name,Def}|Ms], St); -- cgit v1.2.1