summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-06-21 17:49:38 +0100
committerJohn Wiegley <johnw@newartisans.com>2009-06-21 17:49:38 +0100
commit7287aad336161eb9a143f188c92d462e62051374 (patch)
tree9454bf16a1b769bd9acf8897e93b3153939e8cad /src
parentadd2ffd5f34e8c68edcc95f9d0dbf6de11224ba1 (diff)
downloadfork-ledger-7287aad336161eb9a143f188c92d462e62051374.tar.gz
fork-ledger-7287aad336161eb9a143f188c92d462e62051374.tar.bz2
fork-ledger-7287aad336161eb9a143f188c92d462e62051374.zip
Revert "Added % suffix operator, as in "$1.00 * 10%""
This reverts commit 0e9f782a05ab9bc892af40abef84346a16d3baec.
Diffstat (limited to 'src')
-rw-r--r--src/commodity.cc4
-rw-r--r--src/parser.cc15
-rw-r--r--src/token.cc5
-rw-r--r--src/token.h2
4 files changed, 4 insertions, 22 deletions
diff --git a/src/commodity.cc b/src/commodity.cc
index e69758f0..095912dd 100644
--- a/src/commodity.cc
+++ b/src/commodity.cc
@@ -501,14 +501,14 @@ void commodity_t::parse_symbol(std::istream& in, string& symbol)
{
// Invalid commodity characters:
// SPACE, TAB, NEWLINE, RETURN
- // 0-9 . , ; - + * / ^ ? : & | ! = %
+ // 0-9 . , ; - + * / ^ ? : & | ! =
// < > { } [ ] ( ) @
static int invalid_chars[256] = {
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0,
/* 10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- /* 20 */ 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
+ /* 20 */ 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
/* 30 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* 40 */ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 50 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0,
diff --git a/src/parser.cc b/src/parser.cc
index 1c78e30d..39004758 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -44,23 +44,10 @@ expr_t::parser_t::parse_value_term(std::istream& in,
token_t& tok = next_token(in, tflags);
switch (tok.kind) {
- case token_t::VALUE: {
+ case token_t::VALUE:
node = new op_t(op_t::VALUE);
node->set_value(tok.value);
-
- token_t& postfix_tok = next_token(in, tflags.plus_flags(PARSE_OP_CONTEXT));
- if (postfix_tok.kind == token_t::PERCENT) {
- ptr_op_t prev(node);
- node = new op_t(op_t::O_DIV);
- node->set_left(prev);
- ptr_op_t hundred = new op_t(op_t::VALUE);
- hundred->set_value(100L);
- node->set_right(hundred);
- } else {
- push_token(postfix_tok);
- }
break;
- }
case token_t::IDENT: {
string ident = tok.value.as_string();
diff --git a/src/token.cc b/src/token.cc
index d173c7ec..fde6a0e3 100644
--- a/src/token.cc
+++ b/src/token.cc
@@ -278,11 +278,6 @@ void expr_t::token_t::next(std::istream& in, const uint_least8_t pflags)
kind = STAR;
break;
- case '%':
- in.get(c);
- kind = PERCENT;
- break;
-
case '?':
in.get(c);
kind = QUERY;
diff --git a/src/token.h b/src/token.h
index 85374f6e..a9b75dd4 100644
--- a/src/token.h
+++ b/src/token.h
@@ -84,9 +84,9 @@ struct expr_t::token_t : public noncopyable
KW_DIV, // div
EXCLAM, // !, not
- PERCENT, // %
KW_AND, // &, &&, and
KW_OR, // |, ||, or
+ KW_MOD, // %
KW_IF, // if
KW_ELSE, // else