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 @@ -24,7 +24,7 @@ public class GoSyntaxManager {
2424 private static final Pattern PATTERN_STRING = Pattern .compile ("\" .*\" " );
2525 private static final Pattern PATTERN_HEX = Pattern .compile ("0x[0-9a-fA-F]+" );
2626 private static final Pattern PATTERN_TODO_COMMENT = Pattern .compile ("//TODO[^\n ]*" );
27- private static final Pattern PATTERN_COMMENT = Pattern .compile ("//[^ \n ]*" + "|" + "/\\ *(.|\\ R)*?\\ */" );
27+ private static final Pattern PATTERN_COMMENT = Pattern .compile ("//(?!TODO )[^ \ \ n]*" + "|" + "/\\ *(.|\\ R)*?\\ */" );
2828 private static final Pattern PATTERN_ATTRIBUTE = Pattern .compile ("\\ .[a-zA-Z0-9_]+" );
2929 private static final Pattern PATTERN_OPERATION =Pattern .compile ( ":|==|>|<|!=|>=|<=|->|=|>|<|%|-|-=|%=|\\ +|\\ -|\\ -=|\\ +=|\\ ^|\\ &|\\ |::|\\ ?|\\ *" );
3030
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public class JavaSyntaxManager {
1919 "|synchronized|this|throw|transient|try|void|volatile|while)\\ b" );
2020
2121 private static final Pattern PATTERN_BUILTINS = Pattern .compile ("[,:;[->]{}()]" );
22- private static final Pattern PATTERN_COMMENT = Pattern .compile ("//[^ \n ]*" + "|" + "/\\ *(.|\\ R)*?\\ */" );
22+ private static final Pattern PATTERN_COMMENT = Pattern .compile ("//(?!TODO )[^ \ \ n]*" + "|" + "/\\ *(.|\\ R)*?\\ */" );
2323 private static final Pattern PATTERN_ATTRIBUTE = Pattern .compile ("\\ .[a-zA-Z0-9_]+" );
2424 private static final Pattern PATTERN_OPERATION =Pattern .compile ( ":|==|>|<|!=|>=|<=|->|=|>|<|%|-|-=|%=|\\ +|\\ -|\\ -=|\\ +=|\\ ^|\\ &|\\ |::|\\ ?|\\ *" );
2525 private static final Pattern PATTERN_GENERIC = Pattern .compile ("<[a-zA-Z0-9,<>]+>" );
Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ public class PythonSyntaxManager {
2323 private static final Pattern PATTERN_CHAR = Pattern .compile ("'[a-zA-Z]'" );
2424 private static final Pattern PATTERN_STRING = Pattern .compile ("\" .*\" " );
2525 private static final Pattern PATTERN_HEX = Pattern .compile ("0x[0-9a-fA-F]+" );
26- private static final Pattern PATTERN_TODO_COMMENT = Pattern .compile ("// TODO[^\n ]*" );
26+ private static final Pattern PATTERN_TODO_COMMENT = Pattern .compile ("# TODO[^\n ]*" );
2727 private static final Pattern PATTERN_ATTRIBUTE = Pattern .compile ("\\ .[a-zA-Z0-9_]+" );
2828 private static final Pattern PATTERN_OPERATION =Pattern .compile ( ":|==|>|<|!=|>=|<=|->|=|>|<|%|-|-=|%=|\\ +|\\ -|\\ -=|\\ +=|\\ ^|\\ &|\\ |::|\\ ?|\\ *" );
29- private static final Pattern PATTERN_HASH_COMMENT = Pattern .compile ("#.* \\ n" );
29+ private static final Pattern PATTERN_HASH_COMMENT = Pattern .compile ("#(?!TODO )[^ \\ n]* " );
3030
3131 public static void applyMonokaiTheme (Context context , CodeView codeView ) {
3232 codeView .resetSyntaxPatternList ();
You can’t perform that action at this time.
0 commit comments