OSDN Git Service

アウトライン解析処理を修正
authorbatxo <batxo@users.sourceforge.jp>
Tue, 21 Dec 2010 20:01:36 +0000 (05:01 +0900)
committerbatxo <batxo@users.sourceforge.jp>
Tue, 21 Dec 2010 20:01:36 +0000 (05:01 +0900)
src/coboled/editors/CobolParser.java

index 9e1180f..6a9d6a9 100644 (file)
@@ -8,13 +8,13 @@ public class CobolParser {
        public CobolElement parse(String source) {
                CobolElement root = new CobolElement("root", CobolElementType.ROOT);
                CobolElement work = root;
-               Pattern outline = Pattern.compile("^.{6} ( {0,3})([^ ]+.*)", Pattern.MULTILINE);
+               Pattern outline = Pattern.compile("^.{6} ( {0,3})([^ ]+?.*)", Pattern.MULTILINE);
                Matcher matcher = outline.matcher(source);
                while (matcher.find()) {
                        String group = matcher.group(2);
                        if(group != null) {
                                String[] strings = group.split(" +");
-                               if(strings.length >= 2) {
+                               if(strings.length >= 2 && strings[0].indexOf("EXIT") == -1) {
                                        CobolElementType type = null;
                                        if(strings[1].startsWith("DIVISION")) {
                                                type = CobolElementType.DIVISION;