Move the value expression code into libamounts, since it really belongs with
value_t, rather than the rest of Ledger proper.
This commit is contained in:
parent
4518ea9540
commit
d073a7e8a5
2 changed files with 12 additions and 12 deletions
20
Makefile.am
20
Makefile.am
|
|
@ -14,12 +14,18 @@ lib_LTLIBRARIES = libamounts.la libledger.la
|
||||||
|
|
||||||
libamounts_la_CPPFLAGS =
|
libamounts_la_CPPFLAGS =
|
||||||
libamounts_la_SOURCES = \
|
libamounts_la_SOURCES = \
|
||||||
|
utils.cc \
|
||||||
|
times.cc \
|
||||||
|
mask.cc \
|
||||||
amount.cc \
|
amount.cc \
|
||||||
commodity.cc \
|
commodity.cc \
|
||||||
balance.cc \
|
balance.cc \
|
||||||
value.cc \
|
value.cc \
|
||||||
times.cc \
|
token.cc \
|
||||||
utils.cc
|
parser.cc \
|
||||||
|
op.cc \
|
||||||
|
expr.cc \
|
||||||
|
scope.cc
|
||||||
if HAVE_EXPAT
|
if HAVE_EXPAT
|
||||||
libamounts_la_CPPFLAGS += -DHAVE_EXPAT=1
|
libamounts_la_CPPFLAGS += -DHAVE_EXPAT=1
|
||||||
endif
|
endif
|
||||||
|
|
@ -38,12 +44,6 @@ endif
|
||||||
|
|
||||||
libledger_la_CPPFLAGS = $(libamounts_la_CPPFLAGS)
|
libledger_la_CPPFLAGS = $(libamounts_la_CPPFLAGS)
|
||||||
libledger_la_SOURCES = \
|
libledger_la_SOURCES = \
|
||||||
mask.cc \
|
|
||||||
token.cc \
|
|
||||||
parser.cc \
|
|
||||||
op.cc \
|
|
||||||
expr.cc \
|
|
||||||
scope.cc \
|
|
||||||
format.cc \
|
format.cc \
|
||||||
\
|
\
|
||||||
journal.cc \
|
journal.cc \
|
||||||
|
|
@ -81,8 +81,9 @@ pkginclude_HEADERS = \
|
||||||
balance.h \
|
balance.h \
|
||||||
balpair.h \
|
balpair.h \
|
||||||
value.h \
|
value.h \
|
||||||
times.h \
|
|
||||||
utils.h \
|
utils.h \
|
||||||
|
times.h \
|
||||||
|
mask.h \
|
||||||
error.h \
|
error.h \
|
||||||
\
|
\
|
||||||
expr.h \
|
expr.h \
|
||||||
|
|
@ -92,7 +93,6 @@ pkginclude_HEADERS = \
|
||||||
scope.h \
|
scope.h \
|
||||||
predicate.h \
|
predicate.h \
|
||||||
format.h \
|
format.h \
|
||||||
mask.h \
|
|
||||||
\
|
\
|
||||||
journal.h \
|
journal.h \
|
||||||
report.h \
|
report.h \
|
||||||
|
|
|
||||||
4
op.cc
4
op.cc
|
|
@ -702,12 +702,12 @@ value_t expr_t::op_t::calc(scope_t& scope)
|
||||||
ptr_op_t def = func->compile(scope);
|
ptr_op_t def = func->compile(scope);
|
||||||
if (def == func)
|
if (def == func)
|
||||||
throw_(calc_error,
|
throw_(calc_error,
|
||||||
"Attempt to call unknown function '" << name << "'");
|
"Calling unknown function '" << name << "'");
|
||||||
func = def;
|
func = def;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (func->kind != FUNCTION)
|
if (func->kind != FUNCTION)
|
||||||
throw_(calc_error, "Attempt to call non-function");
|
throw_(calc_error, "Calling non-function");
|
||||||
|
|
||||||
return func->as_function()(call_args);
|
return func->as_function()(call_args);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue