Skip to content

Commit

Permalink
Merge pull request #58 from Trakkasure/bugfix/allow-non-data-return-s…
Browse files Browse the repository at this point in the history
…entences

Fix #57 : allow non data return sentences
  • Loading branch information
Trakkasure committed Oct 25, 2017
2 parents 9f04aab + 289d630 commit 73aff81
Show file tree
Hide file tree
Showing 5 changed files with 1,289 additions and 1,151 deletions.
9 changes: 7 additions & 2 deletions .npmignore
@@ -1,7 +1,12 @@
node_modules
npm-debug.log
.vscode
examples
test
node_modules
src
test
webpack.config.babel.js
.babelrc
.eslintrc.json
.npmignore
constants.js
jsconfig.json
5 changes: 2 additions & 3 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "mikronode",
"description": "Mikrotik API implemented in Node",
"version": "2.3.4",
"version": "2.3.5",
"author": "Brandon Myers <trakkasure@gmail.com>",
"scripts": {
"build": "webpack --color --progress",
Expand Down Expand Up @@ -39,15 +39,14 @@
"babel-preset-stage-1": "^6.5.0",
"babel-register": "^6.24.1",
"chai": "^3.5.0",
"change-emitter": "^0.1.2",
"core-decorators": "^0.12.3",
"mocha": ">=1.7.4",
"simple-assign": "^0.1.0",
"uglify-js": ">=1.2.5",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.15.0"
},
"dependencies": {
"core-decorators": "^0.12.3",
"rxjs": "^5.3.0"
},
"main": "dist/mikronode.js",
Expand Down
1 change: 1 addition & 0 deletions src/constants.js
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
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

0 comments on commit 73aff81

Please sign in to comment.