Skip to content

Commit

Permalink
fix strings
Browse files Browse the repository at this point in the history
  • Loading branch information
yinwang0 committed Nov 10, 2016
1 parent 86b8d96 commit eb9cb68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/yinwang/pysonar/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,11 @@ public Node convert(Object o) {

if (type.equals("Str")) {
String s = (String) map.get("s");
if (s.startsWith("\"\"\""))
if (s.length() >= 6 && s.startsWith("\"\"\"") && s.endsWith("\"\"\""))
{
s = s.substring(3, s.length() - 3);
}
else
else if (s.length() >= 2 && s.startsWith("\"") && s.endsWith("\""))
{
s = s.substring(1, s.length() - 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ def improve_node(node, s):
improve_node(n, s)

elif isinstance(node, AST):

find_start(node, s)
find_end(node, s)
add_missing_names(node, s)
Expand Down

0 comments on commit eb9cb68

Please sign in to comment.