Comments (9)
Yep, you're right. I realized this when I strict-moded a bunch of our core code a while back, but I never got around to finishing the job by fixing the tests and examples.
Other than the tests and examples, do you know of anything else that needs updating?
from ohm.
Other than the tests and examples, do you know of anything else that needs updating?
No. I just checked the docs, and they don't seem to use this convention.
from ohm.
Ok, good to know! I thanks for filing this.
BTW, the style I've settled on is to simply give the unused arguments sensible (if somewhat terse) names. For quotes, braces, etc., I just used open
and close
, and for keywords I use stuff like ifkw
, thenkw
, elsekw
.
from ohm.
Hi Jason and Pat,
I've been using Ohm in my class at UCLA, in strict mode. A style that I've
developed and seems to be working well for us is to name terms that I don't
care about (i.e., that I don't need to use) with names that start with an
underscore, but are more descriptive. E.g., for a rule like this:
IfExpr = if Expr then Expr else Expr
(with rules if, then, and else defined to consume their respective
keywords) I would write the following semantic action:
IfExpr: function(_if, e1, _then, e2, _else, e3) {
...
}
On Mon, Jan 25, 2016 at 8:33 AM, Patrick Dubroy [email protected]
wrote:
Yep, you're right. I realized this when I strict-moded a bunch of our core
code a while back, but I never got around to finishing the job by fixing
the tests and examples.Other than the tests and examples, do you know of anything else that needs
updating?—
Reply to this email directly or view it on GitHub
#54 (comment).
from ohm.
Seems sensible to me :)
On Mon, Jan 25, 2016 at 9:58 AM, Patrick Dubroy [email protected]
wrote:
Ok, good to know! I thanks for filing this.
BTW, the style I've settled on is to simply give the unused arguments
sensible (if somewhat terse) names. For quotes, braces, etc., I just used
open and close, and for keywords I use stuff like ifkw, thenkw, elsekw.—
Reply to this email directly or view it on GitHub
#54 (comment).
from ohm.
Re-opening as we still need to fix some of the tests (e.g. test-ohm-syntax.js).
from ohm.
There are still instances of the non-descriptive _
in a bunch of the tests, e.g., in test/test-grammar.js, test/test-semantics.js.
from ohm.
I don't think we need to eliminate all use of _
. I thought the point was to just to eliminate duplicate parameter names so that they code is compatible with strict mode. I don't see a problem with still using the _
sometimes.
from ohm.
Oh, ok. Fine by me!
On Monday, February 15, 2016, Patrick Dubroy [email protected]
wrote:
I don't think we need to eliminate all use of _. I thought the point was
to just to eliminate duplicate parameter names so that they code is
compatible with strict mode. I don't see a problem with still using the _
sometimes.—
Reply to this email directly or view it on GitHub
#54 (comment).
from ohm.
Related Issues (20)
- Type definitions for parameterized rules are inconsistent with behavior HOT 1
- Semantic action '[...]' has the wrong arity: expected 3, got 0 HOT 5
- Semantic actions for comments defined under the space rule HOT 1
- Add ability to type operation parameters & return values HOT 11
- CLI: Line endings in generated files vary across systems and platforms HOT 1
- cli.js is reading incorrect package.json file for version HOT 2
- Typescript example causes error HOT 1
- space with applySyntactic causes failure
- `toAST` incorrectly makes some nodes intermediate nodes HOT 1
- Indentation-sensitive grammar forgets consumed dedents HOT 1
- Syntax error handling? HOT 2
- Indentation-sensitive parsing: dedent not working? HOT 3
- Typescript example fails to compile HOT 1
- "Built-in Rules" section of syntax reference docs are incorrectly formatted
- No indication of stack size exceeded
- Do we get comments from ohm? HOT 6
- Idiomatic way to do partial (prefix) parses
- NPM release behind latest commit
- Partially parse grammar
- Odd behavior: Alternation fails instead of trying second alternative
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ohm.