{"action":"created","issue":{"url":"https://api.github.com/repos/gap-system/ward/issues/32","repository_url":"https://api.github.com/repos/gap-system/ward","labels_url":"https://api.github.com/repos/gap-system/ward/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/gap-system/ward/issues/32/comments","events_url":"https://api.github.com/repos/gap-system/ward/issues/32/events","html_url":"https://github.com/gap-system/ward/issues/32","id":216018658,"number":32,"title":"ward sometimes changes content of strings","user":{"login":"fingolfin","id":241512,"avatar_url":"https://avatars1.githubusercontent.com/u/241512?v=3","gravatar_id":"","url":"https://api.github.com/users/fingolfin","html_url":"https://github.com/fingolfin","followers_url":"https://api.github.com/users/fingolfin/followers","following_url":"https://api.github.com/users/fingolfin/following{/other_user}","gists_url":"https://api.github.com/users/fingolfin/gists{/gist_id}","starred_url":"https://api.github.com/users/fingolfin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fingolfin/subscriptions","organizations_url":"https://api.github.com/users/fingolfin/orgs","repos_url":"https://api.github.com/users/fingolfin/repos","events_url":"https://api.github.com/users/fingolfin/events{/privacy}","received_events_url":"https://api.github.com/users/fingolfin/received_events","type":"User","site_admin":false},"labels":[{"id":183997902,"url":"https://api.github.com/repos/gap-system/ward/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-22T10:40:47Z","updated_at":"2017-03-22T11:58:03Z","closed_at":null,"body":"Running `testinstall` in  HPC-GAP on the `hpc-merge` branch produces, among other things, this diff:\r\n```\r\n########> Diff in /Users/mhorn/Projekte/GAP/gap.hpc-merge/build/hpcgap/../../hpcgap/tst/testinstall/trans.tst:1680\r\n# Input is:\r\nCYCLES_TRANS_LIST(IdentityTransformation, ());\r\n# Expected output:\r\nError, CYCLES_TRANS_LIST: the second argument must be a list (not a transforma\\\r\ntion (small))\r\n# But found:\r\nError, CYCLES_TRANS_LIST: the second argument must be a ReadGuard(list) (not a\\\r\n transformation (small))\r\n```\r\n\r\nThis looks as if ward got confused and modified an occurrence of `list` inside a string. Note that `list` is also the name of an argument to `FuncCYCLES_TRANS_LIST`):\r\n```C\r\nObj FuncCYCLES_TRANS_LIST (Obj self, Obj f, Obj list) {\r\n  UInt2   *ptf2;\r\n  UInt4   *seen, *ptf4;\r\n  UInt    deg, i, j, pt, nr;\r\n  Obj     out, comp, list_i;\r\n\r\n  if (!IS_TRANS(f)) {\r\n    ErrorQuit(\"CYCLES_TRANS_LIST: the first argument must be a \"\r\n              \"transformation (not a %s)\", (Int) TNAM_OBJ(f), 0L);\r\n  } else if (!IS_LIST(list)) {\r\n    ErrorQuit(\"CYCLES_TRANS_LIST: the second argument must be a \"\r\n              \"list (not a %s)\", (Int) TNAM_OBJ(f), 0L);\r\n  }\r\n....\r\n```\r\n\r\nOne guess is that the parser gets confused by the C convention that adjacent string literals get silently merged. Indeed, if I modify the code to merge the two adjacent strings, the test diff goes away."},"comment":{"url":"https://api.github.com/repos/gap-system/ward/issues/comments/288377213","html_url":"https://github.com/gap-system/ward/issues/32#issuecomment-288377213","issue_url":"https://api.github.com/repos/gap-system/ward/issues/32","id":288377213,"user":{"login":"rbehrends","id":5116346,"avatar_url":"https://avatars3.githubusercontent.com/u/5116346?v=3","gravatar_id":"","url":"https://api.github.com/users/rbehrends","html_url":"https://github.com/rbehrends","followers_url":"https://api.github.com/users/rbehrends/followers","following_url":"https://api.github.com/users/rbehrends/following{/other_user}","gists_url":"https://api.github.com/users/rbehrends/gists{/gist_id}","starred_url":"https://api.github.com/users/rbehrends/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbehrends/subscriptions","organizations_url":"https://api.github.com/users/rbehrends/orgs","repos_url":"https://api.github.com/users/rbehrends/repos","events_url":"https://api.github.com/users/rbehrends/events{/privacy}","received_events_url":"https://api.github.com/users/rbehrends/received_events","type":"User","site_admin":false},"created_at":"2017-03-22T11:58:03Z","updated_at":"2017-03-22T11:58:03Z","body":"The C parser is equipped to deal with this:\r\n\r\n```lua\r\nlocal string_constant = string_literal * (sp * string_literal)^0\r\n```\r\n\r\nThe rewriting part uses a simplified parser that *may* get tripped up by this, but the analyzer should not even generate a rewrite for this line and the rewriter doesn't rename variables: it only adds guards. This is most peculiar."}}
{"actor":{"display_login":"rbehrends"}}