<commit_before>use std::cell::RefCell;
use std::fmt;

#[deriving(Clone)]
pub enum Global {
    GType(@RefCell<TypeInfo>),
    GComp(@RefCell<CompInfo>),
    GCompDecl(@RefCell<CompInfo>),
    GEnum(@RefCell<EnumInfo>),
    GEnumDecl(@RefCell<EnumInfo>),
    GVar(@RefCell<VarInfo>),
    GFunc(@RefCell<VarInfo>),
    GOther
}

impl Global {
    pub fn compinfo(&self) -> @RefCell<CompInfo> {
        match *self {
            GComp(i) => return i,
            GCompDecl(i) => return i,
            _ => fail!("global_compinfo".to_owned())
        }
    }

    pub fn enuminfo(&self) -> @RefCell<EnumInfo> {
        match *self {
            GEnum(i) => return i,
            GEnumDecl(i) => return i,
            _ => fail!("global_enuminfo".to_owned())
        }
    }

    pub fn typeinfo(&self) -> @RefCell<TypeInfo> {
        match *self {
            GType(i) => return i,
            _ => fail!("global_typeinfo".to_owned())
        }
    }

    pub fn varinfo(&self) -> @RefCell<VarInfo> {
        match *self {
            GVar(i) => i,
            GFunc(i) => i,
            _ => fail!("global_varinfo".to_owned())
        }
    }
}

impl fmt::Show for Global {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            GType(ti) => ti.borrow().fmt(f),
            GComp(ci) => ci.borrow().fmt(f),
            GCompDecl(ci) => ci.borrow().fmt(f),
            GEnum(ei) => ei.borrow().fmt(f),
            GEnumDecl(ei) => ei.borrow().fmt(f),
            GVar(vi) => vi.borrow().fmt(f),
            GFunc(vi) => vi.borrow().fmt(f),
            GOther => write!(f.buf, "*"),
        }
    }
}

#[deriving(Clone, Eq)]
pub enum Type {
    TVoid,
    TInt(IKind, Layout),<commit_msg>Fix travis build<commit_after>use std::cell::RefCell;
use std::fmt;

#[deriving(Clone)]
pub enum Global {
    GType(@RefCell<TypeInfo>),
    GComp(@RefCell<CompInfo>),
    GCompDecl(@RefCell<CompInfo>),
    GEnum(@RefCell<EnumInfo>),
    GEnumDecl(@RefCell<EnumInfo>),
    GVar(@RefCell<VarInfo>),
    GFunc(@RefCell<VarInfo>),
    GOther
}

impl Global {
    pub fn compinfo(&self) -> @RefCell<CompInfo> {
        match *self {
            GComp(i) => return i,
            GCompDecl(i) => return i,
            _ => fail!("global_compinfo".to_owned())
        }
    }

    pub fn enuminfo(&self) -> @RefCell<EnumInfo> {
        match *self {
            GEnum(i) => return i,
            GEnumDecl(i) => return i,
            _ => fail!("global_enuminfo".to_owned())
        }
    }

    pub fn typeinfo(&self) -> @RefCell<TypeInfo> {
        match *self {
            GType(i) => return i,
            _ => fail!("global_typeinfo".to_owned())
        }
    }

    pub fn varinfo(&self) -> @RefCell<VarInfo> {
        match *self {
            GVar(i) => i,
            GFunc(i) => i,
            _ => fail!("global_varinfo".to_owned())
        }
    }
}

impl fmt::Show for Global {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            GType(ti) => ti.borrow().fmt(f),
            GComp(ci) => ci.borrow().fmt(f),
            GCompDecl(ci) => ci.borrow().fmt(f),
            GEnum(ei) => ei.borrow().fmt(f),
            GEnumDecl(ei) => ei.borrow().fmt(f),
            GVar(vi) => vi.borrow().fmt(f),
            GFunc(vi) => vi.borrow().fmt(f),
            GOther => "*".fmt(f),
        }
    }
}

#[deriving(Clone, Eq)]
pub enum Type {
    TVoid,
    TInt(IKind, Layout),
{'fraction_non_alphanumeric': 0.17980797206866453, 'fraction_numerical': 0.0, 'mean_word_length': 1.984375, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 73, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4831942', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1213, 'n_words': 203}