Skip to content

Commit

Permalink
Check for validity of escaped name.
Browse files Browse the repository at this point in the history
  • Loading branch information
toinehartman committed Nov 27, 2024
1 parent c60bd76 commit 4fa9c79
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ private set[IllegalRenameReason] rascalCheckLegalName(str name, set[IdRole] role
}

private void rascalCheckLegalName(str name, Symbol sym) {
escName = rascalEscapeName(name);
g = grammar(#start[Module]);
if (!tryParseAs(type(sym, g.rules), name)) {
throw illegalRename("\'<name>\' is not a valid name at this position", {invalidName(name, "<sym>")});
if (!tryParseAs(type(sym, g.rules), escName)) {
throw illegalRename("\'<escName>\' is not a valid name at this position", {invalidName(escName, "<sym>")});
}
}

Expand Down

0 comments on commit 4fa9c79

Please sign in to comment.