mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Adjust line number before/after #calc{} scanner for improved error messages.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
dictionaryTest.C
|
||||
|
||||
calcEntry/calcEntryParser.ATG
|
||||
calcEntry/calcEntryParser.atg
|
||||
calcEntry/calcEntryInternal.C
|
||||
calcEntry/calcEntry.C
|
||||
|
||||
|
||||
@ -68,17 +68,23 @@ bool Foam::functionEntries::calcEntry::execute
|
||||
myErrorHandler("calcEntryInternal::Parser");
|
||||
|
||||
calcEntryInternal::Scanner scanner(iss);
|
||||
|
||||
// set the starting line
|
||||
scanner.Line(is.lineNumber());
|
||||
|
||||
calcEntryInternal::Parser parser(&scanner, &myErrorHandler);
|
||||
|
||||
// Attach dictionary context
|
||||
parser.dict(parentDict);
|
||||
|
||||
// Attach scalar functions
|
||||
// parser.functions(parentDict);
|
||||
|
||||
parser.Parse();
|
||||
|
||||
// make a small input list to contain the answer
|
||||
// mostly have an extra newline in the lookahead token
|
||||
// so subtract 1 to keep things vaguely in sync
|
||||
// (this is still far from perfect)
|
||||
is.lineNumber() = scanner.Line() - 1;
|
||||
|
||||
// a small input list to contain the answer
|
||||
tokenList tokens(2);
|
||||
tokens[0] = parser.Result();
|
||||
tokens[1] = token::END_STATEMENT;
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
.SUFFIXES: .ATG
|
||||
# handie Coco/R attributed grammars
|
||||
|
||||
ATGtoo = Coco -single -frames $(WM_THIRD_PARTY_DIR)/coco-r/src $$SOURCE -o $(OBJECTS_DIR) ; $(CC) $(c++FLAGS) -c $*.cpp -o $@
|
||||
.SUFFIXES: .atg
|
||||
|
||||
.ATG.dep:
|
||||
atgtoo = Coco -single -frames $(WM_THIRD_PARTY_DIR)/coco-cpp/src $$SOURCE -o $(OBJECTS_DIR) ; $(CC) $(c++FLAGS) -c $*.cpp -o $@
|
||||
|
||||
.atg.dep:
|
||||
$(MAKE_DEP)
|
||||
|
||||
Reference in New Issue
Block a user