Skip to content

Commit

Permalink
Fix #57: Allow empty RE sentences.
Browse files Browse the repository at this point in the history
  • Loading branch information
Trakkasure committed Oct 25, 2017
1 parent c9c4164 commit dba9ed4
Show file tree
Hide file tree
Showing 3 changed files with 1,280 additions and 1,146 deletions.
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const EVENT = {
, TAG: 'tag'
, DONE_RET_TAG: 'done_ret_tag'
, DONE_TAG: 'done_tag'
, RE: 're'
, DATA: 'data' // This is an artifical event, not one from the API
};

Expand Down
2 changes: 2 additions & 0 deletions src/parser.g
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ start

packet
= re s tag:tag data:data+ { return {type: "data", data:data, tag:tag} }
/ re s tag:tag { return {type: "re", tag:tag} }
/ re s data:data+ tag:tag { return {type: "data", data:data, tag:tag} }
/ re s data:data+ { return {type: "data", data:data} }
/ re s { return {type: "re"} }
/ e:end s {return e}

re
Expand Down
Loading

0 comments on commit dba9ed4

Please sign in to comment.