|
@@ -163,9 +163,8 @@ impl SolangServer {
|
|
|
let res = self.client.publish_diagnostics(uri, diags, None);
|
|
let res = self.client.publish_diagnostics(uri, diags, None);
|
|
|
|
|
|
|
|
let mut lookup: Vec<HoverEntry> = Vec::new();
|
|
let mut lookup: Vec<HoverEntry> = Vec::new();
|
|
|
- let mut fnc_map: HashMap<String, String> = HashMap::new();
|
|
|
|
|
|
|
|
|
|
- SolangServer::traverse(&ns, &mut lookup, &mut fnc_map);
|
|
|
|
|
|
|
+ SolangServer::traverse(&ns, &mut lookup);
|
|
|
|
|
|
|
|
self.files.lock().await.insert(
|
|
self.files.lock().await.insert(
|
|
|
path,
|
|
path,
|
|
@@ -212,18 +211,17 @@ impl SolangServer {
|
|
|
stmt: &ast::Statement,
|
|
stmt: &ast::Statement,
|
|
|
lookup_tbl: &mut Vec<HoverEntry>,
|
|
lookup_tbl: &mut Vec<HoverEntry>,
|
|
|
symtab: &symtable::Symtable,
|
|
symtab: &symtable::Symtable,
|
|
|
- fnc_map: &HashMap<String, String>,
|
|
|
|
|
ns: &ast::Namespace,
|
|
ns: &ast::Namespace,
|
|
|
) {
|
|
) {
|
|
|
match stmt {
|
|
match stmt {
|
|
|
ast::Statement::Block { statements, .. } => {
|
|
ast::Statement::Block { statements, .. } => {
|
|
|
for stmt in statements {
|
|
for stmt in statements {
|
|
|
- SolangServer::construct_stmt(stmt, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_stmt(stmt, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Statement::VariableDecl(loc, var_no, param, expr) => {
|
|
ast::Statement::VariableDecl(loc, var_no, param, expr) => {
|
|
|
if let Some(exp) = expr {
|
|
if let Some(exp) = expr {
|
|
|
- SolangServer::construct_expr(exp, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(exp, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
let mut val = format!(
|
|
let mut val = format!(
|
|
|
"{} {}",
|
|
"{} {}",
|
|
@@ -234,7 +232,7 @@ impl SolangServer {
|
|
|
match expr {
|
|
match expr {
|
|
|
codegen::Expression::BytesLiteral(_, ast::Type::Bytes(_), bs)
|
|
codegen::Expression::BytesLiteral(_, ast::Type::Bytes(_), bs)
|
|
|
| codegen::Expression::BytesLiteral(_, ast::Type::DynamicBytes, bs) => {
|
|
| codegen::Expression::BytesLiteral(_, ast::Type::DynamicBytes, bs) => {
|
|
|
- write!(val, " = hex\"{}\"", hex::encode(&bs)).unwrap();
|
|
|
|
|
|
|
+ write!(val, " = hex\"{}\"", hex::encode(bs)).unwrap();
|
|
|
}
|
|
}
|
|
|
codegen::Expression::BytesLiteral(_, ast::Type::String, bs) => {
|
|
codegen::Expression::BytesLiteral(_, ast::Type::String, bs) => {
|
|
|
write!(val, " = \"{}\"", String::from_utf8_lossy(bs)).unwrap();
|
|
write!(val, " = \"{}\"", String::from_utf8_lossy(bs)).unwrap();
|
|
@@ -260,18 +258,18 @@ impl SolangServer {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
ast::Statement::If(_locs, _, expr, stat1, stat2) => {
|
|
ast::Statement::If(_locs, _, expr, stat1, stat2) => {
|
|
|
- SolangServer::construct_expr(expr, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr, lookup_tbl, symtab, ns);
|
|
|
for st1 in stat1 {
|
|
for st1 in stat1 {
|
|
|
- SolangServer::construct_stmt(st1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_stmt(st1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
for st2 in stat2 {
|
|
for st2 in stat2 {
|
|
|
- SolangServer::construct_stmt(st2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_stmt(st2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Statement::While(_locs, _blval, expr, stat1) => {
|
|
ast::Statement::While(_locs, _blval, expr, stat1) => {
|
|
|
- SolangServer::construct_expr(expr, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr, lookup_tbl, symtab, ns);
|
|
|
for st1 in stat1 {
|
|
for st1 in stat1 {
|
|
|
- SolangServer::construct_stmt(st1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_stmt(st1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Statement::For {
|
|
ast::Statement::For {
|
|
@@ -283,36 +281,36 @@ impl SolangServer {
|
|
|
body,
|
|
body,
|
|
|
} => {
|
|
} => {
|
|
|
if let Some(exp) = cond {
|
|
if let Some(exp) = cond {
|
|
|
- SolangServer::construct_expr(exp, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(exp, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
for stat in init {
|
|
for stat in init {
|
|
|
- SolangServer::construct_stmt(stat, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_stmt(stat, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
for stat in next {
|
|
for stat in next {
|
|
|
- SolangServer::construct_stmt(stat, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_stmt(stat, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
for stat in body {
|
|
for stat in body {
|
|
|
- SolangServer::construct_stmt(stat, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_stmt(stat, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Statement::DoWhile(_locs, _blval, stat1, expr) => {
|
|
ast::Statement::DoWhile(_locs, _blval, stat1, expr) => {
|
|
|
- SolangServer::construct_expr(expr, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr, lookup_tbl, symtab, ns);
|
|
|
for st1 in stat1 {
|
|
for st1 in stat1 {
|
|
|
- SolangServer::construct_stmt(st1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_stmt(st1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Statement::Expression(_locs, _, expr) => {
|
|
ast::Statement::Expression(_locs, _, expr) => {
|
|
|
- SolangServer::construct_expr(expr, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Statement::Delete(_locs, _typ, expr) => {
|
|
ast::Statement::Delete(_locs, _typ, expr) => {
|
|
|
- SolangServer::construct_expr(expr, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Statement::Destructure(_locs, _vecdestrfield, expr) => {
|
|
ast::Statement::Destructure(_locs, _vecdestrfield, expr) => {
|
|
|
- SolangServer::construct_expr(expr, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr, lookup_tbl, symtab, ns);
|
|
|
for vecstr in _vecdestrfield {
|
|
for vecstr in _vecdestrfield {
|
|
|
match vecstr {
|
|
match vecstr {
|
|
|
ast::DestructureField::Expression(expr) => {
|
|
ast::DestructureField::Expression(expr) => {
|
|
|
- SolangServer::construct_expr(expr, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
_ => continue,
|
|
_ => continue,
|
|
|
}
|
|
}
|
|
@@ -322,7 +320,7 @@ impl SolangServer {
|
|
|
ast::Statement::Break(_) => {}
|
|
ast::Statement::Break(_) => {}
|
|
|
ast::Statement::Return(_, None) => {}
|
|
ast::Statement::Return(_, None) => {}
|
|
|
ast::Statement::Return(_, Some(expr)) => {
|
|
ast::Statement::Return(_, Some(expr)) => {
|
|
|
- SolangServer::construct_expr(expr, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Statement::Emit {
|
|
ast::Statement::Emit {
|
|
|
event_no,
|
|
event_no,
|
|
@@ -363,20 +361,20 @@ impl SolangServer {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
for arg in args {
|
|
for arg in args {
|
|
|
- SolangServer::construct_expr(arg, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(arg, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Statement::TryCatch(_, _, try_stmt) => {
|
|
ast::Statement::TryCatch(_, _, try_stmt) => {
|
|
|
- SolangServer::construct_expr(&try_stmt.expr, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(&try_stmt.expr, lookup_tbl, symtab, ns);
|
|
|
for vecstmt in &try_stmt.catch_stmt {
|
|
for vecstmt in &try_stmt.catch_stmt {
|
|
|
- SolangServer::construct_stmt(vecstmt, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_stmt(vecstmt, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
for vecstmt in &try_stmt.ok_stmt {
|
|
for vecstmt in &try_stmt.ok_stmt {
|
|
|
- SolangServer::construct_stmt(vecstmt, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_stmt(vecstmt, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
for okstmt in &try_stmt.errors {
|
|
for okstmt in &try_stmt.errors {
|
|
|
for stmts in &okstmt.2 {
|
|
for stmts in &okstmt.2 {
|
|
|
- SolangServer::construct_stmt(stmts, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_stmt(stmts, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -393,7 +391,6 @@ impl SolangServer {
|
|
|
expr: &ast::Expression,
|
|
expr: &ast::Expression,
|
|
|
lookup_tbl: &mut Vec<HoverEntry>,
|
|
lookup_tbl: &mut Vec<HoverEntry>,
|
|
|
symtab: &symtable::Symtable,
|
|
symtab: &symtable::Symtable,
|
|
|
- fnc_map: &HashMap<String, String>,
|
|
|
|
|
ns: &ast::Namespace,
|
|
ns: &ast::Namespace,
|
|
|
) {
|
|
) {
|
|
|
match expr {
|
|
match expr {
|
|
@@ -431,17 +428,17 @@ impl SolangServer {
|
|
|
}
|
|
}
|
|
|
ast::Expression::StructLiteral(_locs, _typ, expr) => {
|
|
ast::Expression::StructLiteral(_locs, _typ, expr) => {
|
|
|
for expp in expr {
|
|
for expp in expr {
|
|
|
- SolangServer::construct_expr(expp, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expp, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Expression::ArrayLiteral(_locs, _, _arr, expr) => {
|
|
ast::Expression::ArrayLiteral(_locs, _, _arr, expr) => {
|
|
|
for expp in expr {
|
|
for expp in expr {
|
|
|
- SolangServer::construct_expr(expp, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expp, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Expression::ConstArrayLiteral(_locs, _, _arr, expr) => {
|
|
ast::Expression::ConstArrayLiteral(_locs, _, _arr, expr) => {
|
|
|
for expp in expr {
|
|
for expp in expr {
|
|
|
- SolangServer::construct_expr(expp, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expp, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -457,8 +454,8 @@ impl SolangServer {
|
|
|
),
|
|
),
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::Subtract(locs, ty, unchecked, expr1, expr2) => {
|
|
ast::Expression::Subtract(locs, ty, unchecked, expr1, expr2) => {
|
|
|
lookup_tbl.push(HoverEntry {
|
|
lookup_tbl.push(HoverEntry {
|
|
@@ -471,8 +468,8 @@ impl SolangServer {
|
|
|
),
|
|
),
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::Multiply(locs, ty, unchecked, expr1, expr2) => {
|
|
ast::Expression::Multiply(locs, ty, unchecked, expr1, expr2) => {
|
|
|
lookup_tbl.push(HoverEntry {
|
|
lookup_tbl.push(HoverEntry {
|
|
@@ -485,8 +482,8 @@ impl SolangServer {
|
|
|
),
|
|
),
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::Divide(locs, ty, expr1, expr2) => {
|
|
ast::Expression::Divide(locs, ty, expr1, expr2) => {
|
|
|
lookup_tbl.push(HoverEntry {
|
|
lookup_tbl.push(HoverEntry {
|
|
@@ -495,8 +492,8 @@ impl SolangServer {
|
|
|
val: format!("{} divide", ty.to_string(ns)),
|
|
val: format!("{} divide", ty.to_string(ns)),
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::Modulo(locs, ty, expr1, expr2) => {
|
|
ast::Expression::Modulo(locs, ty, expr1, expr2) => {
|
|
|
lookup_tbl.push(HoverEntry {
|
|
lookup_tbl.push(HoverEntry {
|
|
@@ -505,8 +502,8 @@ impl SolangServer {
|
|
|
val: format!("{} modulo", ty.to_string(ns)),
|
|
val: format!("{} modulo", ty.to_string(ns)),
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::Power(locs, ty, unchecked, expr1, expr2) => {
|
|
ast::Expression::Power(locs, ty, unchecked, expr1, expr2) => {
|
|
|
lookup_tbl.push(HoverEntry {
|
|
lookup_tbl.push(HoverEntry {
|
|
@@ -519,30 +516,30 @@ impl SolangServer {
|
|
|
),
|
|
),
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Bitwise expresion
|
|
// Bitwise expresion
|
|
|
ast::Expression::BitwiseOr(_locs, _typ, expr1, expr2) => {
|
|
ast::Expression::BitwiseOr(_locs, _typ, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::BitwiseAnd(_locs, _typ, expr1, expr2) => {
|
|
ast::Expression::BitwiseAnd(_locs, _typ, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::BitwiseXor(_locs, _typ, expr1, expr2) => {
|
|
ast::Expression::BitwiseXor(_locs, _typ, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::ShiftLeft(_locs, _typ, expr1, expr2) => {
|
|
ast::Expression::ShiftLeft(_locs, _typ, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::ShiftRight(_locs, _typ, expr1, expr2, _bl) => {
|
|
ast::Expression::ShiftRight(_locs, _typ, expr1, expr2, _bl) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Variable expression
|
|
// Variable expression
|
|
@@ -553,7 +550,7 @@ impl SolangServer {
|
|
|
match expr {
|
|
match expr {
|
|
|
codegen::Expression::BytesLiteral(_, ast::Type::Bytes(_), bs)
|
|
codegen::Expression::BytesLiteral(_, ast::Type::Bytes(_), bs)
|
|
|
| codegen::Expression::BytesLiteral(_, ast::Type::DynamicBytes, bs) => {
|
|
| codegen::Expression::BytesLiteral(_, ast::Type::DynamicBytes, bs) => {
|
|
|
- write!(val, " hex\"{}\"", hex::encode(&bs)).unwrap();
|
|
|
|
|
|
|
+ write!(val, " hex\"{}\"", hex::encode(bs)).unwrap();
|
|
|
}
|
|
}
|
|
|
codegen::Expression::BytesLiteral(_, ast::Type::String, bs) => {
|
|
codegen::Expression::BytesLiteral(_, ast::Type::String, bs) => {
|
|
|
write!(val, " \"{}\"", String::from_utf8_lossy(bs)).unwrap();
|
|
write!(val, " \"{}\"", String::from_utf8_lossy(bs)).unwrap();
|
|
@@ -597,129 +594,129 @@ impl SolangServer {
|
|
|
|
|
|
|
|
// Load expression
|
|
// Load expression
|
|
|
ast::Expression::Load(_locs, _typ, expr1) => {
|
|
ast::Expression::Load(_locs, _typ, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::StorageLoad(_locs, _typ, expr1) => {
|
|
ast::Expression::StorageLoad(_locs, _typ, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::ZeroExt(_locs, _typ, expr1) => {
|
|
ast::Expression::ZeroExt(_locs, _typ, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::SignExt(_locs, _typ, expr1) => {
|
|
ast::Expression::SignExt(_locs, _typ, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::Trunc(_locs, _typ, expr1) => {
|
|
ast::Expression::Trunc(_locs, _typ, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::Cast(_locs, _typ, expr1) => {
|
|
ast::Expression::Cast(_locs, _typ, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::BytesCast(_loc, _typ1, _typ2, expr) => {
|
|
ast::Expression::BytesCast(_loc, _typ1, _typ2, expr) => {
|
|
|
- SolangServer::construct_expr(expr, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//Increment-Decrement expression
|
|
//Increment-Decrement expression
|
|
|
ast::Expression::PreIncrement(_locs, _typ, _, expr1) => {
|
|
ast::Expression::PreIncrement(_locs, _typ, _, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::PreDecrement(_locs, _typ, _, expr1) => {
|
|
ast::Expression::PreDecrement(_locs, _typ, _, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::PostIncrement(_locs, _typ, _, expr1) => {
|
|
ast::Expression::PostIncrement(_locs, _typ, _, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::PostDecrement(_locs, _typ, _, expr1) => {
|
|
ast::Expression::PostDecrement(_locs, _typ, _, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::Assign(_locs, _typ, expr1, expr2) => {
|
|
ast::Expression::Assign(_locs, _typ, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Compare expression
|
|
// Compare expression
|
|
|
ast::Expression::More(_locs, expr1, expr2) => {
|
|
ast::Expression::More(_locs, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::Less(_locs, expr1, expr2) => {
|
|
ast::Expression::Less(_locs, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::MoreEqual(_locs, expr1, expr2) => {
|
|
ast::Expression::MoreEqual(_locs, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::LessEqual(_locs, expr1, expr2) => {
|
|
ast::Expression::LessEqual(_locs, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::Equal(_locs, expr1, expr2) => {
|
|
ast::Expression::Equal(_locs, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::NotEqual(_locs, expr1, expr2) => {
|
|
ast::Expression::NotEqual(_locs, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ast::Expression::Not(_locs, expr1) => {
|
|
ast::Expression::Not(_locs, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::Complement(_locs, _typ, expr1) => {
|
|
ast::Expression::Complement(_locs, _typ, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::UnaryMinus(_locs, _typ, expr1) => {
|
|
ast::Expression::UnaryMinus(_locs, _typ, expr1) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ast::Expression::Ternary(_locs, _typ, expr1, expr2, expr3) => {
|
|
ast::Expression::Ternary(_locs, _typ, expr1, expr2, expr3) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr3, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr3, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ast::Expression::Subscript(_locs, _, _, expr1, expr2) => {
|
|
ast::Expression::Subscript(_locs, _, _, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ast::Expression::StructMember(_locs, _typ, expr1, _val) => {
|
|
ast::Expression::StructMember(_locs, _typ, expr1, _val) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Array operation expression
|
|
// Array operation expression
|
|
|
ast::Expression::AllocDynamicArray(_locs, _typ, expr1, _valvec) => {
|
|
ast::Expression::AllocDynamicArray(_locs, _typ, expr1, _valvec) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::StorageArrayLength { array, .. } => {
|
|
ast::Expression::StorageArrayLength { array, .. } => {
|
|
|
- SolangServer::construct_expr(array, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(array, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// String operations expression
|
|
// String operations expression
|
|
|
ast::Expression::StringCompare(_locs, _strloc1, _strloc2) => {
|
|
ast::Expression::StringCompare(_locs, _strloc1, _strloc2) => {
|
|
|
if let ast::StringLocation::RunTime(expr1) = _strloc1 {
|
|
if let ast::StringLocation::RunTime(expr1) = _strloc1 {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
if let ast::StringLocation::RunTime(expr2) = _strloc1 {
|
|
if let ast::StringLocation::RunTime(expr2) = _strloc1 {
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Expression::StringConcat(_locs, _typ, _strloc1, _strloc2) => {
|
|
ast::Expression::StringConcat(_locs, _typ, _strloc1, _strloc2) => {
|
|
|
if let ast::StringLocation::RunTime(expr1) = _strloc1 {
|
|
if let ast::StringLocation::RunTime(expr1) = _strloc1 {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
if let ast::StringLocation::RunTime(expr2) = _strloc1 {
|
|
if let ast::StringLocation::RunTime(expr2) = _strloc1 {
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ast::Expression::Or(_locs, expr1, expr2) => {
|
|
ast::Expression::Or(_locs, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
ast::Expression::And(_locs, expr1, expr2) => {
|
|
ast::Expression::And(_locs, expr1, expr2) => {
|
|
|
- SolangServer::construct_expr(expr1, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(expr2, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr1, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(expr2, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Function call expression
|
|
// Function call expression
|
|
@@ -764,7 +761,7 @@ impl SolangServer {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for arg in args {
|
|
for arg in args {
|
|
|
- SolangServer::construct_expr(arg, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(arg, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Expression::ExternalFunctionCall {
|
|
ast::Expression::ExternalFunctionCall {
|
|
@@ -812,15 +809,15 @@ impl SolangServer {
|
|
|
val,
|
|
val,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- SolangServer::construct_expr(address, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(address, lookup_tbl, symtab, ns);
|
|
|
for expp in args {
|
|
for expp in args {
|
|
|
- SolangServer::construct_expr(expp, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expp, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
if let Some(value) = &call_args.value {
|
|
if let Some(value) = &call_args.value {
|
|
|
- SolangServer::construct_expr(value, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(value, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
if let Some(gas) = &call_args.gas {
|
|
if let Some(gas) = &call_args.gas {
|
|
|
- SolangServer::construct_expr(gas, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(gas, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -830,13 +827,13 @@ impl SolangServer {
|
|
|
call_args,
|
|
call_args,
|
|
|
..
|
|
..
|
|
|
} => {
|
|
} => {
|
|
|
- SolangServer::construct_expr(args, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
- SolangServer::construct_expr(address, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(args, lookup_tbl, symtab, ns);
|
|
|
|
|
+ SolangServer::construct_expr(address, lookup_tbl, symtab, ns);
|
|
|
if let Some(value) = &call_args.value {
|
|
if let Some(value) = &call_args.value {
|
|
|
- SolangServer::construct_expr(value, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(value, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
if let Some(gas) = &call_args.gas {
|
|
if let Some(gas) = &call_args.gas {
|
|
|
- SolangServer::construct_expr(gas, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(gas, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Expression::Constructor {
|
|
ast::Expression::Constructor {
|
|
@@ -847,19 +844,19 @@ impl SolangServer {
|
|
|
call_args,
|
|
call_args,
|
|
|
} => {
|
|
} => {
|
|
|
if let Some(gas) = &call_args.gas {
|
|
if let Some(gas) = &call_args.gas {
|
|
|
- SolangServer::construct_expr(gas, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(gas, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
for expp in args {
|
|
for expp in args {
|
|
|
- SolangServer::construct_expr(expp, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expp, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
if let Some(optval) = &call_args.value {
|
|
if let Some(optval) = &call_args.value {
|
|
|
- SolangServer::construct_expr(optval, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(optval, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
if let Some(optsalt) = &call_args.salt {
|
|
if let Some(optsalt) = &call_args.salt {
|
|
|
- SolangServer::construct_expr(optsalt, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(optsalt, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
if let Some(space) = &call_args.space {
|
|
if let Some(space) = &call_args.space {
|
|
|
- SolangServer::construct_expr(space, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(space, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Expression::Builtin(_locs, _typ, _builtin, expr) => {
|
|
ast::Expression::Builtin(_locs, _typ, _builtin, expr) => {
|
|
@@ -870,17 +867,17 @@ impl SolangServer {
|
|
|
val,
|
|
val,
|
|
|
});
|
|
});
|
|
|
for expp in expr {
|
|
for expp in expr {
|
|
|
- SolangServer::construct_expr(expp, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expp, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Expression::FormatString(_, sections) => {
|
|
ast::Expression::FormatString(_, sections) => {
|
|
|
for (_, e) in sections {
|
|
for (_, e) in sections {
|
|
|
- SolangServer::construct_expr(e, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(e, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ast::Expression::List(_locs, expr) => {
|
|
ast::Expression::List(_locs, expr) => {
|
|
|
for expp in expr {
|
|
for expp in expr {
|
|
|
- SolangServer::construct_expr(expp, lookup_tbl, symtab, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expp, lookup_tbl, symtab, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
_ => {}
|
|
_ => {}
|
|
@@ -892,7 +889,6 @@ impl SolangServer {
|
|
|
contvar: &ast::Variable,
|
|
contvar: &ast::Variable,
|
|
|
lookup_tbl: &mut Vec<HoverEntry>,
|
|
lookup_tbl: &mut Vec<HoverEntry>,
|
|
|
samptb: &symtable::Symtable,
|
|
samptb: &symtable::Symtable,
|
|
|
- fnc_map: &HashMap<String, String>,
|
|
|
|
|
ns: &ast::Namespace,
|
|
ns: &ast::Namespace,
|
|
|
) {
|
|
) {
|
|
|
let val = format!(
|
|
let val = format!(
|
|
@@ -906,7 +902,7 @@ impl SolangServer {
|
|
|
val,
|
|
val,
|
|
|
});
|
|
});
|
|
|
if let Some(expr) = &contvar.initializer {
|
|
if let Some(expr) = &contvar.initializer {
|
|
|
- SolangServer::construct_expr(expr, lookup_tbl, samptb, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_expr(expr, lookup_tbl, samptb, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -925,11 +921,7 @@ impl SolangServer {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Traverses namespace to build messages stored in the lookup table for hover feature.
|
|
// Traverses namespace to build messages stored in the lookup table for hover feature.
|
|
|
- fn traverse(
|
|
|
|
|
- ns: &ast::Namespace,
|
|
|
|
|
- lookup_tbl: &mut Vec<HoverEntry>,
|
|
|
|
|
- fnc_map: &mut HashMap<String, String>,
|
|
|
|
|
- ) {
|
|
|
|
|
|
|
+ fn traverse(ns: &ast::Namespace, lookup_tbl: &mut Vec<HoverEntry>) {
|
|
|
for enm in &ns.enums {
|
|
for enm in &ns.enums {
|
|
|
for (nam, vals) in &enm.values {
|
|
for (nam, vals) in &enm.values {
|
|
|
let val = format!("{} {}, \n\n", nam, vals.1);
|
|
let val = format!("{} {}, \n\n", nam, vals.1);
|
|
@@ -988,13 +980,13 @@ impl SolangServer {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for stmt in &fnc.body {
|
|
for stmt in &fnc.body {
|
|
|
- SolangServer::construct_stmt(stmt, lookup_tbl, &fnc.symtable, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_stmt(stmt, lookup_tbl, &fnc.symtable, ns);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for constant in &ns.constants {
|
|
for constant in &ns.constants {
|
|
|
let samptb = symtable::Symtable::new();
|
|
let samptb = symtable::Symtable::new();
|
|
|
- SolangServer::construct_cont(constant, lookup_tbl, &samptb, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_cont(constant, lookup_tbl, &samptb, ns);
|
|
|
|
|
|
|
|
let val = render(&constant.tags[..]);
|
|
let val = render(&constant.tags[..]);
|
|
|
lookup_tbl.push(HoverEntry {
|
|
lookup_tbl.push(HoverEntry {
|
|
@@ -1014,7 +1006,7 @@ impl SolangServer {
|
|
|
|
|
|
|
|
for varscont in &contrct.variables {
|
|
for varscont in &contrct.variables {
|
|
|
let samptb = symtable::Symtable::new();
|
|
let samptb = symtable::Symtable::new();
|
|
|
- SolangServer::construct_cont(varscont, lookup_tbl, &samptb, fnc_map, ns);
|
|
|
|
|
|
|
+ SolangServer::construct_cont(varscont, lookup_tbl, &samptb, ns);
|
|
|
|
|
|
|
|
let val = render(&varscont.tags[..]);
|
|
let val = render(&varscont.tags[..]);
|
|
|
lookup_tbl.push(HoverEntry {
|
|
lookup_tbl.push(HoverEntry {
|