def source
  '1*3.14*0x4ad.fp2'
end

def expected_tokens
  [
    {
      type: 'T_LITERAL_INTEGER_DECIMAL',
      value: '1'
    },
    {
      type: 'T_OPERATOR',
      value: '*'
    },
    {
      type: 'T_LITERAL_FLOATING_POINT_DECIMAL',
      value: '3.14'
    },
    {
      type: 'T_OPERATOR',
      value: '*'
    },
    {
      type: 'T_LITERAL_FLOATING_POINT_HEXADECIMAL',
      value: '0x4ad.fp2'
    }
  ]
end

def expected_ast
  {
    __type: 'program',
    body: [
      {
        __type: 'binary-expression',
        operator: '*',
        left: {
          __type: 'binary-expression',
          operator: '*',
          left: {
              __type: 'literal-integer',
              value: 1
          },
          right: {
              __type: 'literal-double',
              value: 3.140000000000000E+00
          }
        },
        right: {
          __type: 'literal-double',
          value: 4.791750000000000E+03
        }
      }
    ]
  }
end

load 'spec_builder.rb'
