[From string (line 15) ] @startuml !$char = { "quote" : "\"" } !$foo = { "company": "Skynet", "employees" : [ !function $attribute($json, $attr) !$lhs=$char.quote+$attr+$char.quote+":" !$rhs=%substr($json,%strpos($json, $lhs)+%strlen($lhs)) !$end=%strlen($rhs) - 1 !if (%strpos($rhs,$char.quote) == 0) !$rhs=%substr($rhs,1) !$end=$end-1 !if (%strpos($rhs, $char.quote) >= 0) && (%strpos($rhs, $char.quote) < $end) !$end=%strpos($rhs, $char.quote) !endif !else !if (%strpos($rhs, ",") >= 0) && (%strpos($rhs, ",") < $end) !$end=%strpos($rhs, ",") !endif !if (%strpos($rhs, "}") >= 0) && (%strpos($rhs, "}") < $end) !$end=%strpos($rhs, "}") !endif !endif !return %substr($rhs,0,$end) !endfunction start !$attribute1="name" !$attribute2="salary" :The salary of $attribute($foo.employees[0], $attribute1) is $attribute($foo.employees[0], $attribute2); !$lhs=$char.quote+$attr+$char.quote+":" !$rhs=%substr($json,%strpos($json, $lhs)+%strlen($lhs)) !$end=%strlen($rhs) - 1 !if (%strpos($rhs,$char.quote) == 0) !$rhs=%substr($rhs,1) !$end=$end-1 ^^^^^ Parsing syntax error about $end-1