Revert "Reland "Reland "Revert "Initial land of SkSL DSL.""""

This reverts commit 6b07e0eb497c3aa86d1ab6c238d9fa27d01b435c.

Change-Id: Ic01f31edf55b2d1a7533e0e8ed33b39b4846d937
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343106
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLCompiler.cpp b/src/sksl/SkSLCompiler.cpp
index 2726614..d610b3b 100644
--- a/src/sksl/SkSLCompiler.cpp
+++ b/src/sksl/SkSLCompiler.cpp
@@ -1813,6 +1813,7 @@
 
 bool Compiler::optimize(LoadedModule& module) {
     SkASSERT(!fErrorCount);
+    const Program::Settings* oldSettings = fIRGenerator->fSettings;
     Program::Settings settings;
     fIRGenerator->fKind = module.fKind;
     fIRGenerator->fSettings = &settings;
@@ -1837,6 +1838,7 @@
             break;
         }
     }
+    fIRGenerator->fSettings = oldSettings;
     return fErrorCount == 0;
 }
 
@@ -2159,10 +2161,13 @@
     fErrorText += "error: " + (pos.fLine >= 1 ? to_string(pos.fLine) + ": " : "") + msg + "\n";
 }
 
-String Compiler::errorText() {
-    this->writeErrorCount();
+String Compiler::errorText(bool showCount) {
+    if (showCount) {
+        this->writeErrorCount();
+    }
     fErrorCount = 0;
     String result = fErrorText;
+    fErrorText = "";
     return result;
 }