pegjs Questions

2

Solved

I'm trying to parse a comma separated list. To simplify, I'm just using digits. These expressions would be valid: (1, 4, 3) () (4) I can think of two ways to do this and I'm wondering why exact...
Gisela asked 12/6, 2019 at 2:10

2

Solved

I'm playing around with PEG.js start = keyword keyword = a:[a-z]? {return a.join("");} Why am I getting here the error: a.join is not a function when I enter a valid string like abc?
Hostess asked 31/10, 2015 at 11:30

1

I have a private GitHub repo my-parser-generator which uses pegjs. All underlying logic is written in TypeScript, which is then compiled and fed to pegjs, which generates the final parser. Then thi...
Mesocratic asked 10/6, 2021 at 9:36

2

Solved

How do you build an AST (Abstract Syntax Tree) for left-associative operators using PEG.js? I've tried to write some code based on the information I found on the internet, but I seem to have made ...
Gerdy asked 12/6, 2014 at 0:22

1

Solved

I'm still fighting with ambiguous grammar of Qt's qmake. Now I can't find a way to describe function arguments that can contain parenthesis (e.g. regex): functionName(arg1, "arg2", ^(arg3)+$) I...
Yaakov asked 21/12, 2017 at 5:47

3

I'm trying to wrap my head around PEG by entering simple grammars into the PEG.js playground. Example 1: Input: "abcdef1234567ghijklmn8901opqrs" Desired output: ["abcdef", "1234567", "ghijklmn"...
Hawfinch asked 31/8, 2010 at 20:12

1

Solved

I'm trying to catch some text between parathesis with a semicolon in the end. Example: (in here there can be 'anything' !"#¤);); any character is possible); I've tried this: Text = "(" text:(.*...
Dwarfism asked 20/9, 2016 at 21:44

3

(Note: I've read other questions like this, but I haven't been able to figure this out). I wrote this grammar: start = call ident = [a-z]+ spaces = [ ]+ call = f:ident spaces g:(call / ident) {...
Wrapping asked 19/11, 2012 at 15:1

3

Solved

Trying to test a project using PegJS and requirejs. I have a couple of source files, implemented as AMD module (define) which loads through the require API. Below the directory structure: js/ so...
Balsamic asked 24/11, 2015 at 13:46

2

Solved

How would one allow for single and double quotes, as well as unicode characters inside of a PEG.js grammar definition? To be more specific, I'd like to be able to capture strings that can contain b...
Terryl asked 26/11, 2015 at 22:39

2

Solved

I've just started playing with PEG.js and have a problem with a grammar (vastly simplified for debugging): start = presingle single / preplural plural presingle = "a" / "b" preplural = "b" ...
Hydrazine asked 31/10, 2012 at 14:32

2

Solved

I'm trying to extend the example grammar of PEG.js for parsing mathematical expressions with all the 4 operators for my online BASIC interpreter experiment: http://www.dantonag.it/basicjs/basicjs....
Peeper asked 15/10, 2013 at 20:7

1

Solved

I was wondering how do you parse comments (say, a la Haskell), in pegjs. The goal: {- This is a comment and should parse. Comments start with {- and end with -}. If you've noticed, I still inc...
Radioisotope asked 9/2, 2015 at 21:44

2

Solved

I've defined the following minimal Peg.js grammar: start = "A1" / "A123" which you can try in the sandbox. I would have expected to match "A1" as well as "A123" (according to my notion of how ...
Rankle asked 16/7, 2014 at 6:15

1

Solved

I'm trying to match this f(some_thing) == 'something else' f(some_thing) is a function call, which is an expression == is a boolean operator 'something else' is a string, which also is an expr...
Coachwhip asked 19/3, 2013 at 17:10

1

Solved

Is there a tool that translates a PEG.js grammar to a TextMate grammar? I am building my own language and would like to have syntax highlighting for it in my preferred editor, TextMate. The gramma...
Zumwalt asked 2/2, 2013 at 18:39

1

Solved

I am trying to write a simple grammer for PEG.js that would match something like this: some text; arbitrary other text that can also have µnicode; different expression; let's escape the \; semicol...
Zootoxin asked 5/10, 2012 at 9:58

1

Solved

I'm trying to make a parser using pegjs. I need to parse something like: blah blah START Lorem ipsum dolor sit amet, consectetur adipiscing elit END foo bar etc. I have trouble writing the ru...
Louislouisa asked 1/9, 2012 at 19:26

3

Solved

I have a bbcode -> html converter that responds to the change event in a textarea. Currently, this is done using a series of regular expressions, and there are a number of pathological cases. I've ...
Fingerstall asked 29/6, 2012 at 20:13
1

© 2022 - 2024 — McMap. All rights reserved.