summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-03 20:36:23 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-03 20:36:23 -0700
commit7bc150f6d87b836b7690f8d73ee815ea8c718b13 (patch)
treecfd00d9675a70a46b512616483c1741d68b8fb47 /parser.y
parent3ce8999b2cc9c2aa04805141af9cb449d92fa89e (diff)
downloadtxr-7bc150f6d87b836b7690f8d73ee815ea8c718b13.tar.gz
txr-7bc150f6d87b836b7690f8d73ee815ea8c718b13.tar.bz2
txr-7bc150f6d87b836b7690f8d73ee815ea8c718b13.zip
packages: fix package prefix read/print issue.
Suppose that we have two symbols of the same name, in two packages: foo:sym and bar:sym. Suppose that the bar package has foo in its package fallback list, and suppose bar is the current package. Then bar:sym prints without a package prefix, as just sym. However, this is potentially ambiguous. Suppose that bar:sym is written to a file as just sym. Then later the file is read into a fresh image in a situation in which bar:sym has not yet been interned, but foo:sym already exists. In this situation, sym will just resolve to foo:sym. The printer must detect this ambiguous situation. If a symbol is present in a package, but a same-named symbol is in the fallback list; or if a symbol is visible in the fallback list, but a same-named symbol is present in the package, then a package prefix should be printed. * lib.c (symbol_needs_prefix): New function. (unquote_star_check, obj_print_impl): Use symbol_needs_prefix rather than symbol_visible. * lib.h (symbol_needs_prefix): Declared.
Diffstat (limited to 'parser.y')
0 files changed, 0 insertions, 0 deletions