Skip to content

Commit

Permalink
[prebuilt] ASDL runtime uses j8_lite, not QSN
Browse files Browse the repository at this point in the history
That wasn't too bad.  I can see the change now in 'ysh -n'.
  • Loading branch information
Andy C committed Jan 28, 2024
1 parent dca4642 commit 8349115
Show file tree
Hide file tree
Showing 9 changed files with 352 additions and 1,114 deletions.
9 changes: 3 additions & 6 deletions asdl/format.py
Expand Up @@ -19,7 +19,7 @@
from _devbuild.gen.hnode_asdl import (hnode, hnode_e, hnode_t, color_e,
color_t)
from core import ansi
from data_lang import qsn
from data_lang import j8_lite
from pylib import cgi
from mycpp import mylib

Expand Down Expand Up @@ -395,8 +395,7 @@ def PrintNode(self, node, f, indent):
if tag == hnode_e.Leaf:
node = cast(hnode.Leaf, UP_node)
f.PushColor(node.color)
# TODO: use fastfunc.J8Encode()
f.write(qsn.maybe_encode(node.s))
f.write(j8_lite.EncodeString(node.s, unquoted_ok=True))
f.PopColor()

elif tag == hnode_e.External:
Expand Down Expand Up @@ -465,9 +464,7 @@ def _TrySingleLine(node, f, max_chars):
if tag == hnode_e.Leaf:
node = cast(hnode.Leaf, UP_node)
f.PushColor(node.color)
# TODO: use fastfunc.J8Encode()
# j8.EncodeString(node.s, unquoted_ok=True)
f.write(qsn.maybe_encode(node.s))
f.write(j8_lite.EncodeString(node.s, unquoted_ok=True))
f.PopColor()

elif tag == hnode_e.External:
Expand Down
7 changes: 4 additions & 3 deletions prebuilt/NINJA_subgraph.py
Expand Up @@ -51,16 +51,17 @@ def NinjaGraph(ru):
srcs=['prebuilt/asdl/runtime.mycpp.cc'],
deps=[
'//asdl/hnode.asdl',
# Should //cpp/qsn exist?
'//cpp/data_lang', # for fastfunc
])

ru.cc_library(
'//prebuilt/core/error.mycpp',
srcs=['prebuilt/core/error.mycpp.cc'],
deps=[
'//asdl/hnode.asdl',
'//core/value.asdl',
'//frontend/syntax.asdl',
# Should //cpp/qsn exist?
'//cpp/data_lang', # for fastfunc
])

ru.cc_library(
Expand All @@ -70,6 +71,6 @@ def NinjaGraph(ru):
'//asdl/hnode.asdl',
'//core/runtime.asdl',
'//frontend/syntax.asdl',
'//cpp/data_lang', # for fastfunc
'//cpp/frontend_flag_spec',
# Should //cpp/qsn exist?
])

0 comments on commit 8349115

Please sign in to comment.