fn exprpos(pos: &Pos) -> Expr {
    if pos.is_none() || !pos.is_valid() {
        null_literal(pos.clone())
    } else {
        let ((start_lnum, start_bol, start_cnum), (end_lnum, end_bol, end_cnum)) =
            pos.to_start_and_end_lnum_bol_cnum();

        let fields = vec![
            (
                "path",
                Expr::new(
                    (),
                    pos.clone(),
                    Expr_::Id(Box::new(make_id(pos.clone(), "__FILE__"))),
                ),
            ),
            ("start_line", int_literal(pos.clone(), start_lnum)),
            ("end_line", int_literal(pos.clone(), end_lnum)),
            (
                "start_column",
                int_literal(pos.clone(), start_cnum - start_bol),
            ),
            ("end_column", int_literal(pos.clone(), end_cnum - end_bol)),
        ];

        shape_literal(pos, fields)
    }
}
/// Given a Pos, returns a shape literal expression representing it.
///
/// ```
/// shape(
///   'path' => __FILE__,
///   'start_line' => 1,
///   'end_line' => 10,
///   'start_column' => 0,
///   'end_column' => 80,
/// )
/// ```
///
/// If this Pos is Pos.none or invalid, return a literal null instead.
Given a Pos, returns a shape literal expression representing it.

If this Pos is Pos.none or invalid, return a literal null instead.
Given a Pos returns a shape literal expression representing it . If this Pos is Pos . none or invalid return a literal null instead .
fn exprpos(pos: &Pos) -> Expr {
    if pos.is_none() || !pos.is_valid() {
        null_literal(pos.clone())
    } else {
        let ((start_lnum, start_bol, start_cnum), (end_lnum, end_bol, end_cnum)) =
            pos.to_start_and_end_lnum_bol_cnum();
        let fields = vec![
            (
                "path",
                Expr::new(
                    (),
                    pos.clone(),
                    Expr_::Id(Box::new(make_id(pos.clone(), "__FILE__"))),
                ),
            ),
            ("start_line", int_literal(pos.clone(), start_lnum)),
            ("end_line", int_literal(pos.clone(), end_lnum)),
            (
                "start_column",
                int_literal(pos.clone(), start_cnum - start_bol),
            ),
            ("end_column", int_literal(pos.clone(), end_cnum - end_bol)),
        ];
        shape_literal(pos, fields)
    }
}
fn exprpos ( pos : & Pos ) -> Expr { if pos . is_none ( ) || ! pos . is_valid ( ) { null_literal ( pos . clone ( ) ) } else { let ( ( start_lnum , start_bol , start_cnum ) , ( end_lnum , end_bol , end_cnum ) ) = pos . to_start_and_end_lnum_bol_cnum ( ) ; let fields = vec ! [ ( " " Expr new ( ( ) pos clone ( ) Expr_ Id ( Box new ( make_id ( pos clone ( ) " " ) ) ) ) ) ( " " int_literal ( pos clone ( ) start_lnum ) ) ( " " int_literal ( pos clone ( ) end_lnum ) ) ( " " int_literal ( pos clone ( ) start_cnum start_bol ) ) ( " " int_literal ( pos clone ( ) end_cnum end_bol ) ) ] ; shape_literal ( pos , fields ) } }
Given a Pos, returns a shape literal expression representing it.
Given a Pos returns a shape literal expression representing it .
pos
&Pos
pos
&Pos