From b2a125c5651756dd113199846cde0e963d443a51 Mon Sep 17 00:00:00 2001 From: Brett Hagman Date: Mon, 19 Feb 2018 11:19:50 -0500 Subject: [PATCH 1/3] added outlier fix for base keywords.txt file with empty reference fields *UNTESTED* - we need to fix the outliers, not the majority. I think this solution will fix the problem with the base keywords.txt file. --- app/src/processing/app/syntax/PdeKeywords.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/processing/app/syntax/PdeKeywords.java b/app/src/processing/app/syntax/PdeKeywords.java index 62d719f9746..8e24cec05e0 100644 --- a/app/src/processing/app/syntax/PdeKeywords.java +++ b/app/src/processing/app/syntax/PdeKeywords.java @@ -115,7 +115,14 @@ private void parseKeywordsTxt(File input) throws Exception { continue; } - String pieces[] = line.split("\t"); + String pieces[]; + + if (line.indexOf('\t')) { + pieces = line.split("\t"); // For the cyborgs + } + else { + pieces = line.split("\\s+", 4); // For the rest of humanity + } String keyword = pieces[0].trim(); if (keyword.startsWith("\\#")) { From 9d79a92028796b8985130a0b411a046ab16fadd6 Mon Sep 17 00:00:00 2001 From: Brett Hagman Date: Mon, 19 Feb 2018 14:15:22 -0500 Subject: [PATCH 2/3] Java type conversion on character test --- app/src/processing/app/syntax/PdeKeywords.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/processing/app/syntax/PdeKeywords.java b/app/src/processing/app/syntax/PdeKeywords.java index 8e24cec05e0..1ebc87c8a18 100644 --- a/app/src/processing/app/syntax/PdeKeywords.java +++ b/app/src/processing/app/syntax/PdeKeywords.java @@ -117,7 +117,7 @@ private void parseKeywordsTxt(File input) throws Exception { String pieces[]; - if (line.indexOf('\t')) { + if (line.indexOf('\t') > 0) { pieces = line.split("\t"); // For the cyborgs } else { From d07fa9faa075d7b9f9645ce21e3ba961d07a0b9b Mon Sep 17 00:00:00 2001 From: Brett Hagman Date: Mon, 19 Feb 2018 15:03:26 -0500 Subject: [PATCH 3/3] Fix PdeKeywords.java to fall back to tab parsing when double tabs found. --- app/src/processing/app/syntax/PdeKeywords.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/processing/app/syntax/PdeKeywords.java b/app/src/processing/app/syntax/PdeKeywords.java index 1ebc87c8a18..45a5c6f8f11 100644 --- a/app/src/processing/app/syntax/PdeKeywords.java +++ b/app/src/processing/app/syntax/PdeKeywords.java @@ -117,7 +117,7 @@ private void parseKeywordsTxt(File input) throws Exception { String pieces[]; - if (line.indexOf('\t') > 0) { + if (line.contains("\t\t")) { pieces = line.split("\t"); // For the cyborgs } else {