/// Resolve pragma. We don't do anything with pragmas for now
Resolve pragma. We don't do anything with pragmas for now
Resolve pragma . We don ' t do anything with pragmas for now
fn resolve_pragma(name: &pt::Identifier, value: &pt::StringLiteral, ns: &mut ast::Namespace) {
    if name.name == "solidity" {
        ns.diagnostics.push(ast::Diagnostic::debug(
            pt::Loc(name.loc.0, name.loc.1, value.loc.2),
            "pragma ‘solidity’ is ignored".to_string(),
        ));
    } else if name.name == "experimental" && value.string == "ABIEncoderV2" {
        ns.diagnostics.push(ast::Diagnostic::debug(
            pt::Loc(name.loc.0, name.loc.1, value.loc.2),
            "pragma ‘experimental’ with value ‘ABIEncoderV2’ is ignored".to_string(),
        ));
    } else if name.name == "abicoder" && value.string == "v2" {
        ns.diagnostics.push(ast::Diagnostic::debug(
            pt::Loc(name.loc.0, name.loc.1, value.loc.2),
            "pragma ‘abicoder’ with value ‘v2’ is ignored".to_string(),
        ));
    } else {
        ns.diagnostics.push(ast::Diagnostic::warning(
            pt::Loc(name.loc.0, name.loc.1, value.loc.2),
            format!(
                "unknown pragma ‘{}’ with value ‘{}’ ignored",
                name.name, value.string
            ),
        ));
    }
}
fn resolve_pragma ( name : & pt :: Identifier , value : & pt :: StringLiteral , ns : & mut ast :: Namespace ) { if name . name == " " { ns . diagnostics . push ( ast :: Diagnostic :: debug ( pt :: Loc ( name . loc . 0 , name . loc . 1 , value . loc . 2 ) , " _ s tring(), ) ) ; } else if name . name == " " && value . string == " " { ns . diagnostics . push ( ast :: Diagnostic :: debug ( pt :: Loc ( name . loc . 0 , name . loc . 1 , value . loc . 2 ) , " i n g(), ) ) ; } else if name . name == " " && value . string == " " { ns . diagnostics . push ( ast :: Diagnostic :: debug ( pt :: Loc ( name . loc . 0 , name . loc . 1 , value . loc . 2 ) , " i n g(), ) ) ; } else { ns . diagnostics . push ( ast :: Diagnostic :: warning ( pt :: Loc ( name . loc . 0 , name . loc . 1 , value . loc . 2 ) , format ! ( " name name value string ) , ) ) ; } }
Resolve pragma.
Resolve pragma .
name
&pt::Identifier
value
&pt::StringLiteral
ns
&mut ast::Namespace