handle zero length result sets
This commit is contained in:
parent
fd7f930eeb
commit
8c618ada46
@ -30,6 +30,12 @@ class CommandLineInterface {
|
||||
parser.load_processors_from_resources();
|
||||
|
||||
var results = parser.parse(code);
|
||||
|
||||
if (results.length == 0) {
|
||||
neko.Lib.print("Your code didn't have any tokens in it!");
|
||||
neko.Sys.exit(0);
|
||||
}
|
||||
|
||||
var ignored_modules = parser.ignored_modules;
|
||||
var ignored_tokens_in_modules = parser.ignored_tokens_in_modules;
|
||||
|
||||
|
@ -94,9 +94,16 @@ class JavaScriptTarget {
|
||||
Display code version information.
|
||||
**/
|
||||
static public function display_version_information() {
|
||||
var output : String;
|
||||
var ignored_tokens = new Array<String>();
|
||||
var ignored_modules_array = new Array<String>();
|
||||
|
||||
if (current_results.length == 0) {
|
||||
output = "<div id=\"code-announcement\">Your code doesn't have any tokens in it!</div>";
|
||||
} else {
|
||||
var version_info = new CodeVersionInformation(current_results, ignored_modules, ignored_tokens_in_modules);
|
||||
|
||||
var output = "<div id=\"code-announcement\">Your code requires the following minimum PHP & PECL module versions:</div>";
|
||||
output = "<div id=\"code-announcement\">Your code requires the following minimum PHP & PECL module versions:</div>";
|
||||
|
||||
var minimum = version_info.final_versions.get("minimum");
|
||||
|
||||
@ -115,8 +122,6 @@ class JavaScriptTarget {
|
||||
|
||||
all_modules.sort(CodeVersionInformation.module_name_sorter);
|
||||
|
||||
var ignored_tokens = new Array<String>();
|
||||
var ignored_modules_array = new Array<String>();
|
||||
for (module in manually_ignored_modules.keys()) {
|
||||
if (manually_ignored_modules.get(module) == true) {
|
||||
ignored_modules_array.push("@" + module);
|
||||
@ -265,6 +270,7 @@ class JavaScriptTarget {
|
||||
output += "</table>";
|
||||
|
||||
output += "</form>";
|
||||
}
|
||||
|
||||
// update the how-to-ignore information
|
||||
var permanent_ignore_div = js.Lib.document.getElementById("permanent-ignore");
|
||||
|
Loading…
Reference in New Issue
Block a user