question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Single string matching (works with a latin character, but doesn't work with an integer)

See original GitHub issue
$ echo 'test -> "a"' > ./grammar.ne
$ nearleyc ./grammar.ne --out ./grammar.js
$ nearley-test ./grammar.js --input 'a'
Table length: 2
Number of parses: 1
Parse Charts
Chart: 0
0: {test →  ● "a"}, from: 0

Chart: 1
0: {test → "a" ● }, from: 0


Parse results:
[ [ 'a' ] ]

$ echo 'test -> "1"' > ./grammar.ne
$ nearleyc ./grammar.ne --out ./grammar.js
$ nearley-test ./grammar.js --input '1'
Table length: 1
Number of parses: 0
Parse Charts
Chart: 0
0: {test →  ● "1"}, from: 0


Parse results:
[]

Whats the reason one produces a result and the other does not?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kachcommented, Jan 21, 2017

Yeah, no kidding. If you want, you can send me a PR.

0reactions
nanaiancommented, Jan 21, 2017

@Hardmath123 could solve this by performing the magical Object.prototype.toString() method 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Matching special characters and letters in regex - Stack Overflow
ie Whenever a character other than a letter, a number or special characters &-._ comes, the string should evaluate as invalid. How can...
Read more >
Everything you need to know about Regular Expressions
After reading this article you will have a solid understanding of what regular expressions are, what they can do, and what they can't...
Read more >
String matching where one string contains wildcard characters
Write a function that returns true if the two strings match. The following are allowed wild card characters in first string.
Read more >
Regular expression syntax cheatsheet - JavaScript | MDN
Matches a single white space character, including space, tab, form feed, line feed, and other Unicode spaces.
Read more >
Regular Expressions :: Eloquent JavaScript
It just enforces that the regular expression matches only when a certain condition holds at the place where it appears in the pattern....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found