More work refactoring ckint/tryint/isint
This commit is contained in:
@@ -120,18 +120,18 @@ public:
|
||||
// assign one.
|
||||
int tabnum = 0;
|
||||
LS.rawget(lchpos, tabchpos_, value);
|
||||
if (!LS.isnumber(lchpos)) {
|
||||
auto chpos = LS.tryint(lchpos);
|
||||
if (!chpos) {
|
||||
// First time. Record the character position where the
|
||||
// table first appears in the output stream.
|
||||
LS.rawset(tabchpos_, value, int((*output_).tellp()));
|
||||
} else {
|
||||
int chpos = LS.ckint(lchpos);
|
||||
tabnum = chpos_to_tabnum_[chpos];
|
||||
tabnum = chpos_to_tabnum_[*chpos];
|
||||
if (tabnum == 0) {
|
||||
// Second time. The table is already in the output,
|
||||
// but it hasn't been assigned a number. Assign one.
|
||||
tabnum = next_id_++;
|
||||
chpos_to_tabnum_[chpos] = tabnum;
|
||||
chpos_to_tabnum_[*chpos] = tabnum;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user