{"action":"created","issue":{"url":"https://api.github.com/repos/jflex-de/jflex/issues/133","labels_url":"https://api.github.com/repos/jflex-de/jflex/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/jflex-de/jflex/issues/133/comments","events_url":"https://api.github.com/repos/jflex-de/jflex/issues/133/events","html_url":"https://github.com/jflex-de/jflex/issues/133","id":57721170,"number":133,"title":"[Bug] Error in skeleton.nested [sf#132]","user":{"login":"lsf37","id":5506585,"avatar_url":"https://avatars.githubusercontent.com/u/5506585?v=3","gravatar_id":"","url":"https://api.github.com/users/lsf37","html_url":"https://github.com/lsf37","followers_url":"https://api.github.com/users/lsf37/followers","following_url":"https://api.github.com/users/lsf37/following{/other_user}","gists_url":"https://api.github.com/users/lsf37/gists{/gist_id}","starred_url":"https://api.github.com/users/lsf37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsf37/subscriptions","organizations_url":"https://api.github.com/users/lsf37/orgs","repos_url":"https://api.github.com/users/lsf37/repos","events_url":"https://api.github.com/users/lsf37/events{/privacy}","received_events_url":"https://api.github.com/users/lsf37/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jflex-de/jflex/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"lsf37","id":5506585,"avatar_url":"https://avatars.githubusercontent.com/u/5506585?v=3","gravatar_id":"","url":"https://api.github.com/users/lsf37","html_url":"https://github.com/lsf37","followers_url":"https://api.github.com/users/lsf37/followers","following_url":"https://api.github.com/users/lsf37/following{/other_user}","gists_url":"https://api.github.com/users/lsf37/gists{/gist_id}","starred_url":"https://api.github.com/users/lsf37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsf37/subscriptions","organizations_url":"https://api.github.com/users/lsf37/orgs","repos_url":"https://api.github.com/users/lsf37/repos","events_url":"https://api.github.com/users/lsf37/events{/privacy}","received_events_url":"https://api.github.com/users/lsf37/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/jflex-de/jflex/milestones/9","labels_url":"https://api.github.com/repos/jflex-de/jflex/milestones/9/labels","id":980381,"number":9,"title":"1.6.1","description":"collecting issues for the 1.6.1 maintenance release","creator":{"login":"lsf37","id":5506585,"avatar_url":"https://avatars.githubusercontent.com/u/5506585?v=3","gravatar_id":"","url":"https://api.github.com/users/lsf37","html_url":"https://github.com/lsf37","followers_url":"https://api.github.com/users/lsf37/followers","following_url":"https://api.github.com/users/lsf37/following{/other_user}","gists_url":"https://api.github.com/users/lsf37/gists{/gist_id}","starred_url":"https://api.github.com/users/lsf37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsf37/subscriptions","organizations_url":"https://api.github.com/users/lsf37/orgs","repos_url":"https://api.github.com/users/lsf37/repos","events_url":"https://api.github.com/users/lsf37/events{/privacy}","received_events_url":"https://api.github.com/users/lsf37/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":2,"state":"open","created_at":"2015-02-15T22:19:24Z","updated_at":"2015-02-22T09:11:02Z","due_on":"2015-02-27T13:00:00Z","closed_at":null},"comments":15,"created_at":"2015-02-15T07:11:49Z","updated_at":"2015-02-22T10:25:48Z","closed_at":null,"body":"**Reported by jeningar on 2014-09-23 10:37 UTC**\nHi Steve, hi Gerwin,\r\n\r\nusing the skeleton.nested, the resulting program showed the following behaviour:\r\n\r\necho \"list sessions;\" | sdmsh\r\n\r\nhangs forever. But\r\n\r\necho \"list sessions;\" > /tmp/x\r\nsdmsh < /tmp/x\r\n\r\nteminates as should be.\r\n\r\nAfter merging the skeleton.default and skeleton.nested this erroneous behaviour vanished.\r\n\r\nDiffing the old and new skeleton.nested shows (< == new; > == old):\r\n\r\n~~~~~~~~~~~~~~~~\r\n[ronald@cheetah shell]$ diff skeleton.nested* | more\r\n39c39\r\n< \r\n---\r\n>   \r\n169c169\r\n<     while (numRead == 0) { // bug #130 discussion; while is better than if\r\n---\r\n>     if (numRead == 0) {\r\n403,409d402\r\n<     // cached fields:\r\n<     int zzCurrentPosL;\r\n<     int zzMarkedPosL;\r\n<     int zzEndReadL = zzEndRead;\r\n<     char [] zzBufferL = zzBuffer;\r\n<     char [] zzCMapL = ZZ_CMAP;\r\n< \r\n413c406,411\r\n<       zzMarkedPosL = zzMarkedPos;\r\n---\r\n>       // cached fields:\r\n>       int zzCurrentPosL;\r\n>       int zzMarkedPosL = zzMarkedPos;\r\n>       int zzEndReadL = zzEndRead;\r\n>       char [] zzBufferL = zzBuffer;\r\n>       char [] zzCMapL = ZZ_CMAP;\r\n~~~~~~~~~~~~~~~~\r\n\r\nThe HUGE difference is that the variables (notably zzEndReadL) aren't initialized by skeleton.default in every iteration of the while loop.\r\n\r\nDuring the merge I wondered why there are two skeletons in the first place. Those who don't want to read from multiple streams just don't call yypushStream() and friends. One skeleton would be more than enough (and a link for backward compatibility).\r\n\r\nfor the sake of completeness I attached the new skeleton.nested.\r\n\r\nRegards,\r\n\r\nRonald"},"comment":{"url":"https://api.github.com/repos/jflex-de/jflex/issues/comments/75428897","html_url":"https://github.com/jflex-de/jflex/issues/133#issuecomment-75428897","issue_url":"https://api.github.com/repos/jflex-de/jflex/issues/133","id":75428897,"user":{"login":"schedulix","id":5039178,"avatar_url":"https://avatars.githubusercontent.com/u/5039178?v=3","gravatar_id":"","url":"https://api.github.com/users/schedulix","html_url":"https://github.com/schedulix","followers_url":"https://api.github.com/users/schedulix/followers","following_url":"https://api.github.com/users/schedulix/following{/other_user}","gists_url":"https://api.github.com/users/schedulix/gists{/gist_id}","starred_url":"https://api.github.com/users/schedulix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schedulix/subscriptions","organizations_url":"https://api.github.com/users/schedulix/orgs","repos_url":"https://api.github.com/users/schedulix/repos","events_url":"https://api.github.com/users/schedulix/events{/privacy}","received_events_url":"https://api.github.com/users/schedulix/received_events","type":"User","site_admin":false},"created_at":"2015-02-22T10:25:48Z","updated_at":"2015-02-22T10:25:48Z","body":"Removing the `break` in the `<<EOF>>` rule doesn't seem to be a problem. In all other rules it is. Not because of the generated 1.7 code, but because of backward compatibility. Many Linux distributions (so far fortunately) still ship the 1.4.3 version of jflex. Removing the `break`s would definitely break the generated code. (Actually, I don't really mind adding those `break` statements).\r\n\r\nNow for some results after removing the `break` in the `<<EOF>>` rule:\r\n1. everything compiled without problems with the 1.4.3 version of jflex\r\n2. It didn't compile with the `f312d5...3ca53c` git version:\r\n```\r\nMiniScanner.java:946: error: orphaned default\r\n        default: \r\n        ^\r\nMiniScanner.java:1183: error: 'else' without 'if'\r\n          else {\r\n          ^\r\n```\r\nFor some reason the `default:` action is written *before* the start of the switch statement.\r\nThe generated code (line 939ff) looks like\r\n```\r\n...\r\n      // store back cached position\r\n      zzMarkedPos = zzMarkedPosL;\r\n\r\n              {\r\n                if(yymoreStreams()) { endInclude(); yypopStream(); } else return YYEOF;\r\n                                  /* break; not necessary here because of fallthrough of default rule that ends the switch */\r\n              }\r\n        default:\r\n          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {\r\n            zzAtEOF = true;\r\n        switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {\r\n          case 1:\r\n            { addVal();         inStatement = true;                     break;\r\n            }\r\n          case 38: break;\r\n...\r\n```\r\n\r\nand (line 1173ff)\r\n\r\n```\r\n...\r\n          case 37:\r\n            { addVal();\r\n                                  inStatement = true;\r\n                                  inMultiCmd = true;\r\n                                  // System.out.print(\"BMULTI \");\r\n                                  return MiniParser.BMULTI;\r\n            }\r\n          case 74: break;\r\n          }\r\n          else {\r\n            zzScanError(ZZ_NO_MATCH);\r\n          }\r\n...\r\n```"}}