diff options
author | Dan Gudmundsson <[email protected]> | 2012-10-16 13:13:05 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2013-01-09 11:41:40 +0100 |
commit | 5382426b0fb7fe5e6bd452015436eb3e7c689f31 (patch) | |
tree | 0ac8615990cdb4e71714c62417c09c1e73e336d0 /lib/wx/api_gen/gl_gen.erl | |
parent | ec68166e7512cb442f4995c0e3044a106f1a6372 (diff) | |
download | otp-5382426b0fb7fe5e6bd452015436eb3e7c689f31.tar.gz otp-5382426b0fb7fe5e6bd452015436eb3e7c689f31.tar.bz2 otp-5382426b0fb7fe5e6bd452015436eb3e7c689f31.zip |
wx: Fix xml-parsing with new doxygen version
Diffstat (limited to 'lib/wx/api_gen/gl_gen.erl')
-rw-r--r-- | lib/wx/api_gen/gl_gen.erl | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/lib/wx/api_gen/gl_gen.erl b/lib/wx/api_gen/gl_gen.erl index 331ba32ba4..ea967c958f 100644 --- a/lib/wx/api_gen/gl_gen.erl +++ b/lib/wx/api_gen/gl_gen.erl @@ -185,11 +185,11 @@ parse_define([#xmlElement{name=name,content=[#xmlText{value="WINGDIAPI"++_}]}|_] throw(skip); parse_define([#xmlElement{name=name,content=[#xmlText{value=Name}]}|R], Def, Os) -> parse_define(R, Def#def{name=Name}, Os); -parse_define([#xmlElement{name=initializer,content=[#xmlText{value=V}]}|_],Def,_Os) -> - Val0 = string:strip(V), - try +parse_define([#xmlElement{name=initializer,content=Contents}|_R],Def,_Os) -> + Val0 = extract_def2(Contents), + try case Val0 of - "0x" ++ Val1 -> + "0x" ++ Val1 -> _ = http_util:hexlist_to_integer(Val1), Def#def{val=Val1, type=hex}; _ -> @@ -207,6 +207,23 @@ parse_define([_|R], D, Opts) -> parse_define([], D, _Opts) -> D. +extract_def2([#xmlText{value=Val}|R]) -> + strip_comment(string:strip(Val)) ++ extract_def2(R); +extract_def2([#xmlElement{content=Cs}|R]) -> + extract_def2(Cs) ++ extract_def2(R); +extract_def2([]) -> []. + +strip_comment("/*" ++ Rest) -> + strip_comment_until_end(Rest); +strip_comment("//" ++ _) -> []; +strip_comment([H|R]) -> [H | strip_comment(R)]; +strip_comment([]) -> []. + +strip_comment_until_end("*/" ++ Rest) -> + strip_comment(Rest); +strip_comment_until_end([_|R]) -> + strip_comment_until_end(R). + parse_func(Xml, Opts) -> {Func,_} = foldl(fun(X,Acc) -> parse_func(X,Acc,Opts) end, {#func{},1}, Xml), put(current_func, Func#func.name), |