Comments (3)
I don't know about this -- seems complicated at first glance. Do you guys have a motivating example? The one above is a bit contrived.
from ohm.
Wait @alexwarth: You don't want to functionally program in Ohm??? We could write Ohm/Ohm (instead of JS or Smalltalk). :-D
Anyway, I am happy to not pursue but have a better error message and simply make rule
a parameter:
(function() {
return new this.newGrammar("G")
.withDefaultStartRule("Start")
.define("Start", ["rule"], this.param(0))
.build();
});
(recipe for G { Start<rule> = rule }
)
from ohm.
I don't feel strongly about it, but on the other hand I could imagine some people being surprised that it doesn't work.
The best example I can come up with is something like: you write a rule that uses ListOf
, but you want it to work in both semantic and lexical contexts. So you do something like this:
myRuleImpl<listExp> = foo bar+ blah? listExp<ident, ",">
MyRule = myRuleImpl<ListOf>
myRule = myRuleImpl<listOf>
from ohm.
Related Issues (20)
- grammar name of test example does not track grammar name changes
- Ohm-JS fails to complain about (some) missing semantic actions
- 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
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.