Why does substracting -1 in shader fail for a float data type? I am loading a texture in a WebGL fragment shader (GLSL version 1.00).

This is my working code:

precision highp float;
uniform sampler2D u_texture;
varying float v_coord;

void main(void) {
  float inv_coord;
  gl_FragColor = texture2D(u_texture, vec2(v_coord, 0.5));
}


v_coord holds the texture coordinates for each vertex. What I'm trying now, is to invert the texture coordinates. I thought about something like abs(v_coord - 1). However, whenever I try to substract - 1 from v_coord, my shader fails to compile.

precision highp float;
uniform sampler2D u_texture;
varying float v_coord;

void main(void) {
  float inv_coord = v_coord - 1; // fails here
  inv_coord = abs(inv_coord);
  gl_FragColor = texture2D(u_texture, vec2(inv_coord, 0.5));
}


Why does substracting minus one in fragment shader fail for a float data type? How to invert the texture coordinate value correctly?
Without seeing the error message I can't be sure but I think it's failing on the 1 being int instead of a float. 

float inv_coord = v_coord - 1.0;


There is a simpler method, you can do 1.0 - v_coord and do away with the abs.