def source
  '0b0001 & 0b0010 & 0b1001'
end

def expected_tokens
  [
    {
      type: 'T_LITERAL_INTEGER_BINARY',
      value: '0b0001'
    },
    {
      type: 'T_WHITESPACES',
      value: ' ',
    },
    {
      type: 'T_OPERATOR',
      value: '&'
    },
    {
      type: 'T_WHITESPACES',
      value: ' ',
    },
    {
      type: 'T_LITERAL_INTEGER_BINARY',
      value: '0b0010'
    },
    {
      type: 'T_WHITESPACES',
      value: ' ',
    },
    {
      type: 'T_OPERATOR',
      value: '&'
    },
    {
      type: 'T_WHITESPACES',
      value: ' ',
    },
    {
      type: 'T_LITERAL_INTEGER_BINARY',
      value: '0b1001'
    }
  ]
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-integer',
            value: 2
          }
        },
        right: {
          __type: 'literal-integer',
          value: 9
        }
      }
    ]
  }
end

load 'spec_builder.rb'
