diff --git a/examples/getInterfacesAndRoutes.js b/examples/getInterfacesAndRoutes.js index a572ced..f592c18 100644 --- a/examples/getInterfacesAndRoutes.js +++ b/examples/getInterfacesAndRoutes.js @@ -4,7 +4,9 @@ var device=new api(/* Host */'10.10.10.10' /*, Port */ /*, Timeout */); // device.setDebug(api.DEBUG); // connect: user, password. -device.connect().then(([login])=>login('username','password')).then(function(conn) { +device.connect() +.then(([login])=>login('username','password')) +.then(function(conn) { var c1=conn.openChannel(); var c2=conn.openChannel(); c1.closeOnDone(true); @@ -29,6 +31,7 @@ device.connect().then(([login])=>login('username','password')).then(function(con console.log(JSON.stringify(data.data,true,2)); }); -},function(err) { - console.log("Error connecting:",err); +}) +.catch(function(err) { + console.log("Error during processing:",err); }); diff --git a/package.json b/package.json index ef2ca7f..565b234 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mikronode", "description": "Mikrotik API implemented in Node", - "version": "2.3.10", + "version": "2.3.11", "author": "Brandon Myers ", "scripts": { "prebuild": "pegjs src/parser.g", diff --git a/src/parser.g b/src/parser.g index 0655466..4a328e4 100644 --- a/src/parser.g +++ b/src/parser.g @@ -17,7 +17,7 @@ data = id:identifier value:value s { return {field:id, value:value}} identifier - = "=" id:[\.a-z\-0-9]+ "=" {return id.join('')} + = "=" id:[\.a-zA-Z\-0-9]+ "=" {return id.join('')} value = v:[^\r\n\0]+ {return v.join('')} @@ -55,4 +55,4 @@ null = [\0x00] colon - = [:] \ No newline at end of file + = [:]