ConstantExpr
  = ConstantFloat
  / ConstantInt
  / ConstantTrue
  / ConstantFalse
  / ConstantNull
  / ConstantString
  / ConstantArray
  / ConstantFetch

ConstantFloat
  = '-'? [0-9]+ '.' [0-9]* ConstantFloatExp?
  / '-'? [0-9]* '.' [0-9]+ ConstantFloatExp?
  / '-'? [0-9]+ ConstantFloatExp

ConstantFloatExp
  = [eE] '-'? [0-9]+

ConstantInt
  = '-'? [0-9]+

ConstantTrue
  = [tT][rR][uU][eE]

ConstantFalse
  = [fF][aA][lL][sS][eE]

ConstantNull
  = [nN][uU][lL][lL]

ConstantString
  = '\'' ( [^'\\] / '\\' . )* '\''
  / '"' ( [^"\\] / '\\' . )* '"'

ConstantArray
  = '[' ConstantArrayItems? ']'
  / 'array(' ConstantArrayItems? ')'

ConstantArrayItems
  = ConstantArrayItem (',' ConstantArrayItem)* ','?

ConstantArrayItem
  = ConstantExpr ('=>' ConstantExpr)?

ConstantFetch
  = Identifier '::' Word
  / Identifier

# TODO: ConstantOperation, i.e. ˙2 + 3˙
