{"action":"created","issue":{"url":"https://api.github.com/repos/mliebelt/PgnViewerJS/issues/7","labels_url":"https://api.github.com/repos/mliebelt/PgnViewerJS/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/mliebelt/PgnViewerJS/issues/7/comments","events_url":"https://api.github.com/repos/mliebelt/PgnViewerJS/issues/7/events","html_url":"https://github.com/mliebelt/PgnViewerJS/issues/7","id":107445894,"number":7,"title":"peg.js version 0.9.0","user":{"login":"steinitz","id":377340,"avatar_url":"https://avatars.githubusercontent.com/u/377340?v=3","gravatar_id":"","url":"https://api.github.com/users/steinitz","html_url":"https://github.com/steinitz","followers_url":"https://api.github.com/users/steinitz/followers","following_url":"https://api.github.com/users/steinitz/following{/other_user}","gists_url":"https://api.github.com/users/steinitz/gists{/gist_id}","starred_url":"https://api.github.com/users/steinitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steinitz/subscriptions","organizations_url":"https://api.github.com/users/steinitz/orgs","repos_url":"https://api.github.com/users/steinitz/repos","events_url":"https://api.github.com/users/steinitz/events{/privacy}","received_events_url":"https://api.github.com/users/steinitz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-21T05:13:52Z","updated_at":"2015-09-26T09:44:43Z","closed_at":null,"body":"Hi,\r\n\r\nI've made some minor improvements to your peg-rules.peg (pasted below).  My changes are marked with SJS.  Feel free to use my changes.\r\n\r\nPgnViewerJS uses peg version 0.8.0.  Peg has now been updated to 0.9.0 which breaks peg-rules.peg - it throws 'Can't find variable: hm' for valid pgn.  I've raised an issue on the peg.js project but wondered if you might have any idea how to fix it.  I've spent a few hours on it without success.\r\n\r\nCheers,\r\n\r\nSteve\r\n\r\n\r\n---\r\n**Minor changes to peg-rules.peg**\r\n```\r\n{\r\n    function makeInteger(o) {\r\n        return parseInt(o.join(\"\"), 10);\r\n    }\r\n}\r\n\r\npgn\r\n  = pw:pgnStartWhite all:pgnBlack?\r\n      { arr = (all ? all : []); arr.unshift(pw);return arr; }\r\n  / pb:pgnStartBlack all:pgnWhite?\r\n    { arr = (all ? all : []); arr.unshift(pb); return arr; }\r\n  / whiteSpace?\r\n    { return [[]]; }\r\n\r\npgnStartWhite\r\n  = whiteSpace? pw:pgnWhite { return pw; }\r\n\r\npgnStartBlack\r\n  = whiteSpace? cm:comment? whiteSpace? me:moveEllipse? all:pgnBlack\r\n    { last = all[0]; last.moveNumber = me; last.commentMove = cm; return all; }\r\n\r\npgnWhite\r\n  = whiteSpace? cm:comment? whiteSpace? mn:moveNumber whiteSpace? cb:comment? whiteSpace?\r\n    hm:halfMove whiteSpace? nag:nags?  whiteSpace? ca:comment? whiteSpace? vari:variationWhite? all:pgnBlack?     // SJS hm:halfMove  nag:nags?  whiteSpace? ca:comment? whiteSpace? vari:variationWhite? all:pgnBlack?\r\n    { arr = (all ? all : []); move = {}; move.turn = 'w'; move.moveNumber = mn;\r\n      move.notation = hm; move.commentBefore = cb; move.commentAfter = ca; move.commentMove = cm;\r\n      move.variations = (vari ? vari : []); move.nag = (nag ? nag : null); arr.unshift(move); return arr; }\r\n  / endGame\r\n\r\npgnBlack\r\n  = whiteSpace? cb:comment? whiteSpace?\r\n    hm:halfMove whiteSpace? nag:nags? whiteSpace? ca:comment? whiteSpace? vari:variationBlack? all:pgnWhite? // SJS hm:halfMove  nag:nags? whiteSpace? ca:comment? whiteSpace? vari:variationBlack? all:pgnWhite?\r\n    { arr = (all ? all : []); move = {}; move.turn = 'b'; move.notation = hm;\r\n      move.commentBefore = cb; move.commentAfter = ca;\r\n      move.variations = (vari ? vari : []); arr.unshift(move); move.nag = (nag ? nag : null); return arr; }\r\n  / endGame\r\n\r\nendGame\r\n  = \"1:0\" { return [\"1:0\"]; }\r\n  / \"0:1\" { return [\"0:1\"]; }\r\n  / \"1-0\" { return [\"1:0\"]; } // SJS\r\n  / \"0-1\" { return [\"0:1\"]; } // SJS\r\n  / \"1/2-1/2\"  { return [\"1/2-1/2\"]; }\r\n  / \"*\"  { return [\"*\"]; }\r\n\r\ncomment\r\n  = cl cm:[^}]+ cr { return cm.join(\"\").trim(); }\r\n\r\ncl = '{'\r\n\r\ncr = '}'\r\n\r\nvariationWhite\r\n  = pl vari:pgnWhite pr whiteSpace? all:variationWhite? whiteSpace? me:moveEllipse? \r\n    { arr = (all ? all : []); arr.unshift(vari); return arr; }\r\n\r\nvariationBlack\r\n  = pl vari:pgnStartBlack pr whiteSpace? all:variationBlack?\r\n    { arr = (all ? all : []); arr.unshift(vari); return arr; }\r\n\r\npl = '('\r\n\r\npr = ')'\r\n\r\nmoveNumber\r\n    = num:integer\".\"? { return num; }\r\n\r\ninteger \"integer\"\r\n    = digits:[0-9]+ { return makeInteger(digits); }\r\n\r\nwhiteSpace\r\n    = [ \\t\\r\\n]+ { return '';} // SJS = \" \"+ { return '';}\r\n\r\nhalfMove\r\n  = fig:figure? & checkdisc disc:discriminator str:strike?\r\n    col:column row:row pr:promotion? ch:check?\r\n    { hm = {};\r\n      hm.fig = (fig ? fig : null);\r\n      hm.disc =  (disc ? disc : null);\r\n      hm.strike = (str ? str : null);\r\n      hm.col = col;\r\n      hm.row = row;\r\n      hm.check = (ch ? ch : null);\r\n      hm.promotion = pr;\r\n      hm.notation = (fig ? fig : \"\") + (disc ? disc : \"\") + (str ? str : \"\") + col + row + (pr ? pr : \"\") + (ch ? ch : \"\");\r\n      return hm; }\r\n  / fig:figure? str:strike? col:column row:row pr:promotion? ch:check?\r\n    { hm = {};\r\n      hm.fig = (fig ? fig : null);\r\n      hm.strike = (str ? str : null);\r\n      hm.col = col; hm.row = row;\r\n      hm.check = (ch ? ch : null);\r\n      hm.notation = (fig ? fig : \"\") + (str ? str : \"\") + col  + row + (pr ? pr : \"\") + (ch ? ch : \"\");\r\n      hm.promotion = pr;\r\n      return hm; }\r\n  / 'O-O-O' { hm = {}; hm.notation = 'O-O-O'; return  hm; }\r\n  / 'O-O' { hm = {}; hm.notation = 'O-O'; return  hm; }\r\n\r\ncheck\r\n  = '+'\r\n  / '#'\r\n\r\npromotion\r\n  = '=' f:figure { return '=' + f; }\r\n\r\nnags\r\n  = nag:nag whiteSpace? nags:nags? { arr = (nags ? nags : []); arr.unshift(nag); return arr; }\r\n\r\nnag\r\n  = '$' num:integer { return '$' + num; }\r\n  / '!!' { return '$3'; }\r\n  / '??' { return '$4'; }\r\n  / '!?' { return '$5'; }\r\n  / '?!' { return '$6'; }\r\n  / '!' { return '$1'; }\r\n  / '?' { return '$2'; }\r\n  / '=' { return '$10'; }\r\n  / '∞' { return '$13'; }\r\n  / 'D' { return '$220'; }\r\n\r\ndiscriminator\r\n  = column\r\n  / row\r\n\r\ncheckdisc\r\n  = discriminator strike? column row\r\n\r\nmoveEllipse\r\n  = num:integer\".\"+ { return num; }\r\n\r\nfigure\r\n  = [RNBQK]\r\n\r\ncolumn\r\n  = [a-h]\r\n\r\nrow\r\n  = [1-8]\r\n\r\nstrike\r\n  = 'x'\r\n```"},"comment":{"url":"https://api.github.com/repos/mliebelt/PgnViewerJS/issues/comments/143416134","html_url":"https://github.com/mliebelt/PgnViewerJS/issues/7#issuecomment-143416134","issue_url":"https://api.github.com/repos/mliebelt/PgnViewerJS/issues/7","id":143416134,"user":{"login":"mliebelt","id":520039,"avatar_url":"https://avatars.githubusercontent.com/u/520039?v=3","gravatar_id":"","url":"https://api.github.com/users/mliebelt","html_url":"https://github.com/mliebelt","followers_url":"https://api.github.com/users/mliebelt/followers","following_url":"https://api.github.com/users/mliebelt/following{/other_user}","gists_url":"https://api.github.com/users/mliebelt/gists{/gist_id}","starred_url":"https://api.github.com/users/mliebelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mliebelt/subscriptions","organizations_url":"https://api.github.com/users/mliebelt/orgs","repos_url":"https://api.github.com/users/mliebelt/repos","events_url":"https://api.github.com/users/mliebelt/events{/privacy}","received_events_url":"https://api.github.com/users/mliebelt/received_events","type":"User","site_admin":false},"created_at":"2015-09-26T09:44:43Z","updated_at":"2015-09-26T09:44:43Z","body":"I have followed your \"bug discussion\" on https://github.com/pegjs/pegjs/issues/376, and do understand the reason here. I have to upgrade to version 0.9.0, when I want to use the strict mode of `pegjs`. I will do that in the future. Currently I don't have the time to do a real new release, which is necessary to have a consistent version again.\r\n\r\nI will close that issue only when a new version is \"released\" which solves the problem with the strict mode. I will then invest some more time in the variations of PGN you touched in that issue."}}