def null_type
      if nullability = @input.scan(/[?!]/)
        @out << nullability
      end

      if @input.check(/\(/)
        return false unless union_type
      elsif @input.check(/\{/)
        return false unless record_type
      elsif @input.check(/function\(/)
        return false unless function_type
      elsif @input.check(/['"]/)
        return false unless string_literal
      elsif @input.check(/[\d-]/)
        return false unless number_literal
      else
        return false unless type_name
      end

      while @input.scan(/\[\]/)
        @out << "[]"
      end

      true
    end
def null_type
      if nullability = @input.scan(/[?!]/)
        @out << nullability
      end

      if @input.check(/\(/)
        return false unless union_type
      elsif @input.check(/\{/)
        return false unless record_type
      elsif @input.check(/function\(/)
        return false unless function_type
      elsif @input.check(/['"]/)
        return false unless string_literal
      elsif @input.check(/[\d-]/)
        return false unless number_literal
      else
        return false unless type_name
      end

      while @input.scan(/\[\]/)
        @out << "[]"
      end

      true
    end
<null-type> ::= [ "?" | "!" ] <array-type>

     <array-type> ::= <atomic-type> [ "[]" ]*

     <atomic-type> ::= <union-type> | <record-type> | <function-type> | <string-literal> | <type-name>