Skip to content

Commit

Permalink
Import Lodash in Peggy code, drop window._
Browse files Browse the repository at this point in the history
  • Loading branch information
arildm committed Mar 5, 2024
1 parent c6d30eb commit 6c05267
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
5 changes: 0 additions & 5 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ require("./styles/tailwind.scss")
require("./styles/styles.scss")
require("./styles/textreader.css")

// TODO Remove from window. Still used in CQPParser.pegjs.
window._ = require("lodash")

require("components-jqueryui/ui/widget.js")
require("components-jqueryui/ui/widgets/sortable.js")
require("components-jqueryui/ui/widgets/dialog.js")
Expand Down Expand Up @@ -90,8 +87,6 @@ require("angular-filter/index.js")

require("./lib/jquery.tooltip.pack.js")



require("./scripts/components/sidebar.js")

require("./scripts/statistics.js")
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/cqp_parser/CQPParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//
// https://peggyjs.org/

import _ from "lodash";


function peg$subclass(child, parent) {
function C() { this.constructor = child; }
Expand Down Expand Up @@ -1910,10 +1912,8 @@ function peg$parse(input, options) {
return output
}

var _ = window._
var c = console


peg$result = peg$startRuleFunction();

if (options.peg$library) {
Expand Down
2 changes: 0 additions & 2 deletions app/scripts/cqp_parser/CQPParser.peggy
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
return output
}

var _ = window._
var c = console

}


Expand Down
2 changes: 1 addition & 1 deletion app/scripts/cqp_parser/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Rebuild parser:

```sh
npx peggy --format es CQPParser.pegjs
npx peggy --format es -d _:lodash CQPParser.peggy
```
2 changes: 1 addition & 1 deletion doc/frontend_devel.md
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ To rebuild JS code from the Peggy file, do:
```sh
cd app/scripts/cqp_parser
npx peggy --format es CQPParser.pegjs
npx peggy --format es -d _:lodash CQPParser.peggy
```

## Contributing with pull requests on Github
Expand Down

0 comments on commit 6c05267

Please sign in to comment.