felixhao28 / JSCPP

A simple C++ interpreter written in JavaScript

Home Page:https://felixhao28.github.io/JSCPP/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

解析模版语法

liuyanxing opened this issue · comments

我想用pegjs解析模板语法,比如 vecotr v; 改了一下文法文件但是 < 始终被识别为小于符号。可以大概提供下思路吗,谢谢🙏

这个语法你可以参考 https://www.nongnu.org/hcb/#template-declaration ,模仿这里面写的东西去修改 ast.peg。改完了记得重新build对应的peg文件。