aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-05-28 22:28:26 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-05-29 22:24:29 -0700
commit5bf1b0e5f500b6b99a866da32dd9002219cac6d6 (patch)
tree4622863e7f28ad7f840d6a7096057286aee4e750 /src/parser.cpp
parent3d19b549c8d9fc77597d0de95260e90f5dda2dae (diff)
fix random lint issues
This only eliminates errors reported by `make lint`. It shouldn't cause any functional changes. This change does remove several functions that are unused. It also removes the `desc_arr` variable which is both unused and out of date with reality.
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 90211df1..86026f80 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -75,7 +75,7 @@ class io_chain_t;
/// Unknown block description.
#define UNKNOWN_BLOCK N_(L"unknown/invalid block")
-/// Datastructure to describe a block type, like while blocks, command substitution blocks, etc.
+/// Data structure to describe a block type, like while blocks, command substitution blocks, etc.
struct block_lookup_entry {
// The block type id. The legal values are defined in parser.h.
block_type_t type;
@@ -225,6 +225,8 @@ const wchar_t *parser_t::get_block_desc(int block) const {
return _(UNKNOWN_BLOCK);
}
+#if 0
+// TODO: Lint says this isn't used (which is true). Should this be removed?
wcstring parser_t::block_stack_description() const {
wcstring result;
size_t idx = this->block_count();
@@ -241,6 +243,7 @@ wcstring parser_t::block_stack_description() const {
}
return result;
}
+#endif
const block_t *parser_t::block_at_index(size_t idx) const {
// Zero corresponds to the last element in our vector.
@@ -253,11 +256,7 @@ block_t *parser_t::block_at_index(size_t idx) {
return idx < count ? block_stack.at(count - idx - 1) : NULL;
}
-const block_t *parser_t::current_block() const {
- return block_stack.empty() ? NULL : block_stack.back();
-}
-
-block_t *parser_t::current_block() { return block_stack.empty() ? NULL : block_stack.back(); }
+block_t *const parser_t::current_block() { return block_stack.empty() ? NULL : block_stack.back(); }
void parser_t::forbid_function(const wcstring &function) { forbidden_function.push_back(function); }