Skip to content

Commit

Permalink
Fix datum label reader to compile with clang++
Browse files Browse the repository at this point in the history
Signed-off-by: yamacir-kit <[email protected]>
  • Loading branch information
yamacir-kit committed Jun 9, 2024
1 parent 209272c commit 742652d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Procedures for each standard are provided by the following R7RS-style libraries:
cmake -B build -DCMAKE_BUILD_TYPE=Release
cd build
make package
sudo apt install build/meevax_0.5.201_amd64.deb
sudo apt install build/meevax_0.5.202_amd64.deb
```

or
Expand Down Expand Up @@ -122,9 +122,9 @@ sudo rm -rf /usr/local/share/meevax

| Target Name | Description
|-------------|-------------
| `all` | Build shared-library `libmeevax.0.5.201.so` and executable `meevax`
| `all` | Build shared-library `libmeevax.0.5.202.so` and executable `meevax`
| `test` | Test executable `meevax`
| `package` | Generate debian package `meevax_0.5.201_amd64.deb`
| `package` | Generate debian package `meevax_0.5.202_amd64.deb`
| `install` | Copy files into `/usr/local` directly

## Usage
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.201
0.5.202
62 changes: 31 additions & 31 deletions src/kernel/textual_input_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,46 +246,46 @@ inline namespace kernel
case '7':
case '8':
case '9':
switch (auto [n, c] = [&]()
{
auto n = take_digits(c2);
return std::make_pair(n, take_character());
}(); c)
{
case '#':
if (auto iter = datum_labels.find(n); iter != datum_labels.end())
{
return iter->second;
}
else
{
throw read_error(make<string>("it is an error to attempt a forward reference"),
make<string>(lexical_cast<std::string>('#', n, '#')));
}
auto n = take_digits(c2);

case '=':
if (auto [iter, success] = datum_labels.emplace(n, make<datum_label>(n)); success)
switch (auto c = take_character())
{
if (let xs = read(); xs != iter->second)
case '#':
if (auto iter = datum_labels.find(n); iter != datum_labels.end())
{
circulate(xs, n);
datum_labels.erase(n);
return xs;
return iter->second;
}
else
{
return nullptr;
throw read_error(make<string>("it is an error to attempt a forward reference"),
make<string>(lexical_cast<std::string>('#', n, '#')));
}
}
else
{
throw read_error(make<string>("duplicated datum-label declaration"),
make<string>(n));
}

default:
throw read_error(make<string>("unknown discriminator"),
make<string>(lexical_cast<std::string>('#', n, c)));
case '=':
if (auto [iter, success] = datum_labels.emplace(n, make<datum_label>(n)); success)
{
if (let xs = read(); xs != iter->second)
{
circulate(xs, n);
datum_labels.erase(n);
return xs;
}
else
{
return nullptr;
}
}
else
{
throw read_error(make<string>("duplicated datum-label declaration"),
make<string>(n));
}

default:
throw read_error(make<string>("unknown discriminator"),
make<string>(lexical_cast<std::string>('#', n, c)));
}
}

case 'b':
Expand Down

0 comments on commit 742652d

Please sign in to comment.