Skip to content

Instantly share code, notes, and snippets.

@166MMX
Created July 24, 2017 18:42
Show Gist options
  • Save 166MMX/5c03ac2c6d589a954ab6a9b7681382ef to your computer and use it in GitHub Desktop.
Save 166MMX/5c03ac2c6d589a954ab6a9b7681382ef to your computer and use it in GitHub Desktop.
Python to Groovy syntax
/^(?!\n)(\s*)#/ => '$1//'
/u"(([^"]|\\")*)"/ => "'$1'"
/(if|while|for|elif|except)\s+([^\n{]+):/ => '$1 ($2):'
/:\s*\n((\s+)[^\n]*?\n+(\n*\2[^\n]*\n)*)/ => '{\n$1}'
/raise/ => 'throw new'
/except/ => 'catch'
/elif/ => 'else if'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment