File tree Expand file tree Collapse file tree
app/src/main/java/com/amrdeveloper/codeviewlibrary/syntax Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ public class GoLanguage {
2727
2828 //Data
2929 private static final Pattern PATTERN_NUMBERS = Pattern .compile ("\\ b(\\ d*[.]?\\ d+)\\ b" );
30- private static final Pattern PATTERN_CHAR = Pattern .compile ("'[a-zA-Z]' " );
31- private static final Pattern PATTERN_STRING = Pattern .compile ("\" .* \" " );
30+ private static final Pattern PATTERN_CHAR = Pattern .compile ("['](.*?)['] " );
31+ private static final Pattern PATTERN_STRING = Pattern .compile ("[ \" ](.*?)[ \" ] " );
3232 private static final Pattern PATTERN_HEX = Pattern .compile ("0x[0-9a-fA-F]+" );
3333 private static final Pattern PATTERN_SINGLE_LINE_COMMENT = Pattern .compile ("//[^\\ n]*" );
3434 private static final Pattern PATTERN_MULTI_LINE_COMMENT = Pattern .compile ("/\\ *[^*]*\\ *+(?:[^/*][^*]*\\ *+)*/" );
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ public class JavaLanguage {
3434 private static final Pattern PATTERN_ANNOTATION = Pattern .compile ("@.[a-zA-Z0-9]+" );
3535 private static final Pattern PATTERN_TODO_COMMENT = Pattern .compile ("//TODO[^\n ]*" );
3636 private static final Pattern PATTERN_NUMBERS = Pattern .compile ("\\ b(\\ d*[.]?\\ d+)\\ b" );
37- private static final Pattern PATTERN_CHAR = Pattern .compile ("'[a-zA-Z]' " );
38- private static final Pattern PATTERN_STRING = Pattern .compile ("\" .* \" " );
37+ private static final Pattern PATTERN_CHAR = Pattern .compile ("['](.*?)['] " );
38+ private static final Pattern PATTERN_STRING = Pattern .compile ("[ \" ](.*?)[ \" ] " );
3939 private static final Pattern PATTERN_HEX = Pattern .compile ("0x[0-9a-fA-F]+" );
4040
4141 public static void applyMonokaiTheme (Context context , CodeView codeView ) {
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ public class PythonLanguage {
2727
2828 //Data
2929 private static final Pattern PATTERN_NUMBERS = Pattern .compile ("\\ b(\\ d*[.]?\\ d+)\\ b" );
30- private static final Pattern PATTERN_CHAR = Pattern .compile ("'[a-zA-Z]' " );
31- private static final Pattern PATTERN_STRING = Pattern .compile ("\" .* \" " );
30+ private static final Pattern PATTERN_CHAR = Pattern .compile ("['](.*?)['] " );
31+ private static final Pattern PATTERN_STRING = Pattern .compile ("[ \" ](.*?)[ \" ] " );
3232 private static final Pattern PATTERN_HEX = Pattern .compile ("0x[0-9a-fA-F]+" );
3333 private static final Pattern PATTERN_TODO_COMMENT = Pattern .compile ("#TODO[^\n ]*" );
3434 private static final Pattern PATTERN_ATTRIBUTE = Pattern .compile ("\\ .[a-zA-Z0-9_]+" );
You can’t perform that action at this time.
0 commit comments