lib/TextParser.rb in taskjuggler-0.0.8 vs lib/TextParser.rb in taskjuggler-0.0.9
- old
+ new
@@ -1,11 +1,12 @@
#!/usr/bin/env ruby -w
# encoding: UTF-8
#
# = TextParser.rb -- The TaskJuggler III Project Management Software
#
-# Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
+# Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011
+# by Chris Schlaeger <chris@linux.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
@@ -381,10 +382,14 @@
if state.pattern.function
# Make the token values and their SourceFileInfo available.
@val = stackEntry.val
@sourceFileInfo = stackEntry.sourceFileInfo
# Now call the pattern action to compute the value of the pattern.
- result = state.pattern.function.call
+ begin
+ result = state.pattern.function.call
+ rescue AttributeOverwrite
+ @scanner.warning('attr_overwrite', $!.to_s)
+ end
end
# We use the SourceFileInfo of the first token of the pattern to store
# it with the result of the pattern.
firstSourceFileInfo = stackEntry.firstSourceFileInfo