In André Weil's dissertation, he considers two meromorphic functions $x,y$ on a complex curve. He assumes every pole of $y$ is a pole of $x$, and its multiplicity as a pole of $y$ is no greater than its multiplicity as a pole of $x$. Then he says there is some natural number $k$ and some complex $a\neq 0$ such that $$ay^k+xP(x,y)+Q(y)=0$$ where $P(x,y)$ and $Q(y)$ are polynomials in $x,y$ with degree $<k$.

I see the proof for genus 0 curves. There the field of meromorphic functions is $\mathbb{C}(z)$ and one-variable polynomial algebra suffices (unless I've made a mistake). But I do not see it for other curves. Can someone tell me how it is done?