Skip to content

Commit

Permalink
Update the regex to use const
Browse files Browse the repository at this point in the history
  • Loading branch information
poorna2152 committed Sep 19, 2024
1 parent 3c249a3 commit 7a9fbb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public Value getChildByName(String name) throws DebugVariableException {

if (!namedChildVariables.containsKey(name)) {
for (Map.Entry<String, Value> childVariable : namedChildVariables.entrySet()) {
String escaped = childVariable.getKey().replaceAll("\\$0092(\\$0092)?", "$1");
String unicodeOfSlash = "&0092";
String escaped = childVariable.getKey()
.replaceAll(String.format("\\%s(\\%s)?", unicodeOfSlash, unicodeOfSlash), "$1");
if (escaped.equals(name)) {
return childVariable.getValue();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class Person {
self.lastName = lastName;
}

function '\$init\$() returns string {
return self.firstName + " " + self.lastName;
}
// function '\$init\$() returns string {
// return self.firstName + " " + self.lastName;
// }
}

type '\$anonType\$_0 record {
Expand All @@ -59,7 +59,7 @@ function print(string str) {
public function main() {
Person person = new("John", "Doe");
test:assertEquals("John", person.firstName);
test:assertEquals("John Doe", person.'\$init\$());
// test:assertEquals("John Doe", person.'\$init\$());
// test:assertEquals("this is a user defined function", '\.\<init\>());

record {|
Expand Down

0 comments on commit 7a9fbb0

Please sign in to comment.