Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Support comment between move and time
Browse files Browse the repository at this point in the history
  • Loading branch information
na2hiro committed Jul 21, 2020
1 parent ebe47b6 commit 879bcdf
Show file tree
Hide file tree
Showing 2 changed files with 1,236 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/peg/csa-parser.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ komabetsuline = "P" teban:teban pieces:(xypiece)+ nl {return {teban: teban, piec
moves = hd:firstboard tl:move* comment* {tl.unshift(hd); return tl;}
firstboard = c:comment* {return c.length>0?{comments:c}:{}}

move = move:(normalmove / specialmove) time:time? comments:comment* {
move = move:(normalmove / specialmove) comments1:comment* time:time? comments2:comment* {
var ret = {};
const comments = comments1.concat(comments2);
if(comments.length>0){ret.comments=comments;}
if(time){ret.time=time;}
if(move.special){ret.special=move.special}else{ret.move=move};
Expand Down
Loading

0 comments on commit 879bcdf

Please sign in to comment.