<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>zehnpaard</author_name>
  <author_url>https://blog.hatena.ne.jp/zehnpaard/</author_url>
  <blog_title>Arantium Maestum</blog_title>
  <blog_url>https://zehnpaard.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>言語処理系</anon>
  </categories>
  <description>前回のコードだとparse関数を複数回呼び出すと前回のキャッシュが残っていてパースがうまくいかない問題があった。parse呼び出しごとにキャッシュをクリアするようにしたい。 キャッシュ xparser.pyモジュールのトップレベルにキャッシュのリストとそのリストをループしてすべてのキャッシュをクリアする関数を定義： _caches = [] def _clear_caches(): for cache in _caches: cache.clear() _memoデコレータで作成されるキャッシュを_cachesに追加するようにする： def _memo(func): d = {} _cache…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fzehnpaard.hatenablog.com%2Fentry%2F2021%2F09%2F14%2F193107&quot; title=&quot;PythonでLanguage Implementation Patternsのパーサと戯れる　Packratパーサのキャッシュクリア - Arantium Maestum&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-09-14 19:31:07</published>
  <title>PythonでLanguage Implementation Patternsのパーサと戯れる　Packratパーサのキャッシュクリア</title>
  <type>rich</type>
  <url>https://zehnpaard.hatenablog.com/entry/2021/09/14/193107</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
