Add full support for line continuation in the preprocessor

Re-landing earlier change with constant signedness fixed (was causing
build issues on Linux).

Line continuation in ESSL 3.00 needs to be processed before tokenization,
since tokens can span the line continuation. On the other hand, ANGLE's
tokenizer keeps track of line numbers, and whenever a line continuation
appears the line number still needs to be incremented by one, just like
on a regular newline.

That's why line continuation is now implemented as follows: when the
shader strings are concatenated in Input, they are also checked for line
continuation. Whenever line continuation is encountered, the string
is cut before that point. When the tokenizer asks for more input, the
string starting from the character after line continuation is passed
to it, and the line number is incremented from Input. This way the
tokenizer can parse tokens that span multiple lines - it never sees the
line continuation - but still keeps track of the line number correctly.

Relevant spec is in ESSL 3.00 section 3.2 "Source strings".

Support for line continuation also applies to ESSL 1.00. ESSL 3.00
spec section 1.5 says that line continuation support is mandated when
an ESSL 1.00 shader is used with the OpenGL ES 3.0 API, and is optional
when ESSL 1.00 is used with the OpenGL ES 2.0 API.

TEST=dEQP-GLES3.functional.shaders.preprocessor.line_continuation.*
     (all pass),
     angle_unittests
BUG=angleproject:1125

Change-Id: Ic086aacac53cd75bf93c0fda782416501d2f842b
Reviewed-on: https://chromium-review.googlesource.com/294200
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/preprocessor/Input.h b/src/compiler/preprocessor/Input.h
index e951cb4..a1de7dd 100644
--- a/src/compiler/preprocessor/Input.h
+++ b/src/compiler/preprocessor/Input.h
@@ -33,7 +33,7 @@
         return mLength[index];
     }
 
-    size_t read(char *buf, size_t maxSize);
+    size_t read(char *buf, size_t maxSize, int *lineNo);
 
     struct Location
     {
@@ -49,6 +49,10 @@
     const Location &readLoc() const { return mReadLoc; }
 
   private:
+    // Skip a character and return the next character after the one that was skipped.
+    // Return nullptr if data runs out.
+    const char *skipChar();
+
     // Input.
     size_t mCount;
     const char * const *mString;