Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

R15b01 #2

Merged
merged 3 commits into from

3 participants

Peter Lemenkov mats cronqvist Oleg Smirnov
Peter Lemenkov

Fixed compatibility issues with R15B01. Due to http deprecation this isn't compatible with R12B.

master and others added some commits
Oleg Smirnov master Fix OTP R15B compatibility issue (re:run instead of regexp:match). 37e5834
Peter Lemenkov lemenkov Fix for R15B - usage of deprecated http
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
f609c30
Peter Lemenkov lemenkov Off-by one error after switch to re:run/2
regexp:match(...) counts symbols starting from 0 while re:run(...) - from 1.

Eshell V5.6.5  (abort with ^G)
1> Str = "void* gn_construct_GdkPoint() {".
"void* gn_construct_GdkPoint() {"
2> {match,St,Le} = regexp:match(Str,"gn_construct_.*\\(").
{match,7,22}
3> string:substr(Str,St+13,Le-14).
"GdkPoint"
4>

Eshell V5.6.5  (abort with ^G)
1> Str = "void* gn_construct_GdkPoint() {".
"void* gn_construct_GdkPoint() {"
2> {match,[{St,Le}]} = re:run(Str,"gn_construct_.*\\(").
{match,[{6,22}]}
3> string:substr(Str,St+13,Le-14).
"_GdkPoin"
4> string:substr(Str,St+14,Le-14).
"GdkPoint"
5>

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
207589a
mats cronqvist massemanet merged commit f961795 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 7, 2012
  1. Oleg Smirnov Peter Lemenkov
  2. Peter Lemenkov

    Fix for R15B - usage of deprecated http

    lemenkov authored
    Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
  3. Peter Lemenkov

    Off-by one error after switch to re:run/2

    lemenkov authored
    regexp:match(...) counts symbols starting from 0 while re:run(...) - from 1.
    
    Eshell V5.6.5  (abort with ^G)
    1> Str = "void* gn_construct_GdkPoint() {".
    "void* gn_construct_GdkPoint() {"
    2> {match,St,Le} = regexp:match(Str,"gn_construct_.*\\(").
    {match,7,22}
    3> string:substr(Str,St+13,Le-14).
    "GdkPoint"
    4>
    
    Eshell V5.6.5  (abort with ^G)
    1> Str = "void* gn_construct_GdkPoint() {".
    "void* gn_construct_GdkPoint() {"
    2> {match,[{St,Le}]} = re:run(Str,"gn_construct_.*\\(").
    {match,[{6,22}]}
    3> string:substr(Str,St+13,Le-14).
    "_GdkPoin"
    4> string:substr(Str,St+14,Le-14).
    "GdkPoint"
    5>
    
    Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 5 deletions.
  1. +5 −5 priv/generator/generator.erl
10 priv/generator/generator.erl
View
@@ -77,9 +77,9 @@ get_ix_http(Doc) ->
[Px] -> ok
end,
[H,P] = string:tokens(Px,":"),
- http:set_options([{proxy,{{H,list_to_integer(P)},[]}}])
+ httpc:set_options([{proxy,{{H,list_to_integer(P)},[]}}])
end,
- ReqPid = spawn(fun() -> exit(http:request(Doc)) end),
+ ReqPid = spawn(fun() -> exit(httpc:request(Doc)) end),
ReqMon = erlang:monitor(process,ReqPid),
receive
{'DOWN',ReqMon,_,_,{ok,{_,_,S}}} -> S;
@@ -90,7 +90,7 @@ get_ix_http(Doc) ->
doc_links(Root,S)->
RE = "href=\"[A-Za-z-]+.html#id[0-9]+\">[a-z_]+ \\(\\)</a>",
- {match,Ms} = regexp:matches(S,RE),
+ {match,Ms} = re:run(S,RE),
io:fwrite("got ~p links for ~s~n",[length(Ms),basename(dirname(Root))]),
foreach(fun({St,Le})-> do_doc_link(Root,string:substr(S,St,Le)) end, Ms).
@@ -402,9 +402,9 @@ structs(StructsFile) ->
Structs = bio:string(StructsFile, fun do_structs/2, []),
foreach(fun ins_struct/1, Structs).
do_structs(Str, Acc) ->
- case regexp:match(Str,"gn_construct_.*\\(") of
+ case re:run(Str,"gn_construct_.*\\(") of
nomatch -> Acc;
- {match,St,Le} -> [string:substr(Str,St+13,Le-14)|Acc]
+ {match,[{St,Le}]} -> [string:substr(Str,St+14,Le-14)|Acc]
end.
ins_struct(S) -> ets:insert(types,#type{what=struct,cname=S,cast=""}).
Something went wrong with that request. Please try again.