Skip to main content
Post Made Community Wiki by C. K. Young
Source Link
Peter Taylor
  • 43.1k
  • 4
  • 70
  • 169

Change the lexer

GolfScript's lexer treats a Ruby identifier (anything which matches the regex [_a-zA-Z][_a-zA-Z0-9]*) as a single token. If it instead treated [a-zA-Z]+ as a token that would free up _ to be a built-in and would allow an alpha variable to be followed by a literal integer without separating whitespace.