summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-04-16 09:11:24 +0200
committerAraq <rumpf_a@web.de>2011-04-16 09:11:24 +0200
commite487c0a2491fcc144cb47b54597a320e2bf79866 (patch)
treeba6c6789ca82eb69873005a88d18630cffcff2f7 /compiler
parentcd292568d775d55d9abb51e962882ecda12c03a9 (diff)
downloadNim-e487c0a2491fcc144cb47b54597a320e2bf79866.tar.gz
better error message for invalid module names
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/main.nim2
-rwxr-xr-xcompiler/msgs.nim2
2 files changed, 3 insertions, 1 deletions
diff --git a/compiler/main.nim b/compiler/main.nim
index 11a139144..bd429cad9 100755
--- a/compiler/main.nim
+++ b/compiler/main.nim
@@ -56,7 +56,7 @@ proc newModule(filename: string): PSym =
   result.kind = skModule
   result.name = getIdent(splitFile(filename).name)
   if not isNimrodIdentifier(result.name.s):
-    rawMessage(errIdentifierExpected, result.name.s)
+    rawMessage(errInvalidModuleName, result.name.s)
   
   result.owner = result       # a module belongs to itself
   result.info = newLineInfo(filename, 1, 1)
diff --git a/compiler/msgs.nim b/compiler/msgs.nim
index 97d4179da..56fe88a9f 100755
--- a/compiler/msgs.nim
+++ b/compiler/msgs.nim
@@ -19,6 +19,7 @@ type
     errTabulatorsAreNotAllowed, errInvalidToken, errLineTooLong, 
     errInvalidNumber, errNumberOutOfRange, errNnotAllowedInCharacter, 
     errClosingBracketExpected, errMissingFinalQuote, errIdentifierExpected, 
+    errInvalidModuleName,
     errOperatorExpected, errTokenExpected, errStringAfterIncludeExpected, 
     errRecursiveDependencyX, errOnOrOffExpected, errNoneSpeedOrSizeExpected, 
     errInvalidPragma, errUnknownPragma, errInvalidDirectiveX, 
@@ -119,6 +120,7 @@ const
     errClosingBracketExpected: "closing ']' expected, but end of file reached", 
     errMissingFinalQuote: "missing final \'", 
     errIdentifierExpected: "identifier expected, but found \'$1\'", 
+    errInvalidModuleName: "invalid module name: '$1'",
     errOperatorExpected: "operator expected, but found \'$1\'", 
     errTokenExpected: "\'$1\' expected", 
     errStringAfterIncludeExpected: "string after \'include\' expected",