Pedro J. Molina

Results 26 comments of Pedro J. Molina

Hi @eropple Indeed. OpenApi 3.1 is converging with JSON Schema. Reimplementing JSON schema is out of scope of this library. So yes, thinking about it and totally open to listen...

Hi! Related to this, in the plugin `ts-pegjs` we have implemented optional output typing for production rules. [Issue 11](https://github.com/metadevpro/ts-pegjs/issues/11), [PR 16](https://github.com/metadevpro/ts-pegjs/pull/16) We did it using a table of pairs `"rule-name":...

The parser is intended to be used this way, with a try/catch: ``` try { const sampleOutput = parse('my sample...'); } catch (ex: SyntaxError) { // Handle parsing error //...

Hi. I don't understand the goal and context (why) of your request. A concrete sample could help. Parsing recognizes a string as a part of a language, and optionally, construct...

[StringTemplate](http://www.stringtemplate.org/), for example, is one of the many tools you can use for such task: code-gen from ASTs.

I see your point about style conventions. However change it now would make a breaking change for its current users. I will postpone such change when doing a major refactor...

Having an AST, you can: 1. use a template Engine, f. e. [StringTemplate.org](StringTemplate.org), or 2. Use the visitor pattern to traverse the AST generating chunks per node aggrgating the result...

Hi. PEG algorithm chooses the first production if match and will not check for the second one. Just rewrite your rule as: `DateDimension / Dimension` (more specific first) due to...

I see. Didn't notice the second rule is identical to the same one, but with an optional part. The second rule is already parsing the first one, so you can...

Yes, from [docs](https://pegjs.org/documentation): you can use `& { predicate }` and `! { predicate }` forms to make rules fail depending on predicates. Just remember how PEG works: first rule...