Mercurial > octave-nkf
comparison src/symtab.cc @ 5049:b65ec179786f
[project @ 2004-10-18 17:47:15 by jwe]
author | jwe |
---|---|
date | Mon, 18 Oct 2004 17:47:15 +0000 |
parents | a9f7f67e2b6e |
children | d54d44f2f29a |
comparison
equal
deleted
inserted
replaced
5048:a9f7f67e2b6e | 5049:b65ec179786f |
---|---|
1353 { | 1353 { |
1354 std::stringstream ss1, ss2; | 1354 std::stringstream ss1, ss2; |
1355 std::string str; | 1355 std::string str; |
1356 | 1356 |
1357 str = symbols(i)->name (); | 1357 str = symbols(i)->name (); |
1358 param_length(pos_n) = ((str.length () > static_cast<size_t> (param_length(pos_n))) ? | 1358 param_length(pos_n) = ((str.length () |
1359 str.length () : param_length(pos_n)); | 1359 > static_cast<size_t> (param_length(pos_n))) |
1360 ? str.length () : param_length(pos_n)); | |
1360 | 1361 |
1361 str = symbols(i)->type_name (); | 1362 str = symbols(i)->type_name (); |
1362 param_length(pos_t) = ((str.length () > static_cast<size_t> (param_length(pos_t))) ? | 1363 param_length(pos_t) = ((str.length () |
1363 str.length () : param_length(pos_t)); | 1364 > static_cast<size_t> (param_length(pos_t))) |
1365 ? str.length () : param_length(pos_t)); | |
1364 | 1366 |
1365 elements1 = symbols(i)->numel (); | 1367 elements1 = symbols(i)->numel (); |
1366 ss1 << elements1; | 1368 ss1 << elements1; |
1367 str = ss1.str (); | 1369 str = ss1.str (); |
1368 param_length(pos_e) = ((str.length () > static_cast<size_t> (param_length(pos_e))) ? | 1370 param_length(pos_e) = ((str.length () |
1369 str.length () : param_length(pos_e)); | 1371 > static_cast<size_t> (param_length(pos_e))) |
1372 ? str.length () : param_length(pos_e)); | |
1370 | 1373 |
1371 bytes1 = symbols(i)->byte_size (); | 1374 bytes1 = symbols(i)->byte_size (); |
1372 ss2 << bytes1; | 1375 ss2 << bytes1; |
1373 str = ss2.str (); | 1376 str = ss2.str (); |
1374 param_length(pos_b) = ((str.length () > static_cast<size_t> (param_length(pos_b))) ? | 1377 param_length(pos_b) = ((str.length () |
1375 str.length () : param_length (pos_b)); | 1378 > static_cast<size_t> (param_length(pos_b))) |
1379 ? str.length () : param_length (pos_b)); | |
1376 } | 1380 } |
1377 | 1381 |
1378 idx = 0; | 1382 idx = 0; |
1379 while (static_cast<size_t> (idx) < format_len) | 1383 while (static_cast<size_t> (idx) < format_len) |
1380 { | 1384 { |
1424 pos = param_string.find (param.command); | 1428 pos = param_string.find (param.command); |
1425 if (pos != NPOS) | 1429 if (pos != NPOS) |
1426 { | 1430 { |
1427 param.parameter_length = param_length(pos); | 1431 param.parameter_length = param_length(pos); |
1428 param.text = param_names(pos); | 1432 param.text = param_names(pos); |
1429 param.line.assign (param_names (pos).length (), '='); | 1433 param.line.assign (param_names(pos).length (), '='); |
1430 | 1434 |
1431 param.parameter_length = (a > param.parameter_length ? | 1435 param.parameter_length = (a > param.parameter_length |
1432 a : param.parameter_length); | 1436 ? a : param.parameter_length); |
1433 if((param.command == 's') && (param.modifier == 'c') && (b > 0)) | 1437 if (param.command == 's' && param.modifier == 'c' && b > 0) |
1434 { | |
1435 param.first_parameter_length = b; | 1438 param.first_parameter_length = b; |
1436 } | |
1437 } | 1439 } |
1438 else | 1440 else |
1439 { | 1441 { |
1440 error ("whos_line_format: '%c' is not a command", | 1442 error ("whos_line_format: '%c' is not a command", |
1441 param.command); | 1443 param.command); |
1487 error_encountered = true; | 1489 error_encountered = true; |
1488 } | 1490 } |
1489 | 1491 |
1490 // What happens if whos_line_format contains negative numbers | 1492 // What happens if whos_line_format contains negative numbers |
1491 // at param_length positions? | 1493 // at param_length positions? |
1492 param.balance = ((b < 0) ? 0 : param.balance); | 1494 param.balance = (b < 0 ? 0 : param.balance); |
1493 param.first_parameter_length = ((b < 0) ? 0 : | 1495 param.first_parameter_length = (b < 0 ? 0 : |
1494 param.first_parameter_length); | 1496 param.first_parameter_length); |
1495 param.parameter_length = ((a < 0) ? 0 : | 1497 param.parameter_length = (a < 0 |
1496 (param.parameter_length < | 1498 ? 0 |
1497 param_length (pos_s)) ? | 1499 : (param.parameter_length |
1498 param_length (pos_s) : | 1500 < param_length(pos_s) |
1499 param.parameter_length); | 1501 ? param_length(pos_s) |
1502 : param.parameter_length)); | |
1500 | 1503 |
1501 // Parameter will not be pushed into parameter list if ... | 1504 // Parameter will not be pushed into parameter list if ... |
1502 if (! error_encountered) | 1505 if (! error_encountered) |
1503 params.push_back (param); | 1506 params.push_back (param); |
1504 } | 1507 } |