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.

Fuzzy Parsing Example

See original GitHub issue

See:

This could probably be done using Token Categories to match against “all” kinds of tokens combined with an alternation which includes the one option we care about.

e.g:

      $.RULE("fuzzyConstantFinder", () => {
        $.OR([
          // We may need a GATE here, e.g using backtracking to ensure we never incorrectly enter
         // the constant alternative. 
          {ALT: () => $.SUBRULE($.constant)}, //
          {ALT: () => $.CONSUME(AnyToken)}, // AnyToken should be defined using Token Categories.
        ]);
      });

      $.RULE("constant", () => {
           $.CONSUME(Public);
           $.CONSUME(Static);
           $.CONSUME(Final);
           $.CONSUME(Int);
           $.CONSUME(Ident);
      });

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bd82commented, Aug 10, 2019

I’ve started playing around with a similar scenario which required consuming any kind of tokens between a “–” and a semiColon.

Basically the CSS 3 custom property syntax:

You can inspect the current state of the example here:

0reactions
bd82commented, Sep 5, 2019

Consider expanding the fuzzy parsing example to a scenario in which the fuzzy matching acts as a default fall back.

e.g: 3 Alternatives, and the 3rd one being the fuzzy one which could conflict with the first 2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Systematic Approach to Fuzzy Parsing - CiteSeerX
This paper presents a systematic approach to implementing fuzzy parsers. A fuzzy parser is a form of syntax analyzer that performs analysis on...
Read more >
fuzzy-parse: Tools for processing unstructured text data
The lightweight and easy to use functions for text tokenizing and parsing. It aimed for parsing mostly unstructured data, but the structured ...
Read more >
A Systematic Approach to Fuzzy Parsing - Wiley Online Library
SUMMARY. This paper presents a systematic approach to implementing fuzzy parsers. A fuzzy parser is a form of syntax analyzer that performs analysis...
Read more >
Unfuzzying Fuzzy Parsing - DROPS
Keywords and phrases robust parsing, fuzzy parsing, automata ... example of natural parsing is our ability to listen to human's speech and collect...
Read more >
Python Language Tutorial => Fuzzy datetime parsing ...
Example #. It is possible to extract a date out of a text using the dateutil parser in a "fuzzy" mode, where components...
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