Let's write a simple JavaScript pre-processor! ;-)

Open
#199 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript
Domain
compilers

Research direction

The issue names no repository files, tests, or entry points. Start by identifying a suitable JavaScript parser and determining how its parse tree can be modified and serialized; done would require a working pre-processor covering the requested scan, parse, transformation, and serialization flow.

Written by the indexing model from the issue text.

Description

This has been a long-term interest, and now I actually want to create the code.

It's a pre-processor. It takes as input arbitrary JavaScript code as input.

  1. It runs it through a lexical scanner, and a parser, and out the other end comes a parse tree.

  2. We make a few changes to the parse tree.

  3. We serialize the parse tree back into JavaScript source text.

And that's it!

I've looked at several open source JS parser projects but haven't found code that does this simply to just do my stuff and get back to other projects. I don't want to get immersed in the processor. Hope this makes sense.

Any help much appreciated! 💥

PS: I have experience with YACC and scanners. I've also written and maintained a scripting environment, so I'm fairly knowledgable about parsing, but am not familiar with any of the JS projects.

Dominant language
HTML
Stars
134
Forks
10
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from scripting/Scripting-News

All issues in scripting/Scripting-News

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.