diff options
author | Jeff Ames | 2009-09-29 08:32:59 +0900 |
---|---|---|
committer | Jeff Ames | 2009-09-29 08:32:59 +0900 |
commit | f00126dc2dfc9e23aa50227f02ee9adbe1efdfa6 (patch) | |
tree | 47e63f1f5f5b7e48f19cabc4c5685c4d58ff1697 /OpenSim/Region/ScriptEngine/Shared/CodeTools | |
parent | More reordering (diff) | |
download | opensim-SC_OLD-f00126dc2dfc9e23aa50227f02ee9adbe1efdfa6.zip opensim-SC_OLD-f00126dc2dfc9e23aa50227f02ee9adbe1efdfa6.tar.gz opensim-SC_OLD-f00126dc2dfc9e23aa50227f02ee9adbe1efdfa6.tar.bz2 opensim-SC_OLD-f00126dc2dfc9e23aa50227f02ee9adbe1efdfa6.tar.xz |
Add copyright header. Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 5a94957..fe26429 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -546,11 +546,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
546 | bool retried = false; | 546 | bool retried = false; |
547 | do | 547 | do |
548 | { | 548 | { |
549 | lock (CScodeProvider) | 549 | lock (CScodeProvider) |
550 | { | 550 | { |
551 | results = CScodeProvider.CompileAssemblyFromSource( | 551 | results = CScodeProvider.CompileAssemblyFromSource( |
552 | parameters, Script); | 552 | parameters, Script); |
553 | } | 553 | } |
554 | // Deal with an occasional segv in the compiler. | 554 | // Deal with an occasional segv in the compiler. |
555 | // Rarely, if ever, occurs twice in succession. | 555 | // Rarely, if ever, occurs twice in succession. |
556 | // Line # == 0 and no file name are indications that | 556 | // Line # == 0 and no file name are indications that |
@@ -573,20 +573,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
573 | { | 573 | { |
574 | complete = true; | 574 | complete = true; |
575 | } | 575 | } |
576 | } | 576 | } while (!complete); |
577 | while(!complete); | ||
578 | break; | 577 | break; |
579 | case enumCompileType.js: | 578 | case enumCompileType.js: |
580 | results = JScodeProvider.CompileAssemblyFromSource( | 579 | results = JScodeProvider.CompileAssemblyFromSource( |
581 | parameters, Script); | 580 | parameters, Script); |
582 | break; | 581 | break; |
583 | case enumCompileType.yp: | 582 | case enumCompileType.yp: |
584 | results = YPcodeProvider.CompileAssemblyFromSource( | 583 | results = YPcodeProvider.CompileAssemblyFromSource( |
585 | parameters, Script); | 584 | parameters, Script); |
586 | break; | 585 | break; |
587 | default: | 586 | default: |
588 | throw new Exception("Compiler is not able to recongnize "+ | 587 | throw new Exception("Compiler is not able to recongnize "+ |
589 | "language type \"" + lang.ToString() + "\""); | 588 | "language type \"" + lang.ToString() + "\""); |
590 | } | 589 | } |
591 | 590 | ||
592 | // Check result | 591 | // Check result |
@@ -602,12 +601,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
602 | { | 601 | { |
603 | foreach (CompilerError CompErr in results.Errors) | 602 | foreach (CompilerError CompErr in results.Errors) |
604 | { | 603 | { |
605 | 604 | string severity = CompErr.IsWarning ? "Warning" : "Error"; | |
606 | string severity = "Error"; | ||
607 | if (CompErr.IsWarning) | ||
608 | { | ||
609 | severity = "Warning"; | ||
610 | } | ||
611 | 605 | ||
612 | KeyValuePair<int, int> lslPos; | 606 | KeyValuePair<int, int> lslPos; |
613 | 607 | ||
@@ -615,18 +609,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
615 | 609 | ||
616 | if (severity == "Error") | 610 | if (severity == "Error") |
617 | { | 611 | { |
618 | lslPos = FindErrorPosition(CompErr.Line, CompErr.Column); | 612 | lslPos = FindErrorPosition(CompErr.Line, CompErr.Column); |
619 | string text = CompErr.ErrorText; | 613 | string text = CompErr.ErrorText; |
620 | 614 | ||
621 | // Use LSL type names | 615 | // Use LSL type names |
622 | if (lang == enumCompileType.lsl) | 616 | if (lang == enumCompileType.lsl) |
623 | text = ReplaceTypes(CompErr.ErrorText); | 617 | text = ReplaceTypes(CompErr.ErrorText); |
624 | 618 | ||
625 | // The Second Life viewer's script editor begins | 619 | // The Second Life viewer's script editor begins |
626 | // countingn lines and columns at 0, so we subtract 1. | 620 | // countingn lines and columns at 0, so we subtract 1. |
627 | errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", | 621 | errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", |
628 | lslPos.Key - 1, lslPos.Value - 1, | 622 | lslPos.Key - 1, lslPos.Value - 1, |
629 | CompErr.ErrorNumber, text, severity); | 623 | CompErr.ErrorNumber, text, severity); |
630 | hadErrors = true; | 624 | hadErrors = true; |
631 | } | 625 | } |
632 | } | 626 | } |