Skip to main content
deleted 9 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38

Clean, 386 375 216 196196 189 bytes

Look ma, no regex!

import StdEnv,Text,Data.List
?[_,'=':b]= $b
?b= $b
$['if(':s]#(h,[_:t])=span((<>)')')s
=h++['?': $t]?t]
$[';else ':s]=[':': $s]?s]
$[a:b]|b>[]=[a: $b]=b
@s=hd[[v,e:replaceSubString[v,e][]($s)]\\['else $s]\\['else ',v,e=:'=':_]<-tails s]

Try it online!Try it online!

Clean, 386 375 216 196 bytes

import StdEnv,Text,Data.List
$['if(':s]#(h,[_:t])=span((<>)')')s
=h++['?': $t]
$[';else ':s]=[':': $s]
$[a:b]|b>[]=[a: $b]=b
@s=hd[[v,e:replaceSubString[v,e][]($s)]\\['else ',v,e=:'=':_]<-tails s]

Try it online!

Clean, 386 375 216 196 189 bytes

Look ma, no regex!

import StdEnv,Data.List
?[_,'=':b]= $b
?b= $b
$['if(':s]#(h,[_:t])=span((<>)')')s
=h++['?': ?t]
$[';else ':s]=[':': ?s]
$[a:b]|b>[]=[a: $b]=b
@s=hd[[v,e: $s]\\['else ',v,e=:'=':_]<-tails s]

Try it online!

deleted 24 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38

Clean, 386 375 216 209196 bytes

import StdEnv,Text,Data.List
r=replaceSubString
$['if(':s]#(h,[_:t])=span((<>)')')s
=h++['?': $t]
$['else$[';else ':s]=[':': $s]
$[a:b]=[ab]|b>[]=[a: $b]
$e=e$b]=b
@s=hd[[v,'=']++r[ve:replaceSubString[v,'='][](r[';'][]e][]($s))\\['else]\\['else ',v,e=:'=':_]<-tails s]

Try it online!Try it online!

Clean, 386 375 216 209 bytes

import StdEnv,Text,Data.List
r=replaceSubString
$['if(':s]#(h,[_:t])=span((<>)')')s
=h++['?': $t]
$['else ':s]=[':': $s]
$[a:b]=[a: $b]
$e=e
@s=hd[[v,'=']++r[v,'='][](r[';'][]($s))\\['else ',v,'=':_]<-tails s]

Try it online!

Clean, 386 375 216 196 bytes

import StdEnv,Text,Data.List
$['if(':s]#(h,[_:t])=span((<>)')')s
=h++['?': $t]
$[';else ':s]=[':': $s]
$[a:b]|b>[]=[a: $b]=b
@s=hd[[v,e:replaceSubString[v,e][]($s)]\\['else ',v,e=:'=':_]<-tails s]

Try it online!

deleted 4 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38

Clean, 386 375 216216 209 bytes

import StdEnv,Text,Data.List
r=replaceSubString
$['if(':s]#(h,[_:t])=span((<>)')')s
=h++['?': $t]
$['else ':s]=[':': $s]
$[a:b]=[a: $b]
$[]=[]$e=e
@s#v=hd[v\\['else@s=hd[[v,'=']++r[v,'='][](r[';'][]($s))\\['else ',v,'=':_]<-tails s]
=[v,'=']++r[v,'='][](r[';'][]($s))

Try it online!Try it online!

Clean, 386 375 216 bytes

import StdEnv,Text,Data.List
r=replaceSubString
$['if(':s]#(h,[_:t])=span((<>)')')s
=h++['?': $t]
$['else ':s]=[':': $s]
$[a:b]=[a: $b]
$[]=[]
@s#v=hd[v\\['else ',v,'=':_]<-tails s]
=[v,'=']++r[v,'='][](r[';'][]($s))

Try it online!

Clean, 386 375 216 209 bytes

import StdEnv,Text,Data.List
r=replaceSubString
$['if(':s]#(h,[_:t])=span((<>)')')s
=h++['?': $t]
$['else ':s]=[':': $s]
$[a:b]=[a: $b]
$e=e
@s=hd[[v,'=']++r[v,'='][](r[';'][]($s))\\['else ',v,'=':_]<-tails s]

Try it online!

deleted 431 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38
Loading
deleted 4 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38
Loading
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38
Loading