Skip to content

Commit

Permalink
Add support for # in symbols
Browse files Browse the repository at this point in the history
This is necessary for gensyms in syntax quotes.
  • Loading branch information
jeaye committed Mar 16, 2024
1 parent 5fd1770 commit fa62107
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cpp/jank/read/lex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ namespace jank::read
{
return std::isalnum(static_cast<unsigned char>(c)) != 0 || c == '_' || c == '-' || c == '/'
|| c == '?' || c == '!' || c == '+' || c == '*' || c == '=' || c == '.' || c == '&'
|| c == '<' || c == '>';
|| c == '<' || c == '>' || c == '#';
}

result<token, error> processor::next()
Expand Down
4 changes: 2 additions & 2 deletions test/cpp/jank/read/lex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,11 +646,11 @@ namespace jank::read::lex

SUBCASE("With other symbols")
{
processor p{ "abc_.123/-foo+?=!&<>" };
processor p{ "abc_.123/-foo+?=!&<>#" };
native_vector<result<token, error>> tokens(p.begin(), p.end());
CHECK(tokens
== make_tokens({
{0, 20, token_kind::symbol, "abc_.123/-foo+?=!&<>"sv}
{0, 21, token_kind::symbol, "abc_.123/-foo+?=!&<>#"sv}
}));
}

Expand Down

0 comments on commit fa62107

Please sign in to comment.