Ticket #194: compile-cs.patch
File compile-cs.patch, 4.1 KB (added by hopscc, 15 years ago) |
---|
-
Source/Phases/ParsePhase.cobra
32 32 modules.add(module) 33 33 34 34 didError = false 35 ncsfiles = 0 35 36 for filename in .compiler.pathsToCompile 36 37 if filename.endsWith('.cs') 37 38 if .verbosity, print 'Noting [filename]' # extra space to line up with 'Parsing [filename]' 38 39 modules.add(SharpModule(filename, .verbosity)) 40 ncsfiles += 1 39 41 else 40 42 parser = CobraParser() 41 43 parser.verbosity = .verbosity … … 56 58 modules.add(module) 57 59 assert modules.count or didError 58 60 compiler.modules.addRange(modules) 61 if ncsfiles == modules.count # all modules are .cs 62 compiler.noCobraSources 59 63 _parsedModules = nil 60 64 61 65 def parseCommandLineArgsCallBack(args as IList<of String>, isAvailable as out bool) as String? -
Source/Phases/IdentifyMainPhase.cobra
13 13 def innerRun is override 14 14 c = .compiler 15 15 16 if c.mainMethodTypeName == 'noCobraSources' 17 c.mainMethodTypeName = '' 18 return 16 19 if .options.getDefault('target', '') to String in {'lib', 'module'}, return 17 20 if .options.getDefault('test', '') <> '', return 18 21 if c.mainMethodTypeName <> '', return … … 21 24 typeName = .options.getDefault('main', '') to String 22 25 mainList = MainCollector().collect(c, typeName) 23 26 if mainList.count == 0 24 .recordError('Cannot find a "main" method.') 27 detail = if(typeName.length, 'in [typeName]','') 28 .recordError('Cannot find a "main" method [detail].') 25 29 return 26 30 if mainList.count > 1 27 31 first = true -
Source/Compiler.cobra
465 465 p.startInfo.arguments = args 466 466 return p 467 467 468 def noCobraSources 469 """ Do special processing for no Cobra Sources. """ 470 # force any specified main method class to short circuit cobra source scanning 471 .mainMethodTypeName = .options.getDefault('main', 'noCobraSources') 472 468 473 ## 469 474 ## ITypeProvider 470 475 ## -
Tests/700-command-line/hello-cobra.cs
1 // compiled by 880-compile-cs.cobra 2 using System; 3 4 class Hello: Object 5 { 6 public static void Main() { 7 System.Console.WriteLine("Hello - csharp compiled by cobra"); 8 } 9 } -
Tests/700-command-line/880-compile-cs.cobra
1 use System.Diagnostics 2 3 class TestCS 4 5 def main is shared 6 TestCS().run 7 8 def run 9 10 bar = '-------------------------------------------------------------------' 11 output = .runCobraExe('hello-cobra.cs') 12 try 13 assert 'Hello' in output 14 assert 'csharp' in output 15 assert 'csharp compiled by cobra' in output 16 finally 17 print bar 18 print output 19 print bar 20 21 22 def runCobraExe(args as String) as String 23 p as System.Diagnostics.Process? 24 return CobraCore.runCobraExe(args, out p) -
Developer/IntermediateReleaseNotes.text
431 431 * Fixed: An uncaught exception can occur for some library calls. 432 432 433 433 * Fixed: Cannot instantiate generic params under some circumstances. 434 435 * Fixed: Unable compile csharp only sources: ticket:194