<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 星野夢華</title>
    <description>The latest articles on DEV Community by 星野夢華 (@hoshinoyumeka).</description>
    <link>https://dev.to/hoshinoyumeka</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3848079%2Fb4eed6d8-f15e-47f1-b79d-405649c01c3d.jpeg</url>
      <title>DEV Community: 星野夢華</title>
      <link>https://dev.to/hoshinoyumeka</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hoshinoyumeka"/>
    <language>en</language>
    <item>
      <title>Building a single-pass rich-text DSL parser (no regex)</title>
      <dc:creator>星野夢華</dc:creator>
      <pubDate>Sat, 28 Mar 2026 17:53:12 +0000</pubDate>
      <link>https://dev.to/hoshinoyumeka/building-a-single-pass-rich-text-dsl-parser-no-regex-5bge</link>
      <guid>https://dev.to/hoshinoyumeka/building-a-single-pass-rich-text-dsl-parser-no-regex-5bge</guid>
      <description>&lt;p&gt;I built this while trying to replace Markdown in my personal blog.&lt;br&gt;
Markdown is convenient, but once you start adding custom syntax, parsing rules quickly become hard to reason about.&lt;/p&gt;

&lt;p&gt;I wanted something with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;predictable parsing behavior&lt;/li&gt;
&lt;li&gt;nested structures without ambiguity&lt;/li&gt;
&lt;li&gt;extensible semantics&lt;/li&gt;
&lt;li&gt;minimal syntax surface&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So instead of a regex-driven approach, I implemented a single-pass recursive descent parser with no backtracking.&lt;br&gt;
The parser handles three forms — inline, block, and raw — all using the same core state machine.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;$$bold(hello)$$&lt;/p&gt;

&lt;p&gt;$$info()*&lt;br&gt;
This is a block tag&lt;br&gt;
*end$$&lt;/p&gt;

&lt;p&gt;Handlers are pluggable, so the grammar stays small while behavior is defined externally.&lt;br&gt;
This keeps the parser focused on structure, not rendering.&lt;/p&gt;

&lt;p&gt;The result is a lightweight DSL that works well for structured rich text, especially in static site generators or blog engines.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/chiba233/yumeDSL" rel="noopener noreferrer"&gt;https://github.com/chiba233/yumeDSL&lt;/a&gt;&lt;br&gt;
npm: &lt;a href="https://www.npmjs.com/package/yume-dsl-rich-text" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/yume-dsl-rich-text&lt;/a&gt;&lt;br&gt;
demo: &lt;a href="https://qwwq.org/blog/dsl-fallback-museum" rel="noopener noreferrer"&gt;https://qwwq.org/blog/dsl-fallback-museum&lt;/a&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>parser</category>
      <category>dsl</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
