src/format.cpp

changeset 124
a7b769a0e537
parent 119
bdf8d46c145f
child 133
dbbdb870c835
--- a/src/format.cpp	Sun Mar 30 22:50:25 2014 +0300
+++ b/src/format.cpp	Fri May 02 20:37:27 2014 +0300
@@ -31,7 +31,8 @@
 #include "format.h"
 #include "lexer.h"
 
-// =============================================================================
+//
+// Throws an error while formatting the string
 //
 static void formatError (String fmtstr, const String errdescribe, int pos)
 {
@@ -46,7 +47,9 @@
 	throw std::logic_error (errmsg.stdString());
 }
 
-// =============================================================================
+//
+// Main formatter algorithm function. Processes @fmtstr with @args and returns
+// the result.
 //
 String formatArgs (const String& fmtstr, const std::vector<String>& args)
 {
@@ -99,9 +102,11 @@
 	return fmt;
 }
 
-// =============================================================================
 //
-void error (String msg)
+// Throws a runtime error with the message @msg. If a lexer is active, its
+// position is printed as well.
+//
+void error (const String& msg)
 {
 	Lexer* lx = Lexer::getCurrentLexer();
 	String fileinfo;

mercurial