Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/parser/tokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ bool IsNumeric(char c) {
!IsWhitespace(c);
}

bool IsIdentLetter(char c) { return '_' == c || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'); }
bool IsIdentLetter(char c) {
return '_' == c || c == '/' || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
}

bool IsIdent(char c) { return IsIdentLetter(c) || IsDigit(c); }

Expand Down
9 changes: 9 additions & 0 deletions tests/python/relay/test_ir_text_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,5 +284,14 @@ def test_optional_info():
assert txt.count("/* ty=int32 */") == 3


def test_slash_in_identifier():
x = relay.var("base/x")
y = relay.var("base/y")
z = x + y
txt = astext(z)
assert "base/x" in txt
assert "base/y" in txt


if __name__ == "__main__":
pytest.main([__file__])