{"action":"opened","issue":{"url":"https://api.github.com/repos/K2InformaticsGmbH/sqlparse/issues/71","repository_url":"https://api.github.com/repos/K2InformaticsGmbH/sqlparse","labels_url":"https://api.github.com/repos/K2InformaticsGmbH/sqlparse/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/K2InformaticsGmbH/sqlparse/issues/71/comments","events_url":"https://api.github.com/repos/K2InformaticsGmbH/sqlparse/issues/71/events","html_url":"https://github.com/K2InformaticsGmbH/sqlparse/issues/71","id":272300746,"number":71,"title":"Reengineering debugging (sqlpars_fold)","user":{"login":"walter-weinmann","id":1956149,"avatar_url":"https://avatars2.githubusercontent.com/u/1956149?v=4","gravatar_id":"","url":"https://api.github.com/users/walter-weinmann","html_url":"https://github.com/walter-weinmann","followers_url":"https://api.github.com/users/walter-weinmann/followers","following_url":"https://api.github.com/users/walter-weinmann/following{/other_user}","gists_url":"https://api.github.com/users/walter-weinmann/gists{/gist_id}","starred_url":"https://api.github.com/users/walter-weinmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walter-weinmann/subscriptions","organizations_url":"https://api.github.com/users/walter-weinmann/orgs","repos_url":"https://api.github.com/users/walter-weinmann/repos","events_url":"https://api.github.com/users/walter-weinmann/events{/privacy}","received_events_url":"https://api.github.com/users/walter-weinmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-08T18:25:39Z","updated_at":"2017-11-08T18:25:39Z","closed_at":null,"author_association":"COLLABORATOR","body":"Each folder function can now produce a debugging message at the beginning (level and parse tree section) and at the end ((partial) statement). Debugging is activated by `-define(NODEBUG, ...)` and recompilation.\r\n\r\n```\r\nfold(FType, Fun, Ctx, Lvl, {'create role', Role} = ST)\r\n    when is_binary(Role) ->\r\n    ?debugFmt(?MODULE_STRING ++ \":fold ===> Start ~p~n ST: ~p~n\", [Lvl, ST]),\r\n    NewCtx = case FType of\r\n                 top_down -> Fun(ST, Ctx);\r\n                 bottom_up -> Ctx\r\n             end,\r\n    {RoleStr, NewCtx1} = fold(FType, Fun, NewCtx, Lvl + 1, Role),\r\n    NewCtx2 = case FType of\r\n                  top_down -> NewCtx1;\r\n                  bottom_up -> Fun(ST, NewCtx1)\r\n              end,\r\n    RT = {\"create role \" ++ RoleStr, NewCtx2},\r\n    ?debugFmt(?MODULE_STRING ++ \":fold ===> ~n RT: ~p~n\", [RT]),\r\n    RT;\r\n\r\n```"}}
{"actor":{"display_login":"walter-weinmann"}}