X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Fmarkdown%2Finternal%2FCharacterSet.java;h=e99800f7b75b26c236e5a49c1bec2f9d8c0429fe;hb=refs%2Fchanges%2F38%2F238%2F2;hp=e3321386be7949f11e7939c4d2adfc5c83a9abe5;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/internal/CharacterSet.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/internal/CharacterSet.java index e3321386b..e99800f7b 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/internal/CharacterSet.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/internal/CharacterSet.java @@ -1,44 +1,44 @@ -package org.simantics.scl.compiler.markdown.internal; - -public class CharacterSet { - private int minChar; - private int maxChar; - boolean[] table; - - public CharacterSet(String chars) { - if(chars.isEmpty()) - throw new IllegalArgumentException(); - minChar = Integer.MAX_VALUE; - maxChar = Integer.MIN_VALUE; - for(int i=0;i 0 && i < chars.length()-1) - continue; - minChar = Math.min(minChar, c); - maxChar = Math.max(maxChar, c); - } - - table = new boolean[maxChar-minChar+1]; - for(int i=0;i c2) { - int temp = c; - c = c2; - c2 = temp; - } - for(int j=c;j<=c2;++j) - table[j - minChar] = true; - i+=2; - } - else - table[c - minChar] = true; - } - } - - public boolean contains(char c_) { - int c = (int)c_; - return c >= minChar && c <= maxChar && table[c - minChar]; - } -} +package org.simantics.scl.compiler.markdown.internal; + +public class CharacterSet { + private int minChar; + private int maxChar; + boolean[] table; + + public CharacterSet(String chars) { + if(chars.isEmpty()) + throw new IllegalArgumentException(); + minChar = Integer.MAX_VALUE; + maxChar = Integer.MIN_VALUE; + for(int i=0;i 0 && i < chars.length()-1) + continue; + minChar = Math.min(minChar, c); + maxChar = Math.max(maxChar, c); + } + + table = new boolean[maxChar-minChar+1]; + for(int i=0;i c2) { + int temp = c; + c = c2; + c2 = temp; + } + for(int j=c;j<=c2;++j) + table[j - minChar] = true; + i+=2; + } + else + table[c - minChar] = true; + } + } + + public boolean contains(char c_) { + int c = (int)c_; + return c >= minChar && c <= maxChar && table[c - minChar]; + } +}