cubing.js icon indicating copy to clipboard operation
cubing.js copied to clipboard

Write an alg parser in TypeScript

Open lgarron opened this issue 9 years ago • 2 comments

We have a good parser generator, but we could get some benefits from writing our own:

  • Better error messages for parsing errors
  • Streaming/incremental parsing
  • Very efficient

lgarron avatar Dec 05 '16 07:12 lgarron

I wrote an algorithm parser using Parsimmon: https://github.com/mikebolt/ThreeTwist/blob/experiments/src/scripts/algorithm.js

The goal was to make it part of this "algorithm class" that had lots of useful methods. Feel free to use any code from ThreeTwist. Also stay away from CSS3D :)

mikebolt avatar Dec 13 '16 05:12 mikebolt

Take a look at https://github.com/cubing/alg.cubing.net/tree/v2/twisty/alg ;-)

I think it has everything you have have that isn't specific to cubes, but I'm happy to have help or suggestions for what directions to take it. :-)

lgarron avatar Dec 13 '16 07:12 lgarron