diff options
Diffstat (limited to 'web')
| -rw-r--r-- | web/.babelrc | 3 | ||||
| -rw-r--r-- | web/.bowerrc | 3 | ||||
| -rw-r--r-- | web/.eslintrc | 8 | ||||
| -rw-r--r-- | web/.eslintrc.yml | 9 | ||||
| -rw-r--r-- | web/gulpfile.js | 10 | ||||
| -rw-r--r-- | web/package.json | 47 | ||||
| -rw-r--r-- | web/src/css/layout.less | 2 | ||||
| -rw-r--r-- | web/src/js/app.js | 16 | ||||
| -rw-r--r-- | web/src/js/components/common.js | 79 | ||||
| -rw-r--r-- | web/src/js/components/editor.js | 15 | ||||
| -rw-r--r-- | web/src/js/components/eventlog.js | 2 | ||||
| -rw-r--r-- | web/src/js/components/flowtable.js | 5 | ||||
| -rw-r--r-- | web/src/js/components/flowview/index.js | 10 | ||||
| -rw-r--r-- | web/src/js/components/flowview/messages.js | 3 | ||||
| -rw-r--r-- | web/src/js/components/header.js | 29 | ||||
| -rw-r--r-- | web/src/js/components/mainview.js | 14 | ||||
| -rw-r--r-- | web/src/js/components/prompt.js | 3 | ||||
| -rw-r--r-- | web/src/js/components/proxyapp.js | 45 | ||||
| -rw-r--r-- | web/src/js/components/virtualscroll.js | 11 | ||||
| -rw-r--r-- | web/src/js/filt/filt.js | 886 | ||||
| -rw-r--r-- | web/src/js/filt/filt.peg | 1 | ||||
| -rw-r--r-- | web/src/templates/index.html | 1 | 
22 files changed, 598 insertions, 604 deletions
| diff --git a/web/.babelrc b/web/.babelrc new file mode 100644 index 00000000..facd1809 --- /dev/null +++ b/web/.babelrc @@ -0,0 +1,3 @@ +{ +  "presets": ["es2015", "react"] +}
\ No newline at end of file diff --git a/web/.bowerrc b/web/.bowerrc deleted file mode 100644 index 5e6701af..00000000 --- a/web/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ -  "directory" : "bower_components" -}
\ No newline at end of file diff --git a/web/.eslintrc b/web/.eslintrc deleted file mode 100644 index df187739..00000000 --- a/web/.eslintrc +++ /dev/null @@ -1,8 +0,0 @@ -{ -  "ecmaFeatures": { -    "jsx": true -  }, -  "env": { -    "es6": true -  } -}
\ No newline at end of file diff --git a/web/.eslintrc.yml b/web/.eslintrc.yml new file mode 100644 index 00000000..319fa67c --- /dev/null +++ b/web/.eslintrc.yml @@ -0,0 +1,9 @@ +{ +    "parserOptions": { +        "ecmaVersion": 6, +        "sourceType": "module", +        "ecmaFeatures": { +            "jsx": true +        } +    } +}
\ No newline at end of file diff --git a/web/gulpfile.js b/web/gulpfile.js index 83893c91..58f74098 100644 --- a/web/gulpfile.js +++ b/web/gulpfile.js @@ -7,8 +7,6 @@ var conf = require('./conf.js');  var babelify = require('babelify');  var browserify = require('browserify');  var gulp = require("gulp"); -var concat = require('gulp-concat'); -var connect = require('gulp-connect');  var eslint = require('gulp-eslint');  var less = require("gulp-less");  var livereload = require("gulp-livereload"); @@ -16,18 +14,13 @@ var minifyCSS = require('gulp-minify-css');  var notify = require("gulp-notify");  var peg = require("gulp-peg");  var plumber = require("gulp-plumber"); -var react = require("gulp-react");  var rename = require("gulp-rename"); -var replace = require('gulp-replace');  var sourcemaps = require('gulp-sourcemaps');  var gutil = require("gulp-util");  var _ = require('lodash'); -var map = require("map-stream"); -var reactify = require('reactify');  var uglifyify = require('uglifyify');  var buffer = require('vinyl-buffer');  var source = require('vinyl-source-stream'); -var transform = require('vinyl-transform');  var watchify = require('watchify');  var vendor_packages = _.difference( @@ -116,6 +109,7 @@ function buildScript(bundler, filename, dev) {      // listen for an update and run rebundle      bundler.on('update', rebundle);      bundler.on('log', gutil.log); +    bundler.on('error', gutil.log);      // run it once the first time buildScript is called      return rebundle(); @@ -150,7 +144,7 @@ function app_stream(dev) {      for (var vp of vendor_packages) {          bundler.external(vp);      } -    bundler = bundler.transform(babelify).transform(reactify); +    bundler = bundler.transform(babelify);      return buildScript(bundler, "app.js", dev);  }  gulp.task('scripts-app-dev', function () { diff --git a/web/package.json b/web/package.json index 5bcbdd87..a1b42d01 100644 --- a/web/package.json +++ b/web/package.json @@ -15,41 +15,36 @@      "testDirectoryName": "tests"    },    "dependencies": { -    "bootstrap": "^3.3.4", +    "bootstrap": "^3.3.6",      "flux": "^2.1.1", -    "jquery": "^2.1.4", -    "lodash": "^3.10.1", -    "react": "^0.13.3", -    "react-router": "^0.13.2" +    "jquery": "^2.2.1", +    "lodash": "^4.5.1", +    "react": "^0.14.7", +    "react-dom": "^0.14.7", +    "react-router": "^2.0.0"    },    "devDependencies": { -    "babelify": "^6.3.0", -    "browserify": "^11.2.0", -    "eslint": "^1.5.1", -    "gulp": "^3.9.0", -    "gulp-concat": "^2.6.0", -    "gulp-connect": "^2.2.0", -    "gulp-eslint": "^1.0.0", -    "gulp-jshint": "^1.11.2", -    "gulp-less": "^3.0.3", +    "babel-core": "^6.5.2", +    "babel-preset-es2015": "^6.5.0", +    "babel-preset-react": "^6.5.0", +    "babelify": "^7.2.0", +    "browserify": "^13.0.0", +    "eslint": "^2.2.0", +    "gulp": "^3.9.1", +    "gulp-eslint": "^2.0.0", +    "gulp-less": "^3.0.5",      "gulp-livereload": "^3.8.1", -    "gulp-minify-css": "^1.2.1", +    "gulp-minify-css": "^1.2.4",      "gulp-notify": "^2.2.0", -    "gulp-peg": "^0.1.2", -    "gulp-plumber": "^1.0.1", -    "gulp-react": "^3.0.1", +    "gulp-peg": "^0.2.0", +    "gulp-plumber": "^1.1.0",      "gulp-rename": "^1.2.2", -    "gulp-replace": "^0.5.4",      "gulp-sourcemaps": "^1.6.0", -    "gulp-uglify": "^1.4.1", -    "gulp-util": "^3.0.6", -    "lodash": "^3.10.1", -    "map-stream": "0.0.6", -    "reactify": "^1.1.1", +    "gulp-util": "^3.0.7", +    "lodash": "^4.5.1",      "uglifyify": "^3.0.1",      "vinyl-buffer": "^1.0.0",      "vinyl-source-stream": "^1.1.0", -    "vinyl-transform": "^1.0.0", -    "watchify": "^3.4.0" +    "watchify": "^3.7.0"    }  } diff --git a/web/src/css/layout.less b/web/src/css/layout.less index 1075d6c9..ed4adb69 100644 --- a/web/src/css/layout.less +++ b/web/src/css/layout.less @@ -1,4 +1,4 @@ -html, body, #container { +html, body, #container, #mitmproxy {      height: 100%;      margin: 0;      overflow: hidden; diff --git a/web/src/js/app.js b/web/src/js/app.js index 9fb868b8..e21fa499 100644 --- a/web/src/js/app.js +++ b/web/src/js/app.js @@ -1,9 +1,9 @@ -var React = require("react"); -var ReactRouter = require("react-router"); -var $ = require("jquery"); -var Connection = require("./connection"); -var proxyapp = require("./components/proxyapp.js"); -var EventLogActions = require("./actions.js").EventLogActions; +import React from "react" +import { render } from 'react-dom' +import $ from "jquery" +import Connection from "./connection" +import {app} from "./components/proxyapp.js" +import { EventLogActions } from "./actions.js"  $(function () {      window.ws = new Connection("/updates"); @@ -12,8 +12,6 @@ $(function () {          EventLogActions.add_event(msg);      }; -    ReactRouter.run(proxyapp.routes, function (Handler, state) { -        React.render(<Handler/>, document.body); -    }); +    render(app, document.getElementById("mitmproxy"));  }); diff --git a/web/src/js/components/common.js b/web/src/js/components/common.js index 965ae9a7..03b2ef8c 100644 --- a/web/src/js/components/common.js +++ b/web/src/js/components/common.js @@ -1,11 +1,12 @@  var React = require("react"); +var ReactDOM = require("react-dom");  var ReactRouter = require("react-router");  var _ = require("lodash");  // http://blog.vjeux.com/2013/javascript/scroll-position-with-react.html (also contains inverse example) -var AutoScrollMixin = { +export var AutoScrollMixin = {      componentWillUpdate: function () { -        var node = this.getDOMNode(); +        var node = ReactDOM.findDOMNode(this);          this._shouldScrollBottom = (          node.scrollTop !== 0 &&          node.scrollTop + node.clientHeight === node.scrollHeight @@ -13,23 +14,23 @@ var AutoScrollMixin = {      },      componentDidUpdate: function () {          if (this._shouldScrollBottom) { -            var node = this.getDOMNode(); +            var node = ReactDOM.findDOMNode(this);              node.scrollTop = node.scrollHeight;          }      },  }; -var StickyHeadMixin = { +export var StickyHeadMixin = {      adjustHead: function () {          // Abusing CSS transforms to set the element          // referenced as head into some kind of position:sticky. -        var head = this.refs.head.getDOMNode(); -        head.style.transform = "translate(0," + this.getDOMNode().scrollTop + "px)"; +        var head = this.refs.head; +        head.style.transform = "translate(0," + ReactDOM.findDOMNode(this).scrollTop + "px)";      }  }; -var SettingsState = { +export var SettingsState = {      contextTypes: {          settingsStore: React.PropTypes.object.isRequired      }, @@ -52,58 +53,62 @@ var SettingsState = {  }; -var ChildFocus = { +export var ChildFocus = {      contextTypes: {          returnFocus: React.PropTypes.func      },      returnFocus: function(){ -        React.findDOMNode(this).blur(); +        ReactDOM.findDOMNode(this).blur();          window.getSelection().removeAllRanges();          this.context.returnFocus();      }  }; -var Navigation = _.extend({}, ReactRouter.Navigation, { +export var Navigation = { +    contextTypes: { +        routerFoo: React.PropTypes.object, +        router: React.PropTypes.object.isRequired +    },      setQuery: function (dict) { -        var q = this.context.router.getCurrentQuery(); +        var q = this.context.routerFoo.location.query;          for (var i in dict) {              if (dict.hasOwnProperty(i)) {                  q[i] = dict[i] || undefined; //falsey values shall be removed.              }          } -        this.replaceWith(this.context.router.getCurrentPath(), this.context.router.getCurrentParams(), q); +        this.replaceWith(undefined, q);      }, -    replaceWith: function (routeNameOrPath, params, query) { -        if (routeNameOrPath === undefined) { -            routeNameOrPath = this.context.router.getCurrentPath(); -        } -        if (params === undefined) { -            params = this.context.router.getCurrentParams(); +    replaceWith: function (pathname, query) { +        if (pathname === undefined) { +            pathname = this.context.routerFoo.location.pathname;          }          if (query === undefined) { -            query = this.context.router.getCurrentQuery(); +            query = this.context.routerFoo.query;          } - -        this.context.router.replaceWith(routeNameOrPath, params, query); +        console.log({ pathname, query }); +        this.context.router.replace({ pathname, query });      } -}); +};  // react-router is fairly good at changing its API regularly.  // We keep the old method for now - if it should turn out that their changes are permanent,  // we may remove this mixin and access react-router directly again. -var RouterState = _.extend({}, ReactRouter.State, { +export var RouterState = { +    contextTypes: { +        routerFoo: React.PropTypes.object, +    },      getQuery: function () {          // For whatever reason, react-router always returns the same object, which makes comparing          // the current props with nextProps impossible. As a workaround, we just clone the query object. -        return _.clone(this.context.router.getCurrentQuery()); +        return _.clone(this.context.routerFoo.location.query);      },      getParams: function () { -        return _.clone(this.context.router.getCurrentParams()); +        return _.clone(this.context.routerFoo.params);      } -}); +}; -var Splitter = React.createClass({ +export var Splitter = React.createClass({      getDefaultProps: function () {          return {              axis: "x" @@ -127,7 +132,7 @@ var Splitter = React.createClass({          window.addEventListener("dragend", this.onDragEnd);      },      onDragEnd: function () { -        this.getDOMNode().style.transform = ""; +        ReactDOM.findDOMNode(this).style.transform = "";          window.removeEventListener("dragend", this.onDragEnd);          window.removeEventListener("mouseup", this.onMouseUp);          window.removeEventListener("mousemove", this.onMouseMove); @@ -135,7 +140,7 @@ var Splitter = React.createClass({      onMouseUp: function (e) {          this.onDragEnd(); -        var node = this.getDOMNode(); +        var node = ReactDOM.findDOMNode(this);          var prev = node.previousElementSibling;          var next = node.nextElementSibling; @@ -163,7 +168,7 @@ var Splitter = React.createClass({          } else {              dY = e.pageY - this.state.startY;          } -        this.getDOMNode().style.transform = "translate(" + dX + "px," + dY + "px)"; +        ReactDOM.findDOMNode(this).style.transform = "translate(" + dX + "px," + dY + "px)";      },      onResize: function () {          // Trigger a global resize event. This notifies components that employ virtual scrolling @@ -176,7 +181,7 @@ var Splitter = React.createClass({          if (!this.state.applied) {              return;          } -        var node = this.getDOMNode(); +        var node = ReactDOM.findDOMNode(this);          var prev = node.previousElementSibling;          var next = node.nextElementSibling; @@ -206,14 +211,4 @@ var Splitter = React.createClass({              </div>          );      } -}); - -module.exports = { -    ChildFocus: ChildFocus, -    RouterState: RouterState, -    Navigation: Navigation, -    StickyHeadMixin: StickyHeadMixin, -    AutoScrollMixin: AutoScrollMixin, -    Splitter: Splitter, -    SettingsState: SettingsState -};
\ No newline at end of file +});
\ No newline at end of file diff --git a/web/src/js/components/editor.js b/web/src/js/components/editor.js index f2d44566..62c5310c 100644 --- a/web/src/js/components/editor.js +++ b/web/src/js/components/editor.js @@ -1,4 +1,5 @@  var React = require("react"); +var ReactDOM = require('react-dom');  var common = require("./common.js");  var utils = require("../utils.js"); @@ -98,12 +99,12 @@ var EditorBase = React.createClass({              range = document.caretRangeFromPoint(e.clientX, e.clientY);          } else {              range = document.createRange(); -            range.selectNodeContents(React.findDOMNode(this)); +            range.selectNodeContents(ReactDOM.findDOMNode(this));          }          this._ignore_events = true;          this.setState({editable: true}, function () { -            var node = React.findDOMNode(this); +            var node = ReactDOM.findDOMNode(this);              node.blur();              node.focus();              this._ignore_events = false; @@ -117,7 +118,7 @@ var EditorBase = React.createClass({          // a stop would cause a blur as a side-effect.          // but a blur event must trigger a stop as well.          // to fix this, make stop = blur and do the actual stop in the onBlur handler. -        React.findDOMNode(this).blur(); +        ReactDOM.findDOMNode(this).blur();          this.props.onStop && this.props.onStop();      },      _stop: function (e) { @@ -126,14 +127,14 @@ var EditorBase = React.createClass({          }          console.log("_stop", _.extend({}, e));          window.getSelection().removeAllRanges(); //make sure that selection is cleared on blur -        var node = React.findDOMNode(this); +        var node = ReactDOM.findDOMNode(this);          var content = this.props.nodeToContent(node);          this.setState({editable: false});          this.props.onDone(content);          this.props.onBlur && this.props.onBlur(e);      },      reset: function () { -        React.findDOMNode(this).innerHTML = this.props.contentToHtml(this.props.content); +        ReactDOM.findDOMNode(this).innerHTML = this.props.contentToHtml(this.props.content);      },      onKeyDown: function (e) {          e.stopPropagation(); @@ -154,7 +155,7 @@ var EditorBase = React.createClass({          }      },      onInput: function () { -        var node = React.findDOMNode(this); +        var node = ReactDOM.findDOMNode(this);          var content = this.props.nodeToContent(node);          this.props.onInput && this.props.onInput(content);      } @@ -228,7 +229,7 @@ var ValueEditor = React.createClass({          />;      },      focus: function () { -        React.findDOMNode(this).focus(); +        ReactDOM.findDOMNode(this).focus();      },      onStop: function () {          this.returnFocus(); diff --git a/web/src/js/components/eventlog.js b/web/src/js/components/eventlog.js index fea7b247..9dcd2c38 100644 --- a/web/src/js/components/eventlog.js +++ b/web/src/js/components/eventlog.js @@ -1,7 +1,7 @@  var React = require("react");  var common = require("./common.js");  var Query = require("../actions.js").Query; -var VirtualScrollMixin = require("./virtualscroll.js"); +import { VirtualScrollMixin } from "./virtualscroll.js"  var views = require("../store/view.js");  var _ = require("lodash"); diff --git a/web/src/js/components/flowtable.js b/web/src/js/components/flowtable.js index 609034f6..b27ed30d 100644 --- a/web/src/js/components/flowtable.js +++ b/web/src/js/components/flowtable.js @@ -1,9 +1,10 @@  var React = require("react"); +var ReactDOM = require('react-dom');  var common = require("./common.js");  var utils = require("../utils.js");  var _ = require("lodash"); -var VirtualScrollMixin = require("./virtualscroll.js"); +import { VirtualScrollMixin } from "./virtualscroll.js"  var flowtable_columns = require("./flowtable-columns.js");  var FlowRow = React.createClass({ @@ -143,7 +144,7 @@ var FlowTable = React.createClass({      scrollIntoView: function (flow) {          this.scrollRowIntoView(              this.context.view.index(flow), -            this.refs.body.getDOMNode().offsetTop +            ReactDOM.findDOMNode(this.refs.body).offsetTop          );      },      renderRow: function (flow) { diff --git a/web/src/js/components/flowview/index.js b/web/src/js/components/flowview/index.js index 739a46dc..91b17dd2 100644 --- a/web/src/js/components/flowview/index.js +++ b/web/src/js/components/flowview/index.js @@ -40,13 +40,7 @@ var FlowView = React.createClass({          this.selectTab(tabs[nextIndex]);      },      selectTab: function (panel) { -        this.replaceWith( -            "flow", -            { -                flowId: this.getParams().flowId, -                detailTab: panel -            } -        ); +        this.replaceWith(`/flows/${this.getParams().flowId}/${panel}`);      },      getActive: function(){          return this.getParams().detailTab; @@ -93,7 +87,7 @@ var FlowView = React.createClass({          var tabs = this.getTabs(flow);          var active = this.getActive(); -        if (!_.contains(tabs, active)) { +        if (tabs.indexOf(active) < 0) {              if (active === "response" && flow.error) {                  active = "error";              } else if (active === "error" && flow.response) { diff --git a/web/src/js/components/flowview/messages.js b/web/src/js/components/flowview/messages.js index 7ac95d85..c11ee46f 100644 --- a/web/src/js/components/flowview/messages.js +++ b/web/src/js/components/flowview/messages.js @@ -1,4 +1,5 @@  var React = require("react"); +var ReactDOM = require('react-dom');  var _ = require("lodash");  var common = require("../common.js"); @@ -98,7 +99,7 @@ var HeaderEditor = React.createClass({          return <ValueEditor ref="input" {...this.props} onKeyDown={this.onKeyDown} inline/>;      },      focus: function () { -        this.getDOMNode().focus(); +        ReactDOM.findDOMNode(this).focus();      },      onKeyDown: function (e) {          switch (e.keyCode) { diff --git a/web/src/js/components/header.js b/web/src/js/components/header.js index 998a41df..f2cc3fc5 100644 --- a/web/src/js/components/header.js +++ b/web/src/js/components/header.js @@ -1,4 +1,5 @@  var React = require("react"); +var ReactDOM = require('react-dom');  var $ = require("jquery");  var Filt = require("../filt/filt.js"); @@ -76,26 +77,24 @@ var FilterInput = React.createClass({      },      isValid: function (filt) {          try { -            Filt.parse(filt || this.state.value); +            var str = filt || this.state.value; +            if(str){ +                Filt.parse(filt || this.state.value); +            }              return true;          } catch (e) {              return false;          }      },      getDesc: function () { -        var desc; -        try { -            desc = Filt.parse(this.state.value).desc; -        } catch (e) { -            desc = "" + e; -        } -        if (desc !== "true") { -            return desc; -        } else { -            return ( -                <FilterDocs/> -            ); +        if(this.state.value) { +            try { +                return Filt.parse(this.state.value).desc; +            } catch (e) { +                return "" + e; +            }          } +        return <FilterDocs/>;      },      onFocus: function () {          this.setState({focus: true}); @@ -118,11 +117,11 @@ var FilterInput = React.createClass({          e.stopPropagation();      },      blur: function () { -        this.refs.input.getDOMNode().blur(); +        ReactDOM.findDOMNode(this.refs.input).blur();          this.returnFocus();      },      select: function () { -        this.refs.input.getDOMNode().select(); +        ReactDOM.findDOMNode(this.refs.input).select();      },      render: function () {          var isValid = this.isValid(); diff --git a/web/src/js/components/mainview.js b/web/src/js/components/mainview.js index 9ff51dfa..86666e39 100644 --- a/web/src/js/components/mainview.js +++ b/web/src/js/components/mainview.js @@ -42,7 +42,8 @@ var MainView = React.createClass({      },      getViewFilt: function () {          try { -            var filt = Filt.parse(this.getQuery()[Query.SEARCH] || ""); +            var filtStr = this.getQuery()[Query.SEARCH]; +            var filt = filtStr ? Filt.parse(filtStr) : function(){return true};              var highlightStr = this.getQuery()[Query.HIGHLIGHT];              var highlight = highlightStr ? Filt.parse(highlightStr) : false;          } catch (e) { @@ -90,16 +91,11 @@ var MainView = React.createClass({      },      selectFlow: function (flow) {          if (flow) { -            this.replaceWith( -                "flow", -                { -                    flowId: flow.id, -                    detailTab: this.getParams().detailTab || "request" -                } -            ); +            var tab = this.getParams().detailTab || "request"; +            this.replaceWith(`/flows/${flow.id}/${tab}`);              this.refs.flowTable.scrollIntoView(flow);          } else { -            this.replaceWith("flows", {}); +            this.replaceWith("/flows");          }      },      selectFlowRelative: function (shift) { diff --git a/web/src/js/components/prompt.js b/web/src/js/components/prompt.js index 121a1170..9695bd94 100644 --- a/web/src/js/components/prompt.js +++ b/web/src/js/components/prompt.js @@ -1,4 +1,5 @@  var React = require("react"); +var ReactDOM = require('react-dom');  var _ = require("lodash");  var utils = require("../utils.js"); @@ -12,7 +13,7 @@ var Prompt = React.createClass({          prompt: React.PropTypes.string      },      componentDidMount: function () { -        React.findDOMNode(this).focus(); +        ReactDOM.findDOMNode(this).focus();      },      onKeyDown: function (e) {          e.stopPropagation(); diff --git a/web/src/js/components/proxyapp.js b/web/src/js/components/proxyapp.js index e766d6e6..9c2d8714 100644 --- a/web/src/js/components/proxyapp.js +++ b/web/src/js/components/proxyapp.js @@ -1,4 +1,5 @@  var React = require("react"); +var ReactDOM = require("react-dom");  var ReactRouter = require("react-router");  var _ = require("lodash"); @@ -27,6 +28,7 @@ var ProxyAppMain = React.createClass({          flowStore: React.PropTypes.object.isRequired,          eventStore: React.PropTypes.object.isRequired,          returnFocus: React.PropTypes.func.isRequired, +        routerFoo: React.PropTypes.object,      },      componentDidMount: function () {          this.focus(); @@ -37,6 +39,10 @@ var ProxyAppMain = React.createClass({              flowStore: this.state.flowStore,              eventStore: this.state.eventStore,              returnFocus: this.focus, +            routerFoo: { +                location: this.props.location, +                params: this.props.params +            }          };      },      getInitialState: function () { @@ -53,10 +59,10 @@ var ProxyAppMain = React.createClass({          };      },      focus: function () { -        React.findDOMNode(this).focus(); +        ReactDOM.findDOMNode(this).focus();      },      getMainComponent: function () { -        return this.refs.view.refs.__routeHandler__; +        return this.refs.view;      },      onKeydown: function (e) { @@ -88,7 +94,7 @@ var ProxyAppMain = React.createClass({      },      render: function () {          var eventlog; -        if (this.getQuery()[Query.SHOW_EVENTLOG]) { +        if (this.props.location.query[Query.SHOW_EVENTLOG]) {              eventlog = [                  <common.Splitter key="splitter" axis="y"/>,                  <EventLog key="eventlog"/> @@ -96,10 +102,14 @@ var ProxyAppMain = React.createClass({          } else {              eventlog = null;          } +        var children = React.cloneElement( +            this.props.children, +            { ref: "view", query: this.props.location.query } +        );          return (              <div id="container" tabIndex="0" onKeyDown={this.onKeydown}>                  <header.Header ref="header"/> -                <RouteHandler ref="view" query={this.getQuery()}/> +                {children}                  {eventlog}                  <Footer/>              </div> @@ -108,22 +118,15 @@ var ProxyAppMain = React.createClass({  }); -var Route = ReactRouter.Route; -var RouteHandler = ReactRouter.RouteHandler; -var Redirect = ReactRouter.Redirect; -var DefaultRoute = ReactRouter.DefaultRoute; -var NotFoundRoute = ReactRouter.NotFoundRoute; - +import { Route, Router, hashHistory, Redirect} from "react-router"; -var routes = ( -    <Route path="/" handler={ProxyAppMain}> -        <Route name="flows" path="flows" handler={MainView}/> -        <Route name="flow" path="flows/:flowId/:detailTab" handler={MainView}/> -        <Route name="reports" handler={Reports}/> -        <Redirect path="/" to="flows" /> +export var app = ( +<Router history={hashHistory}> +    <Redirect from="/" to="/flows" /> +    <Route path="/" component={ProxyAppMain}> +        <Route path="flows" component={MainView}/> +        <Route path="flows/:flowId/:detailTab" component={MainView}/> +        <Route path="reports" component={Reports}/>      </Route> -); - -module.exports = { -    routes: routes -};
\ No newline at end of file +</Router> +);
\ No newline at end of file diff --git a/web/src/js/components/virtualscroll.js b/web/src/js/components/virtualscroll.js index 956e1a0b..f462fdcc 100644 --- a/web/src/js/components/virtualscroll.js +++ b/web/src/js/components/virtualscroll.js @@ -1,6 +1,7 @@ -var React = require("react"); +import React from "react"; +import ReactDOM from "react-dom"; -var VirtualScrollMixin = { +export var VirtualScrollMixin = {      getInitialState: function () {          return {              start: 0, @@ -43,7 +44,7 @@ var VirtualScrollMixin = {          window.removeEventListener('resize', this.onScroll);      },      onScroll: function () { -        var viewport = this.getDOMNode(); +        var viewport = ReactDOM.findDOMNode(this);          var top = viewport.scrollTop;          var height = viewport.offsetHeight;          var start = Math.floor(top / this.props.rowHeight); @@ -69,7 +70,7 @@ var VirtualScrollMixin = {          var row_top = (index * this.props.rowHeight) + head_height;          var row_bottom = row_top + this.props.rowHeight; -        var viewport = this.getDOMNode(); +        var viewport = ReactDOM.findDOMNode(this);          var viewport_top = viewport.scrollTop;          var viewport_bottom = viewport_top + viewport.offsetHeight; @@ -81,5 +82,3 @@ var VirtualScrollMixin = {          }      },  }; - -module.exports  = VirtualScrollMixin;
\ No newline at end of file diff --git a/web/src/js/filt/filt.js b/web/src/js/filt/filt.js index 45b42f3a..6a0bbab7 100644 --- a/web/src/js/filt/filt.js +++ b/web/src/js/filt/filt.js @@ -1,8 +1,10 @@  module.exports = (function() { +  "use strict"; +    /* -   * Generated by PEG.js 0.8.0. +   * Generated by PEG.js 0.9.0.     * -   * http://pegjs.majda.cz/ +   * http://pegjs.org/     */    function peg$subclass(child, parent) { @@ -11,21 +13,23 @@ module.exports = (function() {      child.prototype = new ctor();    } -  function SyntaxError(message, expected, found, offset, line, column) { +  function peg$SyntaxError(message, expected, found, location) {      this.message  = message;      this.expected = expected;      this.found    = found; -    this.offset   = offset; -    this.line     = line; -    this.column   = column; - +    this.location = location;      this.name     = "SyntaxError"; + +    if (typeof Error.captureStackTrace === "function") { +      Error.captureStackTrace(this, peg$SyntaxError); +    }    } -  peg$subclass(SyntaxError, Error); +  peg$subclass(peg$SyntaxError, Error); -  function parse(input) { +  function peg$parse(input) {      var options = arguments.length > 1 ? arguments[1] : {}, +        parser  = this,          peg$FAILED = {}, @@ -33,117 +37,111 @@ module.exports = (function() {          peg$startRuleFunction  = peg$parsestart,          peg$c0 = { type: "other", description: "filter expression" }, -        peg$c1 = peg$FAILED, -        peg$c2 = function(orExpr) { return orExpr; }, -        peg$c3 = [], -        peg$c4 = function() {return trueFilter; }, -        peg$c5 = { type: "other", description: "whitespace" }, -        peg$c6 = /^[ \t\n\r]/, -        peg$c7 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" }, -        peg$c8 = { type: "other", description: "control character" }, -        peg$c9 = /^[|&!()~"]/, -        peg$c10 = { type: "class", value: "[|&!()~\"]", description: "[|&!()~\"]" }, -        peg$c11 = { type: "other", description: "optional whitespace" }, -        peg$c12 = "|", -        peg$c13 = { type: "literal", value: "|", description: "\"|\"" }, -        peg$c14 = function(first, second) { return or(first, second); }, -        peg$c15 = "&", -        peg$c16 = { type: "literal", value: "&", description: "\"&\"" }, -        peg$c17 = function(first, second) { return and(first, second); }, -        peg$c18 = "!", -        peg$c19 = { type: "literal", value: "!", description: "\"!\"" }, -        peg$c20 = function(expr) { return not(expr); }, -        peg$c21 = "(", -        peg$c22 = { type: "literal", value: "(", description: "\"(\"" }, -        peg$c23 = ")", -        peg$c24 = { type: "literal", value: ")", description: "\")\"" }, -        peg$c25 = function(expr) { return binding(expr); }, -        peg$c26 = "~a", -        peg$c27 = { type: "literal", value: "~a", description: "\"~a\"" }, -        peg$c28 = function() { return assetFilter; }, -        peg$c29 = "~e", -        peg$c30 = { type: "literal", value: "~e", description: "\"~e\"" }, -        peg$c31 = function() { return errorFilter; }, -        peg$c32 = "~q", -        peg$c33 = { type: "literal", value: "~q", description: "\"~q\"" }, -        peg$c34 = function() { return noResponseFilter; }, -        peg$c35 = "~s", -        peg$c36 = { type: "literal", value: "~s", description: "\"~s\"" }, -        peg$c37 = function() { return responseFilter; }, -        peg$c38 = "true", -        peg$c39 = { type: "literal", value: "true", description: "\"true\"" }, -        peg$c40 = function() { return trueFilter; }, -        peg$c41 = "false", -        peg$c42 = { type: "literal", value: "false", description: "\"false\"" }, -        peg$c43 = function() { return falseFilter; }, -        peg$c44 = "~c", -        peg$c45 = { type: "literal", value: "~c", description: "\"~c\"" }, -        peg$c46 = function(s) { return responseCode(s); }, -        peg$c47 = "~d", -        peg$c48 = { type: "literal", value: "~d", description: "\"~d\"" }, -        peg$c49 = function(s) { return domain(s); }, -        peg$c50 = "~h", -        peg$c51 = { type: "literal", value: "~h", description: "\"~h\"" }, -        peg$c52 = function(s) { return header(s); }, -        peg$c53 = "~hq", -        peg$c54 = { type: "literal", value: "~hq", description: "\"~hq\"" }, -        peg$c55 = function(s) { return requestHeader(s); }, -        peg$c56 = "~hs", -        peg$c57 = { type: "literal", value: "~hs", description: "\"~hs\"" }, -        peg$c58 = function(s) { return responseHeader(s); }, -        peg$c59 = "~m", -        peg$c60 = { type: "literal", value: "~m", description: "\"~m\"" }, -        peg$c61 = function(s) { return method(s); }, -        peg$c62 = "~t", -        peg$c63 = { type: "literal", value: "~t", description: "\"~t\"" }, -        peg$c64 = function(s) { return contentType(s); }, -        peg$c65 = "~tq", -        peg$c66 = { type: "literal", value: "~tq", description: "\"~tq\"" }, -        peg$c67 = function(s) { return requestContentType(s); }, -        peg$c68 = "~ts", -        peg$c69 = { type: "literal", value: "~ts", description: "\"~ts\"" }, -        peg$c70 = function(s) { return responseContentType(s); }, -        peg$c71 = "~u", -        peg$c72 = { type: "literal", value: "~u", description: "\"~u\"" }, -        peg$c73 = function(s) { return url(s); }, -        peg$c74 = { type: "other", description: "integer" }, -        peg$c75 = null, -        peg$c76 = /^['"]/, -        peg$c77 = { type: "class", value: "['\"]", description: "['\"]" }, -        peg$c78 = /^[0-9]/, -        peg$c79 = { type: "class", value: "[0-9]", description: "[0-9]" }, -        peg$c80 = function(digits) { return parseInt(digits.join(""), 10); }, -        peg$c81 = { type: "other", description: "string" }, -        peg$c82 = "\"", -        peg$c83 = { type: "literal", value: "\"", description: "\"\\\"\"" }, -        peg$c84 = function(chars) { return chars.join(""); }, -        peg$c85 = "'", -        peg$c86 = { type: "literal", value: "'", description: "\"'\"" }, -        peg$c87 = void 0, -        peg$c88 = /^["\\]/, -        peg$c89 = { type: "class", value: "[\"\\\\]", description: "[\"\\\\]" }, -        peg$c90 = { type: "any", description: "any character" }, -        peg$c91 = function(char) { return char; }, -        peg$c92 = "\\", -        peg$c93 = { type: "literal", value: "\\", description: "\"\\\\\"" }, -        peg$c94 = /^['\\]/, -        peg$c95 = { type: "class", value: "['\\\\]", description: "['\\\\]" }, -        peg$c96 = /^['"\\]/, -        peg$c97 = { type: "class", value: "['\"\\\\]", description: "['\"\\\\]" }, -        peg$c98 = "n", -        peg$c99 = { type: "literal", value: "n", description: "\"n\"" }, -        peg$c100 = function() { return "\n"; }, -        peg$c101 = "r", -        peg$c102 = { type: "literal", value: "r", description: "\"r\"" }, -        peg$c103 = function() { return "\r"; }, -        peg$c104 = "t", -        peg$c105 = { type: "literal", value: "t", description: "\"t\"" }, -        peg$c106 = function() { return "\t"; }, +        peg$c1 = function(orExpr) { return orExpr; }, +        peg$c2 = { type: "other", description: "whitespace" }, +        peg$c3 = /^[ \t\n\r]/, +        peg$c4 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" }, +        peg$c5 = { type: "other", description: "control character" }, +        peg$c6 = /^[|&!()~"]/, +        peg$c7 = { type: "class", value: "[|&!()~\"]", description: "[|&!()~\"]" }, +        peg$c8 = { type: "other", description: "optional whitespace" }, +        peg$c9 = "|", +        peg$c10 = { type: "literal", value: "|", description: "\"|\"" }, +        peg$c11 = function(first, second) { return or(first, second); }, +        peg$c12 = "&", +        peg$c13 = { type: "literal", value: "&", description: "\"&\"" }, +        peg$c14 = function(first, second) { return and(first, second); }, +        peg$c15 = "!", +        peg$c16 = { type: "literal", value: "!", description: "\"!\"" }, +        peg$c17 = function(expr) { return not(expr); }, +        peg$c18 = "(", +        peg$c19 = { type: "literal", value: "(", description: "\"(\"" }, +        peg$c20 = ")", +        peg$c21 = { type: "literal", value: ")", description: "\")\"" }, +        peg$c22 = function(expr) { return binding(expr); }, +        peg$c23 = "~a", +        peg$c24 = { type: "literal", value: "~a", description: "\"~a\"" }, +        peg$c25 = function() { return assetFilter; }, +        peg$c26 = "~e", +        peg$c27 = { type: "literal", value: "~e", description: "\"~e\"" }, +        peg$c28 = function() { return errorFilter; }, +        peg$c29 = "~q", +        peg$c30 = { type: "literal", value: "~q", description: "\"~q\"" }, +        peg$c31 = function() { return noResponseFilter; }, +        peg$c32 = "~s", +        peg$c33 = { type: "literal", value: "~s", description: "\"~s\"" }, +        peg$c34 = function() { return responseFilter; }, +        peg$c35 = "true", +        peg$c36 = { type: "literal", value: "true", description: "\"true\"" }, +        peg$c37 = function() { return trueFilter; }, +        peg$c38 = "false", +        peg$c39 = { type: "literal", value: "false", description: "\"false\"" }, +        peg$c40 = function() { return falseFilter; }, +        peg$c41 = "~c", +        peg$c42 = { type: "literal", value: "~c", description: "\"~c\"" }, +        peg$c43 = function(s) { return responseCode(s); }, +        peg$c44 = "~d", +        peg$c45 = { type: "literal", value: "~d", description: "\"~d\"" }, +        peg$c46 = function(s) { return domain(s); }, +        peg$c47 = "~h", +        peg$c48 = { type: "literal", value: "~h", description: "\"~h\"" }, +        peg$c49 = function(s) { return header(s); }, +        peg$c50 = "~hq", +        peg$c51 = { type: "literal", value: "~hq", description: "\"~hq\"" }, +        peg$c52 = function(s) { return requestHeader(s); }, +        peg$c53 = "~hs", +        peg$c54 = { type: "literal", value: "~hs", description: "\"~hs\"" }, +        peg$c55 = function(s) { return responseHeader(s); }, +        peg$c56 = "~m", +        peg$c57 = { type: "literal", value: "~m", description: "\"~m\"" }, +        peg$c58 = function(s) { return method(s); }, +        peg$c59 = "~t", +        peg$c60 = { type: "literal", value: "~t", description: "\"~t\"" }, +        peg$c61 = function(s) { return contentType(s); }, +        peg$c62 = "~tq", +        peg$c63 = { type: "literal", value: "~tq", description: "\"~tq\"" }, +        peg$c64 = function(s) { return requestContentType(s); }, +        peg$c65 = "~ts", +        peg$c66 = { type: "literal", value: "~ts", description: "\"~ts\"" }, +        peg$c67 = function(s) { return responseContentType(s); }, +        peg$c68 = "~u", +        peg$c69 = { type: "literal", value: "~u", description: "\"~u\"" }, +        peg$c70 = function(s) { return url(s); }, +        peg$c71 = { type: "other", description: "integer" }, +        peg$c72 = /^['"]/, +        peg$c73 = { type: "class", value: "['\"]", description: "['\"]" }, +        peg$c74 = /^[0-9]/, +        peg$c75 = { type: "class", value: "[0-9]", description: "[0-9]" }, +        peg$c76 = function(digits) { return parseInt(digits.join(""), 10); }, +        peg$c77 = { type: "other", description: "string" }, +        peg$c78 = "\"", +        peg$c79 = { type: "literal", value: "\"", description: "\"\\\"\"" }, +        peg$c80 = function(chars) { return chars.join(""); }, +        peg$c81 = "'", +        peg$c82 = { type: "literal", value: "'", description: "\"'\"" }, +        peg$c83 = /^["\\]/, +        peg$c84 = { type: "class", value: "[\"\\\\]", description: "[\"\\\\]" }, +        peg$c85 = { type: "any", description: "any character" }, +        peg$c86 = function(char) { return char; }, +        peg$c87 = "\\", +        peg$c88 = { type: "literal", value: "\\", description: "\"\\\\\"" }, +        peg$c89 = /^['\\]/, +        peg$c90 = { type: "class", value: "['\\\\]", description: "['\\\\]" }, +        peg$c91 = /^['"\\]/, +        peg$c92 = { type: "class", value: "['\"\\\\]", description: "['\"\\\\]" }, +        peg$c93 = "n", +        peg$c94 = { type: "literal", value: "n", description: "\"n\"" }, +        peg$c95 = function() { return "\n"; }, +        peg$c96 = "r", +        peg$c97 = { type: "literal", value: "r", description: "\"r\"" }, +        peg$c98 = function() { return "\r"; }, +        peg$c99 = "t", +        peg$c100 = { type: "literal", value: "t", description: "\"t\"" }, +        peg$c101 = function() { return "\t"; },          peg$currPos          = 0, -        peg$reportedPos      = 0, -        peg$cachedPos        = 0, -        peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, +        peg$savedPos         = 0, +        peg$posDetailsCache  = [{ line: 1, column: 1, seenCR: false }],          peg$maxFailPos       = 0,          peg$maxFailExpected  = [],          peg$silentFails      = 0, @@ -159,38 +157,51 @@ module.exports = (function() {      }      function text() { -      return input.substring(peg$reportedPos, peg$currPos); +      return input.substring(peg$savedPos, peg$currPos);      } -    function offset() { -      return peg$reportedPos; -    } - -    function line() { -      return peg$computePosDetails(peg$reportedPos).line; -    } - -    function column() { -      return peg$computePosDetails(peg$reportedPos).column; +    function location() { +      return peg$computeLocation(peg$savedPos, peg$currPos);      }      function expected(description) {        throw peg$buildException(          null,          [{ type: "other", description: description }], -        peg$reportedPos +        input.substring(peg$savedPos, peg$currPos), +        peg$computeLocation(peg$savedPos, peg$currPos)        );      }      function error(message) { -      throw peg$buildException(message, null, peg$reportedPos); +      throw peg$buildException( +        message, +        null, +        input.substring(peg$savedPos, peg$currPos), +        peg$computeLocation(peg$savedPos, peg$currPos) +      );      }      function peg$computePosDetails(pos) { -      function advance(details, startPos, endPos) { -        var p, ch; +      var details = peg$posDetailsCache[pos], +          p, ch; + +      if (details) { +        return details; +      } else { +        p = pos - 1; +        while (!peg$posDetailsCache[p]) { +          p--; +        } -        for (p = startPos; p < endPos; p++) { +        details = peg$posDetailsCache[p]; +        details = { +          line:   details.line, +          column: details.column, +          seenCR: details.seenCR +        }; + +        while (p < pos) {            ch = input.charAt(p);            if (ch === "\n") {              if (!details.seenCR) { details.line++; } @@ -204,19 +215,31 @@ module.exports = (function() {              details.column++;              details.seenCR = false;            } -        } -      } -      if (peg$cachedPos !== pos) { -        if (peg$cachedPos > pos) { -          peg$cachedPos = 0; -          peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; +          p++;          } -        advance(peg$cachedPosDetails, peg$cachedPos, pos); -        peg$cachedPos = pos; + +        peg$posDetailsCache[pos] = details; +        return details;        } +    } -      return peg$cachedPosDetails; +    function peg$computeLocation(startPos, endPos) { +      var startPosDetails = peg$computePosDetails(startPos), +          endPosDetails   = peg$computePosDetails(endPos); + +      return { +        start: { +          offset: startPos, +          line:   startPosDetails.line, +          column: startPosDetails.column +        }, +        end: { +          offset: endPos, +          line:   endPosDetails.line, +          column: endPosDetails.column +        } +      };      }      function peg$fail(expected) { @@ -230,7 +253,7 @@ module.exports = (function() {        peg$maxFailExpected.push(expected);      } -    function peg$buildException(message, expected, pos) { +    function peg$buildException(message, expected, found, location) {        function cleanupExpected(expected) {          var i = 1; @@ -267,8 +290,8 @@ module.exports = (function() {              .replace(/\r/g,   '\\r')              .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); })              .replace(/[\x10-\x1F\x80-\xFF]/g,    function(ch) { return '\\x'  + hex(ch); }) -            .replace(/[\u0180-\u0FFF]/g,         function(ch) { return '\\u0' + hex(ch); }) -            .replace(/[\u1080-\uFFFF]/g,         function(ch) { return '\\u'  + hex(ch); }); +            .replace(/[\u0100-\u0FFF]/g,         function(ch) { return '\\u0' + hex(ch); }) +            .replace(/[\u1000-\uFFFF]/g,         function(ch) { return '\\u'  + hex(ch); });          }          var expectedDescs = new Array(expected.length), @@ -289,20 +312,15 @@ module.exports = (function() {          return "Expected " + expectedDesc + " but " + foundDesc + " found.";        } -      var posDetails = peg$computePosDetails(pos), -          found      = pos < input.length ? input.charAt(pos) : null; -        if (expected !== null) {          cleanupExpected(expected);        } -      return new SyntaxError( +      return new peg$SyntaxError(          message !== null ? message : buildMessage(expected, found),          expected,          found, -        pos, -        posDetails.line, -        posDetails.column +        location        );      } @@ -317,29 +335,20 @@ module.exports = (function() {          if (s2 !== peg$FAILED) {            s3 = peg$parse__();            if (s3 !== peg$FAILED) { -            peg$reportedPos = s0; -            s1 = peg$c2(s2); +            peg$savedPos = s0; +            s1 = peg$c1(s2);              s0 = s1;            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } else {          peg$currPos = s0; -        s0 = peg$c1; -      } -      if (s0 === peg$FAILED) { -        s0 = peg$currPos; -        s1 = []; -        if (s1 !== peg$FAILED) { -          peg$reportedPos = s0; -          s1 = peg$c4(); -        } -        s0 = s1; +        s0 = peg$FAILED;        }        peg$silentFails--;        if (s0 === peg$FAILED) { @@ -354,17 +363,17 @@ module.exports = (function() {        var s0, s1;        peg$silentFails++; -      if (peg$c6.test(input.charAt(peg$currPos))) { +      if (peg$c3.test(input.charAt(peg$currPos))) {          s0 = input.charAt(peg$currPos);          peg$currPos++;        } else {          s0 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c7); } +        if (peg$silentFails === 0) { peg$fail(peg$c4); }        }        peg$silentFails--;        if (s0 === peg$FAILED) {          s1 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c5); } +        if (peg$silentFails === 0) { peg$fail(peg$c2); }        }        return s0; @@ -374,17 +383,17 @@ module.exports = (function() {        var s0, s1;        peg$silentFails++; -      if (peg$c9.test(input.charAt(peg$currPos))) { +      if (peg$c6.test(input.charAt(peg$currPos))) {          s0 = input.charAt(peg$currPos);          peg$currPos++;        } else {          s0 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c10); } +        if (peg$silentFails === 0) { peg$fail(peg$c7); }        }        peg$silentFails--;        if (s0 === peg$FAILED) {          s1 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c8); } +        if (peg$silentFails === 0) { peg$fail(peg$c5); }        }        return s0; @@ -403,7 +412,7 @@ module.exports = (function() {        peg$silentFails--;        if (s0 === peg$FAILED) {          s1 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c11); } +        if (peg$silentFails === 0) { peg$fail(peg$c8); }        }        return s0; @@ -418,39 +427,39 @@ module.exports = (function() {          s2 = peg$parse__();          if (s2 !== peg$FAILED) {            if (input.charCodeAt(peg$currPos) === 124) { -            s3 = peg$c12; +            s3 = peg$c9;              peg$currPos++;            } else {              s3 = peg$FAILED; -            if (peg$silentFails === 0) { peg$fail(peg$c13); } +            if (peg$silentFails === 0) { peg$fail(peg$c10); }            }            if (s3 !== peg$FAILED) {              s4 = peg$parse__();              if (s4 !== peg$FAILED) {                s5 = peg$parseOrExpr();                if (s5 !== peg$FAILED) { -                peg$reportedPos = s0; -                s1 = peg$c14(s1, s5); +                peg$savedPos = s0; +                s1 = peg$c11(s1, s5);                  s0 = s1;                } else {                  peg$currPos = s0; -                s0 = peg$c1; +                s0 = peg$FAILED;                }              } else {                peg$currPos = s0; -              s0 = peg$c1; +              s0 = peg$FAILED;              }            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } else {          peg$currPos = s0; -        s0 = peg$c1; +        s0 = peg$FAILED;        }        if (s0 === peg$FAILED) {          s0 = peg$parseAndExpr(); @@ -468,39 +477,39 @@ module.exports = (function() {          s2 = peg$parse__();          if (s2 !== peg$FAILED) {            if (input.charCodeAt(peg$currPos) === 38) { -            s3 = peg$c15; +            s3 = peg$c12;              peg$currPos++;            } else {              s3 = peg$FAILED; -            if (peg$silentFails === 0) { peg$fail(peg$c16); } +            if (peg$silentFails === 0) { peg$fail(peg$c13); }            }            if (s3 !== peg$FAILED) {              s4 = peg$parse__();              if (s4 !== peg$FAILED) {                s5 = peg$parseAndExpr();                if (s5 !== peg$FAILED) { -                peg$reportedPos = s0; -                s1 = peg$c17(s1, s5); +                peg$savedPos = s0; +                s1 = peg$c14(s1, s5);                  s0 = s1;                } else {                  peg$currPos = s0; -                s0 = peg$c1; +                s0 = peg$FAILED;                }              } else {                peg$currPos = s0; -              s0 = peg$c1; +              s0 = peg$FAILED;              }            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } else {          peg$currPos = s0; -        s0 = peg$c1; +        s0 = peg$FAILED;        }        if (s0 === peg$FAILED) {          s0 = peg$currPos; @@ -514,25 +523,25 @@ module.exports = (function() {                s3 = peg$parsews();              }            } else { -            s2 = peg$c1; +            s2 = peg$FAILED;            }            if (s2 !== peg$FAILED) {              s3 = peg$parseAndExpr();              if (s3 !== peg$FAILED) { -              peg$reportedPos = s0; -              s1 = peg$c17(s1, s3); +              peg$savedPos = s0; +              s1 = peg$c14(s1, s3);                s0 = s1;              } else {                peg$currPos = s0; -              s0 = peg$c1; +              s0 = peg$FAILED;              }            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }          if (s0 === peg$FAILED) {            s0 = peg$parseNotExpr(); @@ -547,31 +556,31 @@ module.exports = (function() {        s0 = peg$currPos;        if (input.charCodeAt(peg$currPos) === 33) { -        s1 = peg$c18; +        s1 = peg$c15;          peg$currPos++;        } else {          s1 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c19); } +        if (peg$silentFails === 0) { peg$fail(peg$c16); }        }        if (s1 !== peg$FAILED) {          s2 = peg$parse__();          if (s2 !== peg$FAILED) {            s3 = peg$parseNotExpr();            if (s3 !== peg$FAILED) { -            peg$reportedPos = s0; -            s1 = peg$c20(s3); +            peg$savedPos = s0; +            s1 = peg$c17(s3);              s0 = s1;            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } else {          peg$currPos = s0; -        s0 = peg$c1; +        s0 = peg$FAILED;        }        if (s0 === peg$FAILED) {          s0 = peg$parseBindingExpr(); @@ -585,11 +594,11 @@ module.exports = (function() {        s0 = peg$currPos;        if (input.charCodeAt(peg$currPos) === 40) { -        s1 = peg$c21; +        s1 = peg$c18;          peg$currPos++;        } else {          s1 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c22); } +        if (peg$silentFails === 0) { peg$fail(peg$c19); }        }        if (s1 !== peg$FAILED) {          s2 = peg$parse__(); @@ -599,35 +608,35 @@ module.exports = (function() {              s4 = peg$parse__();              if (s4 !== peg$FAILED) {                if (input.charCodeAt(peg$currPos) === 41) { -                s5 = peg$c23; +                s5 = peg$c20;                  peg$currPos++;                } else {                  s5 = peg$FAILED; -                if (peg$silentFails === 0) { peg$fail(peg$c24); } +                if (peg$silentFails === 0) { peg$fail(peg$c21); }                }                if (s5 !== peg$FAILED) { -                peg$reportedPos = s0; -                s1 = peg$c25(s3); +                peg$savedPos = s0; +                s1 = peg$c22(s3);                  s0 = s1;                } else {                  peg$currPos = s0; -                s0 = peg$c1; +                s0 = peg$FAILED;                }              } else {                peg$currPos = s0; -              s0 = peg$c1; +              s0 = peg$FAILED;              }            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } else {          peg$currPos = s0; -        s0 = peg$c1; +        s0 = peg$FAILED;        }        if (s0 === peg$FAILED) {          s0 = peg$parseExpr(); @@ -653,58 +662,58 @@ module.exports = (function() {        s0 = peg$parseBooleanLiteral();        if (s0 === peg$FAILED) {          s0 = peg$currPos; -        if (input.substr(peg$currPos, 2) === peg$c26) { -          s1 = peg$c26; +        if (input.substr(peg$currPos, 2) === peg$c23) { +          s1 = peg$c23;            peg$currPos += 2;          } else {            s1 = peg$FAILED; -          if (peg$silentFails === 0) { peg$fail(peg$c27); } +          if (peg$silentFails === 0) { peg$fail(peg$c24); }          }          if (s1 !== peg$FAILED) { -          peg$reportedPos = s0; -          s1 = peg$c28(); +          peg$savedPos = s0; +          s1 = peg$c25();          }          s0 = s1;          if (s0 === peg$FAILED) {            s0 = peg$currPos; -          if (input.substr(peg$currPos, 2) === peg$c29) { -            s1 = peg$c29; +          if (input.substr(peg$currPos, 2) === peg$c26) { +            s1 = peg$c26;              peg$currPos += 2;            } else {              s1 = peg$FAILED; -            if (peg$silentFails === 0) { peg$fail(peg$c30); } +            if (peg$silentFails === 0) { peg$fail(peg$c27); }            }            if (s1 !== peg$FAILED) { -            peg$reportedPos = s0; -            s1 = peg$c31(); +            peg$savedPos = s0; +            s1 = peg$c28();            }            s0 = s1;            if (s0 === peg$FAILED) {              s0 = peg$currPos; -            if (input.substr(peg$currPos, 2) === peg$c32) { -              s1 = peg$c32; +            if (input.substr(peg$currPos, 2) === peg$c29) { +              s1 = peg$c29;                peg$currPos += 2;              } else {                s1 = peg$FAILED; -              if (peg$silentFails === 0) { peg$fail(peg$c33); } +              if (peg$silentFails === 0) { peg$fail(peg$c30); }              }              if (s1 !== peg$FAILED) { -              peg$reportedPos = s0; -              s1 = peg$c34(); +              peg$savedPos = s0; +              s1 = peg$c31();              }              s0 = s1;              if (s0 === peg$FAILED) {                s0 = peg$currPos; -              if (input.substr(peg$currPos, 2) === peg$c35) { -                s1 = peg$c35; +              if (input.substr(peg$currPos, 2) === peg$c32) { +                s1 = peg$c32;                  peg$currPos += 2;                } else {                  s1 = peg$FAILED; -                if (peg$silentFails === 0) { peg$fail(peg$c36); } +                if (peg$silentFails === 0) { peg$fail(peg$c33); }                }                if (s1 !== peg$FAILED) { -                peg$reportedPos = s0; -                s1 = peg$c37(); +                peg$savedPos = s0; +                s1 = peg$c34();                }                s0 = s1;              } @@ -719,30 +728,30 @@ module.exports = (function() {        var s0, s1;        s0 = peg$currPos; -      if (input.substr(peg$currPos, 4) === peg$c38) { -        s1 = peg$c38; +      if (input.substr(peg$currPos, 4) === peg$c35) { +        s1 = peg$c35;          peg$currPos += 4;        } else {          s1 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c39); } +        if (peg$silentFails === 0) { peg$fail(peg$c36); }        }        if (s1 !== peg$FAILED) { -        peg$reportedPos = s0; -        s1 = peg$c40(); +        peg$savedPos = s0; +        s1 = peg$c37();        }        s0 = s1;        if (s0 === peg$FAILED) {          s0 = peg$currPos; -        if (input.substr(peg$currPos, 5) === peg$c41) { -          s1 = peg$c41; +        if (input.substr(peg$currPos, 5) === peg$c38) { +          s1 = peg$c38;            peg$currPos += 5;          } else {            s1 = peg$FAILED; -          if (peg$silentFails === 0) { peg$fail(peg$c42); } +          if (peg$silentFails === 0) { peg$fail(peg$c39); }          }          if (s1 !== peg$FAILED) { -          peg$reportedPos = s0; -          s1 = peg$c43(); +          peg$savedPos = s0; +          s1 = peg$c40();          }          s0 = s1;        } @@ -754,12 +763,12 @@ module.exports = (function() {        var s0, s1, s2, s3;        s0 = peg$currPos; -      if (input.substr(peg$currPos, 2) === peg$c44) { -        s1 = peg$c44; +      if (input.substr(peg$currPos, 2) === peg$c41) { +        s1 = peg$c41;          peg$currPos += 2;        } else {          s1 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c45); } +        if (peg$silentFails === 0) { peg$fail(peg$c42); }        }        if (s1 !== peg$FAILED) {          s2 = []; @@ -770,34 +779,34 @@ module.exports = (function() {              s3 = peg$parsews();            }          } else { -          s2 = peg$c1; +          s2 = peg$FAILED;          }          if (s2 !== peg$FAILED) {            s3 = peg$parseIntegerLiteral();            if (s3 !== peg$FAILED) { -            peg$reportedPos = s0; -            s1 = peg$c46(s3); +            peg$savedPos = s0; +            s1 = peg$c43(s3);              s0 = s1;            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } else {          peg$currPos = s0; -        s0 = peg$c1; +        s0 = peg$FAILED;        }        if (s0 === peg$FAILED) {          s0 = peg$currPos; -        if (input.substr(peg$currPos, 2) === peg$c47) { -          s1 = peg$c47; +        if (input.substr(peg$currPos, 2) === peg$c44) { +          s1 = peg$c44;            peg$currPos += 2;          } else {            s1 = peg$FAILED; -          if (peg$silentFails === 0) { peg$fail(peg$c48); } +          if (peg$silentFails === 0) { peg$fail(peg$c45); }          }          if (s1 !== peg$FAILED) {            s2 = []; @@ -808,34 +817,34 @@ module.exports = (function() {                s3 = peg$parsews();              }            } else { -            s2 = peg$c1; +            s2 = peg$FAILED;            }            if (s2 !== peg$FAILED) {              s3 = peg$parseStringLiteral();              if (s3 !== peg$FAILED) { -              peg$reportedPos = s0; -              s1 = peg$c49(s3); +              peg$savedPos = s0; +              s1 = peg$c46(s3);                s0 = s1;              } else {                peg$currPos = s0; -              s0 = peg$c1; +              s0 = peg$FAILED;              }            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }          if (s0 === peg$FAILED) {            s0 = peg$currPos; -          if (input.substr(peg$currPos, 2) === peg$c50) { -            s1 = peg$c50; +          if (input.substr(peg$currPos, 2) === peg$c47) { +            s1 = peg$c47;              peg$currPos += 2;            } else {              s1 = peg$FAILED; -            if (peg$silentFails === 0) { peg$fail(peg$c51); } +            if (peg$silentFails === 0) { peg$fail(peg$c48); }            }            if (s1 !== peg$FAILED) {              s2 = []; @@ -846,34 +855,34 @@ module.exports = (function() {                  s3 = peg$parsews();                }              } else { -              s2 = peg$c1; +              s2 = peg$FAILED;              }              if (s2 !== peg$FAILED) {                s3 = peg$parseStringLiteral();                if (s3 !== peg$FAILED) { -                peg$reportedPos = s0; -                s1 = peg$c52(s3); +                peg$savedPos = s0; +                s1 = peg$c49(s3);                  s0 = s1;                } else {                  peg$currPos = s0; -                s0 = peg$c1; +                s0 = peg$FAILED;                }              } else {                peg$currPos = s0; -              s0 = peg$c1; +              s0 = peg$FAILED;              }            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }            if (s0 === peg$FAILED) {              s0 = peg$currPos; -            if (input.substr(peg$currPos, 3) === peg$c53) { -              s1 = peg$c53; +            if (input.substr(peg$currPos, 3) === peg$c50) { +              s1 = peg$c50;                peg$currPos += 3;              } else {                s1 = peg$FAILED; -              if (peg$silentFails === 0) { peg$fail(peg$c54); } +              if (peg$silentFails === 0) { peg$fail(peg$c51); }              }              if (s1 !== peg$FAILED) {                s2 = []; @@ -884,34 +893,34 @@ module.exports = (function() {                    s3 = peg$parsews();                  }                } else { -                s2 = peg$c1; +                s2 = peg$FAILED;                }                if (s2 !== peg$FAILED) {                  s3 = peg$parseStringLiteral();                  if (s3 !== peg$FAILED) { -                  peg$reportedPos = s0; -                  s1 = peg$c55(s3); +                  peg$savedPos = s0; +                  s1 = peg$c52(s3);                    s0 = s1;                  } else {                    peg$currPos = s0; -                  s0 = peg$c1; +                  s0 = peg$FAILED;                  }                } else {                  peg$currPos = s0; -                s0 = peg$c1; +                s0 = peg$FAILED;                }              } else {                peg$currPos = s0; -              s0 = peg$c1; +              s0 = peg$FAILED;              }              if (s0 === peg$FAILED) {                s0 = peg$currPos; -              if (input.substr(peg$currPos, 3) === peg$c56) { -                s1 = peg$c56; +              if (input.substr(peg$currPos, 3) === peg$c53) { +                s1 = peg$c53;                  peg$currPos += 3;                } else {                  s1 = peg$FAILED; -                if (peg$silentFails === 0) { peg$fail(peg$c57); } +                if (peg$silentFails === 0) { peg$fail(peg$c54); }                }                if (s1 !== peg$FAILED) {                  s2 = []; @@ -922,34 +931,34 @@ module.exports = (function() {                      s3 = peg$parsews();                    }                  } else { -                  s2 = peg$c1; +                  s2 = peg$FAILED;                  }                  if (s2 !== peg$FAILED) {                    s3 = peg$parseStringLiteral();                    if (s3 !== peg$FAILED) { -                    peg$reportedPos = s0; -                    s1 = peg$c58(s3); +                    peg$savedPos = s0; +                    s1 = peg$c55(s3);                      s0 = s1;                    } else {                      peg$currPos = s0; -                    s0 = peg$c1; +                    s0 = peg$FAILED;                    }                  } else {                    peg$currPos = s0; -                  s0 = peg$c1; +                  s0 = peg$FAILED;                  }                } else {                  peg$currPos = s0; -                s0 = peg$c1; +                s0 = peg$FAILED;                }                if (s0 === peg$FAILED) {                  s0 = peg$currPos; -                if (input.substr(peg$currPos, 2) === peg$c59) { -                  s1 = peg$c59; +                if (input.substr(peg$currPos, 2) === peg$c56) { +                  s1 = peg$c56;                    peg$currPos += 2;                  } else {                    s1 = peg$FAILED; -                  if (peg$silentFails === 0) { peg$fail(peg$c60); } +                  if (peg$silentFails === 0) { peg$fail(peg$c57); }                  }                  if (s1 !== peg$FAILED) {                    s2 = []; @@ -960,34 +969,34 @@ module.exports = (function() {                        s3 = peg$parsews();                      }                    } else { -                    s2 = peg$c1; +                    s2 = peg$FAILED;                    }                    if (s2 !== peg$FAILED) {                      s3 = peg$parseStringLiteral();                      if (s3 !== peg$FAILED) { -                      peg$reportedPos = s0; -                      s1 = peg$c61(s3); +                      peg$savedPos = s0; +                      s1 = peg$c58(s3);                        s0 = s1;                      } else {                        peg$currPos = s0; -                      s0 = peg$c1; +                      s0 = peg$FAILED;                      }                    } else {                      peg$currPos = s0; -                    s0 = peg$c1; +                    s0 = peg$FAILED;                    }                  } else {                    peg$currPos = s0; -                  s0 = peg$c1; +                  s0 = peg$FAILED;                  }                  if (s0 === peg$FAILED) {                    s0 = peg$currPos; -                  if (input.substr(peg$currPos, 2) === peg$c62) { -                    s1 = peg$c62; +                  if (input.substr(peg$currPos, 2) === peg$c59) { +                    s1 = peg$c59;                      peg$currPos += 2;                    } else {                      s1 = peg$FAILED; -                    if (peg$silentFails === 0) { peg$fail(peg$c63); } +                    if (peg$silentFails === 0) { peg$fail(peg$c60); }                    }                    if (s1 !== peg$FAILED) {                      s2 = []; @@ -998,34 +1007,34 @@ module.exports = (function() {                          s3 = peg$parsews();                        }                      } else { -                      s2 = peg$c1; +                      s2 = peg$FAILED;                      }                      if (s2 !== peg$FAILED) {                        s3 = peg$parseStringLiteral();                        if (s3 !== peg$FAILED) { -                        peg$reportedPos = s0; -                        s1 = peg$c64(s3); +                        peg$savedPos = s0; +                        s1 = peg$c61(s3);                          s0 = s1;                        } else {                          peg$currPos = s0; -                        s0 = peg$c1; +                        s0 = peg$FAILED;                        }                      } else {                        peg$currPos = s0; -                      s0 = peg$c1; +                      s0 = peg$FAILED;                      }                    } else {                      peg$currPos = s0; -                    s0 = peg$c1; +                    s0 = peg$FAILED;                    }                    if (s0 === peg$FAILED) {                      s0 = peg$currPos; -                    if (input.substr(peg$currPos, 3) === peg$c65) { -                      s1 = peg$c65; +                    if (input.substr(peg$currPos, 3) === peg$c62) { +                      s1 = peg$c62;                        peg$currPos += 3;                      } else {                        s1 = peg$FAILED; -                      if (peg$silentFails === 0) { peg$fail(peg$c66); } +                      if (peg$silentFails === 0) { peg$fail(peg$c63); }                      }                      if (s1 !== peg$FAILED) {                        s2 = []; @@ -1036,34 +1045,34 @@ module.exports = (function() {                            s3 = peg$parsews();                          }                        } else { -                        s2 = peg$c1; +                        s2 = peg$FAILED;                        }                        if (s2 !== peg$FAILED) {                          s3 = peg$parseStringLiteral();                          if (s3 !== peg$FAILED) { -                          peg$reportedPos = s0; -                          s1 = peg$c67(s3); +                          peg$savedPos = s0; +                          s1 = peg$c64(s3);                            s0 = s1;                          } else {                            peg$currPos = s0; -                          s0 = peg$c1; +                          s0 = peg$FAILED;                          }                        } else {                          peg$currPos = s0; -                        s0 = peg$c1; +                        s0 = peg$FAILED;                        }                      } else {                        peg$currPos = s0; -                      s0 = peg$c1; +                      s0 = peg$FAILED;                      }                      if (s0 === peg$FAILED) {                        s0 = peg$currPos; -                      if (input.substr(peg$currPos, 3) === peg$c68) { -                        s1 = peg$c68; +                      if (input.substr(peg$currPos, 3) === peg$c65) { +                        s1 = peg$c65;                          peg$currPos += 3;                        } else {                          s1 = peg$FAILED; -                        if (peg$silentFails === 0) { peg$fail(peg$c69); } +                        if (peg$silentFails === 0) { peg$fail(peg$c66); }                        }                        if (s1 !== peg$FAILED) {                          s2 = []; @@ -1074,34 +1083,34 @@ module.exports = (function() {                              s3 = peg$parsews();                            }                          } else { -                          s2 = peg$c1; +                          s2 = peg$FAILED;                          }                          if (s2 !== peg$FAILED) {                            s3 = peg$parseStringLiteral();                            if (s3 !== peg$FAILED) { -                            peg$reportedPos = s0; -                            s1 = peg$c70(s3); +                            peg$savedPos = s0; +                            s1 = peg$c67(s3);                              s0 = s1;                            } else {                              peg$currPos = s0; -                            s0 = peg$c1; +                            s0 = peg$FAILED;                            }                          } else {                            peg$currPos = s0; -                          s0 = peg$c1; +                          s0 = peg$FAILED;                          }                        } else {                          peg$currPos = s0; -                        s0 = peg$c1; +                        s0 = peg$FAILED;                        }                        if (s0 === peg$FAILED) {                          s0 = peg$currPos; -                        if (input.substr(peg$currPos, 2) === peg$c71) { -                          s1 = peg$c71; +                        if (input.substr(peg$currPos, 2) === peg$c68) { +                          s1 = peg$c68;                            peg$currPos += 2;                          } else {                            s1 = peg$FAILED; -                          if (peg$silentFails === 0) { peg$fail(peg$c72); } +                          if (peg$silentFails === 0) { peg$fail(peg$c69); }                          }                          if (s1 !== peg$FAILED) {                            s2 = []; @@ -1112,32 +1121,32 @@ module.exports = (function() {                                s3 = peg$parsews();                              }                            } else { -                            s2 = peg$c1; +                            s2 = peg$FAILED;                            }                            if (s2 !== peg$FAILED) {                              s3 = peg$parseStringLiteral();                              if (s3 !== peg$FAILED) { -                              peg$reportedPos = s0; -                              s1 = peg$c73(s3); +                              peg$savedPos = s0; +                              s1 = peg$c70(s3);                                s0 = s1;                              } else {                                peg$currPos = s0; -                              s0 = peg$c1; +                              s0 = peg$FAILED;                              }                            } else {                              peg$currPos = s0; -                            s0 = peg$c1; +                            s0 = peg$FAILED;                            }                          } else {                            peg$currPos = s0; -                          s0 = peg$c1; +                          s0 = peg$FAILED;                          }                          if (s0 === peg$FAILED) {                            s0 = peg$currPos;                            s1 = peg$parseStringLiteral();                            if (s1 !== peg$FAILED) { -                            peg$reportedPos = s0; -                            s1 = peg$c73(s1); +                            peg$savedPos = s0; +                            s1 = peg$c70(s1);                            }                            s0 = s1;                          } @@ -1159,70 +1168,70 @@ module.exports = (function() {        peg$silentFails++;        s0 = peg$currPos; -      if (peg$c76.test(input.charAt(peg$currPos))) { +      if (peg$c72.test(input.charAt(peg$currPos))) {          s1 = input.charAt(peg$currPos);          peg$currPos++;        } else {          s1 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c77); } +        if (peg$silentFails === 0) { peg$fail(peg$c73); }        }        if (s1 === peg$FAILED) { -        s1 = peg$c75; +        s1 = null;        }        if (s1 !== peg$FAILED) {          s2 = []; -        if (peg$c78.test(input.charAt(peg$currPos))) { +        if (peg$c74.test(input.charAt(peg$currPos))) {            s3 = input.charAt(peg$currPos);            peg$currPos++;          } else {            s3 = peg$FAILED; -          if (peg$silentFails === 0) { peg$fail(peg$c79); } +          if (peg$silentFails === 0) { peg$fail(peg$c75); }          }          if (s3 !== peg$FAILED) {            while (s3 !== peg$FAILED) {              s2.push(s3); -            if (peg$c78.test(input.charAt(peg$currPos))) { +            if (peg$c74.test(input.charAt(peg$currPos))) {                s3 = input.charAt(peg$currPos);                peg$currPos++;              } else {                s3 = peg$FAILED; -              if (peg$silentFails === 0) { peg$fail(peg$c79); } +              if (peg$silentFails === 0) { peg$fail(peg$c75); }              }            }          } else { -          s2 = peg$c1; +          s2 = peg$FAILED;          }          if (s2 !== peg$FAILED) { -          if (peg$c76.test(input.charAt(peg$currPos))) { +          if (peg$c72.test(input.charAt(peg$currPos))) {              s3 = input.charAt(peg$currPos);              peg$currPos++;            } else {              s3 = peg$FAILED; -            if (peg$silentFails === 0) { peg$fail(peg$c77); } +            if (peg$silentFails === 0) { peg$fail(peg$c73); }            }            if (s3 === peg$FAILED) { -            s3 = peg$c75; +            s3 = null;            }            if (s3 !== peg$FAILED) { -            peg$reportedPos = s0; -            s1 = peg$c80(s2); +            peg$savedPos = s0; +            s1 = peg$c76(s2);              s0 = s1;            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } else {          peg$currPos = s0; -        s0 = peg$c1; +        s0 = peg$FAILED;        }        peg$silentFails--;        if (s0 === peg$FAILED) {          s1 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c74); } +        if (peg$silentFails === 0) { peg$fail(peg$c71); }        }        return s0; @@ -1234,11 +1243,11 @@ module.exports = (function() {        peg$silentFails++;        s0 = peg$currPos;        if (input.charCodeAt(peg$currPos) === 34) { -        s1 = peg$c82; +        s1 = peg$c78;          peg$currPos++;        } else {          s1 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c83); } +        if (peg$silentFails === 0) { peg$fail(peg$c79); }        }        if (s1 !== peg$FAILED) {          s2 = []; @@ -1249,36 +1258,36 @@ module.exports = (function() {          }          if (s2 !== peg$FAILED) {            if (input.charCodeAt(peg$currPos) === 34) { -            s3 = peg$c82; +            s3 = peg$c78;              peg$currPos++;            } else {              s3 = peg$FAILED; -            if (peg$silentFails === 0) { peg$fail(peg$c83); } +            if (peg$silentFails === 0) { peg$fail(peg$c79); }            }            if (s3 !== peg$FAILED) { -            peg$reportedPos = s0; -            s1 = peg$c84(s2); +            peg$savedPos = s0; +            s1 = peg$c80(s2);              s0 = s1;            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } else {          peg$currPos = s0; -        s0 = peg$c1; +        s0 = peg$FAILED;        }        if (s0 === peg$FAILED) {          s0 = peg$currPos;          if (input.charCodeAt(peg$currPos) === 39) { -          s1 = peg$c85; +          s1 = peg$c81;            peg$currPos++;          } else {            s1 = peg$FAILED; -          if (peg$silentFails === 0) { peg$fail(peg$c86); } +          if (peg$silentFails === 0) { peg$fail(peg$c82); }          }          if (s1 !== peg$FAILED) {            s2 = []; @@ -1289,27 +1298,27 @@ module.exports = (function() {            }            if (s2 !== peg$FAILED) {              if (input.charCodeAt(peg$currPos) === 39) { -              s3 = peg$c85; +              s3 = peg$c81;                peg$currPos++;              } else {                s3 = peg$FAILED; -              if (peg$silentFails === 0) { peg$fail(peg$c86); } +              if (peg$silentFails === 0) { peg$fail(peg$c82); }              }              if (s3 !== peg$FAILED) { -              peg$reportedPos = s0; -              s1 = peg$c84(s2); +              peg$savedPos = s0; +              s1 = peg$c80(s2);                s0 = s1;              } else {                peg$currPos = s0; -              s0 = peg$c1; +              s0 = peg$FAILED;              }            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }          if (s0 === peg$FAILED) {            s0 = peg$currPos; @@ -1318,10 +1327,10 @@ module.exports = (function() {            s2 = peg$parsecc();            peg$silentFails--;            if (s2 === peg$FAILED) { -            s1 = peg$c87; +            s1 = void 0;            } else {              peg$currPos = s1; -            s1 = peg$c1; +            s1 = peg$FAILED;            }            if (s1 !== peg$FAILED) {              s2 = []; @@ -1332,26 +1341,26 @@ module.exports = (function() {                  s3 = peg$parseUnquotedStringChar();                }              } else { -              s2 = peg$c1; +              s2 = peg$FAILED;              }              if (s2 !== peg$FAILED) { -              peg$reportedPos = s0; -              s1 = peg$c84(s2); +              peg$savedPos = s0; +              s1 = peg$c80(s2);                s0 = s1;              } else {                peg$currPos = s0; -              s0 = peg$c1; +              s0 = peg$FAILED;              }            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          }        }        peg$silentFails--;        if (s0 === peg$FAILED) {          s1 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c81); } +        if (peg$silentFails === 0) { peg$fail(peg$c77); }        }        return s0; @@ -1363,19 +1372,19 @@ module.exports = (function() {        s0 = peg$currPos;        s1 = peg$currPos;        peg$silentFails++; -      if (peg$c88.test(input.charAt(peg$currPos))) { +      if (peg$c83.test(input.charAt(peg$currPos))) {          s2 = input.charAt(peg$currPos);          peg$currPos++;        } else {          s2 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c89); } +        if (peg$silentFails === 0) { peg$fail(peg$c84); }        }        peg$silentFails--;        if (s2 === peg$FAILED) { -        s1 = peg$c87; +        s1 = void 0;        } else {          peg$currPos = s1; -        s1 = peg$c1; +        s1 = peg$FAILED;        }        if (s1 !== peg$FAILED) {          if (input.length > peg$currPos) { @@ -1383,42 +1392,42 @@ module.exports = (function() {            peg$currPos++;          } else {            s2 = peg$FAILED; -          if (peg$silentFails === 0) { peg$fail(peg$c90); } +          if (peg$silentFails === 0) { peg$fail(peg$c85); }          }          if (s2 !== peg$FAILED) { -          peg$reportedPos = s0; -          s1 = peg$c91(s2); +          peg$savedPos = s0; +          s1 = peg$c86(s2);            s0 = s1;          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } else {          peg$currPos = s0; -        s0 = peg$c1; +        s0 = peg$FAILED;        }        if (s0 === peg$FAILED) {          s0 = peg$currPos;          if (input.charCodeAt(peg$currPos) === 92) { -          s1 = peg$c92; +          s1 = peg$c87;            peg$currPos++;          } else {            s1 = peg$FAILED; -          if (peg$silentFails === 0) { peg$fail(peg$c93); } +          if (peg$silentFails === 0) { peg$fail(peg$c88); }          }          if (s1 !== peg$FAILED) {            s2 = peg$parseEscapeSequence();            if (s2 !== peg$FAILED) { -            peg$reportedPos = s0; -            s1 = peg$c91(s2); +            peg$savedPos = s0; +            s1 = peg$c86(s2);              s0 = s1;            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } @@ -1431,19 +1440,19 @@ module.exports = (function() {        s0 = peg$currPos;        s1 = peg$currPos;        peg$silentFails++; -      if (peg$c94.test(input.charAt(peg$currPos))) { +      if (peg$c89.test(input.charAt(peg$currPos))) {          s2 = input.charAt(peg$currPos);          peg$currPos++;        } else {          s2 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c95); } +        if (peg$silentFails === 0) { peg$fail(peg$c90); }        }        peg$silentFails--;        if (s2 === peg$FAILED) { -        s1 = peg$c87; +        s1 = void 0;        } else {          peg$currPos = s1; -        s1 = peg$c1; +        s1 = peg$FAILED;        }        if (s1 !== peg$FAILED) {          if (input.length > peg$currPos) { @@ -1451,42 +1460,42 @@ module.exports = (function() {            peg$currPos++;          } else {            s2 = peg$FAILED; -          if (peg$silentFails === 0) { peg$fail(peg$c90); } +          if (peg$silentFails === 0) { peg$fail(peg$c85); }          }          if (s2 !== peg$FAILED) { -          peg$reportedPos = s0; -          s1 = peg$c91(s2); +          peg$savedPos = s0; +          s1 = peg$c86(s2);            s0 = s1;          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } else {          peg$currPos = s0; -        s0 = peg$c1; +        s0 = peg$FAILED;        }        if (s0 === peg$FAILED) {          s0 = peg$currPos;          if (input.charCodeAt(peg$currPos) === 92) { -          s1 = peg$c92; +          s1 = peg$c87;            peg$currPos++;          } else {            s1 = peg$FAILED; -          if (peg$silentFails === 0) { peg$fail(peg$c93); } +          if (peg$silentFails === 0) { peg$fail(peg$c88); }          }          if (s1 !== peg$FAILED) {            s2 = peg$parseEscapeSequence();            if (s2 !== peg$FAILED) { -            peg$reportedPos = s0; -            s1 = peg$c91(s2); +            peg$savedPos = s0; +            s1 = peg$c86(s2);              s0 = s1;            } else {              peg$currPos = s0; -            s0 = peg$c1; +            s0 = peg$FAILED;            }          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } @@ -1502,10 +1511,10 @@ module.exports = (function() {        s2 = peg$parsews();        peg$silentFails--;        if (s2 === peg$FAILED) { -        s1 = peg$c87; +        s1 = void 0;        } else {          peg$currPos = s1; -        s1 = peg$c1; +        s1 = peg$FAILED;        }        if (s1 !== peg$FAILED) {          if (input.length > peg$currPos) { @@ -1513,19 +1522,19 @@ module.exports = (function() {            peg$currPos++;          } else {            s2 = peg$FAILED; -          if (peg$silentFails === 0) { peg$fail(peg$c90); } +          if (peg$silentFails === 0) { peg$fail(peg$c85); }          }          if (s2 !== peg$FAILED) { -          peg$reportedPos = s0; -          s1 = peg$c91(s2); +          peg$savedPos = s0; +          s1 = peg$c86(s2);            s0 = s1;          } else {            peg$currPos = s0; -          s0 = peg$c1; +          s0 = peg$FAILED;          }        } else {          peg$currPos = s0; -        s0 = peg$c1; +        s0 = peg$FAILED;        }        return s0; @@ -1534,53 +1543,53 @@ module.exports = (function() {      function peg$parseEscapeSequence() {        var s0, s1; -      if (peg$c96.test(input.charAt(peg$currPos))) { +      if (peg$c91.test(input.charAt(peg$currPos))) {          s0 = input.charAt(peg$currPos);          peg$currPos++;        } else {          s0 = peg$FAILED; -        if (peg$silentFails === 0) { peg$fail(peg$c97); } +        if (peg$silentFails === 0) { peg$fail(peg$c92); }        }        if (s0 === peg$FAILED) {          s0 = peg$currPos;          if (input.charCodeAt(peg$currPos) === 110) { -          s1 = peg$c98; +          s1 = peg$c93;            peg$currPos++;          } else {            s1 = peg$FAILED; -          if (peg$silentFails === 0) { peg$fail(peg$c99); } +          if (peg$silentFails === 0) { peg$fail(peg$c94); }          }          if (s1 !== peg$FAILED) { -          peg$reportedPos = s0; -          s1 = peg$c100(); +          peg$savedPos = s0; +          s1 = peg$c95();          }          s0 = s1;          if (s0 === peg$FAILED) {            s0 = peg$currPos;            if (input.charCodeAt(peg$currPos) === 114) { -            s1 = peg$c101; +            s1 = peg$c96;              peg$currPos++;            } else {              s1 = peg$FAILED; -            if (peg$silentFails === 0) { peg$fail(peg$c102); } +            if (peg$silentFails === 0) { peg$fail(peg$c97); }            }            if (s1 !== peg$FAILED) { -            peg$reportedPos = s0; -            s1 = peg$c103(); +            peg$savedPos = s0; +            s1 = peg$c98();            }            s0 = s1;            if (s0 === peg$FAILED) {              s0 = peg$currPos;              if (input.charCodeAt(peg$currPos) === 116) { -              s1 = peg$c104; +              s1 = peg$c99;                peg$currPos++;              } else {                s1 = peg$FAILED; -              if (peg$silentFails === 0) { peg$fail(peg$c105); } +              if (peg$silentFails === 0) { peg$fail(peg$c100); }              }              if (s1 !== peg$FAILED) { -              peg$reportedPos = s0; -              s1 = peg$c106(); +              peg$savedPos = s0; +              s1 = peg$c101();              }              s0 = s1;            } @@ -1763,12 +1772,19 @@ module.exports = (function() {          peg$fail({ type: "end", description: "end of input" });        } -      throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); +      throw peg$buildException( +        null, +        peg$maxFailExpected, +        peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, +        peg$maxFailPos < input.length +          ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) +          : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) +      );      }    }    return { -    SyntaxError: SyntaxError, -    parse:       parse +    SyntaxError: peg$SyntaxError, +    parse:       peg$parse    };  })();
\ No newline at end of file diff --git a/web/src/js/filt/filt.peg b/web/src/js/filt/filt.peg index 6f9bdac6..ccaaa072 100644 --- a/web/src/js/filt/filt.peg +++ b/web/src/js/filt/filt.peg @@ -166,7 +166,6 @@ function url(regex){  start "filter expression"    = __ orExpr:OrExpr __ { return orExpr; } -  / {return trueFilter; }  ws "whitespace" = [ \t\n\r]  cc "control character" = [|&!()~"] diff --git a/web/src/templates/index.html b/web/src/templates/index.html index 5f2c6d5e..165d7d3d 100644 --- a/web/src/templates/index.html +++ b/web/src/templates/index.html @@ -10,5 +10,6 @@      <script src="/static/app.js"></script>  </head>  <body> +<div id="mitmproxy"></div>  </body>  </html>
\ No newline at end of file | 
