- 
                Notifications
    You must be signed in to change notification settings 
- Fork 25
WI #2012 Add diagnostic on PIC X to Numeric with usage #2017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            7 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      985841b
              
                WI #2012 Create a diagnostic on MOVE from PIC X to a numeric with an …
              
              
                delevoye 5057cde
              
                WI #2012 Change diagnostic message and add test
              
              
                delevoye 1947872
              
                WI #2012 Correct tests failed because of new diagnostic
              
              
                delevoye fca8d7e
              
                Merge branch 'develop' into 2012_AddDiagnosticOnPicXToNumericWithUsage
              
              
                delevoye 4e76053
              
                WI #2012 Shorten diagnostic message and remove cast to use StorageAre…
              
              
                delevoye 260178e
              
                WI#2012 Use else if because StorageAreaKind are exclusive
              
              
                delevoye 949cc3b
              
                Merge branch 'develop' into 2012_AddDiagnosticOnPicXToNumericWithUsage
              
              
                delevoye File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            54 changes: 54 additions & 0 deletions
          
          54 
        
  TypeCobol.Test/Parser/Programs/Cobol85/MoveAlphanumericToNumeric.rdz.cbl
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
|  IDENTIFICATION DIVISION. | ||
| PROGRAM-ID. Pgm. | ||
| DATA DIVISION. | ||
| WORKING-STORAGE SECTION. | ||
| 01 alpha pic X(03). | ||
| 01 alpha2 pic X(03). | ||
|  | ||
| 01 num1 pic 9(03). | ||
| 01 num2 comp-1. | ||
| 01 num3 comp-2. | ||
| 01 num4 pic 9(03) comp-3. | ||
| 01 num5 pic 9(03) comp-4. | ||
| 01 num6 pic 9(03) comp-5. | ||
| 01 num7 pic 9(03) packed-decimal. | ||
| 01 num8 pic 9(03) binary. | ||
| 01 num9 pic 9(03) comp. | ||
|  | ||
| PROCEDURE DIVISION. | ||
|  | ||
| * Ok | ||
| move alpha to alpha2 | ||
| * Ok because num1 is an extended numeric | ||
| move alpha to num1 | ||
| * Ok as it is not a numeric | ||
| move alpha to num2 | ||
| * Ok as it is not a numeric | ||
| move alpha to num3 | ||
|  | ||
| * Ko because it is a comp variable | ||
| move alpha to num4 | ||
| * Ko because it is a comp variable | ||
| move alpha to num5 | ||
| * Ko because it is a comp variable | ||
| move alpha to num6 | ||
| * Ko because it is a comp variable | ||
| move alpha to num7 | ||
| * Ko because it is a comp variable | ||
| move alpha to num8 | ||
| * Ko because it is a comp variable | ||
| move alpha to num9 | ||
|  | ||
| * Ok because it is a function | ||
| move FUNCTION WHEN-COMPILED to num4 | ||
| * Ok because it is a function | ||
| move FUNCTION CURRENT-DATE to num4 | ||
| * Ok because it is a function | ||
| move LENGTH alpha to num4 | ||
| * Ok because it is a function | ||
| move LENGTH OF alpha to num4 | ||
|  | ||
| GOBACK | ||
| . | ||
|  | ||
| END PROGRAM Pgm. | 
        
          
          
            60 changes: 60 additions & 0 deletions
          
          60 
        
  TypeCobol.Test/Parser/Programs/Cobol85/MoveAlphanumericToNumeric.rdzMix.txt
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
|  IDENTIFICATION DIVISION. | ||
| PROGRAM-ID. Pgm. | ||
| DATA DIVISION. | ||
| WORKING-STORAGE SECTION. | ||
| 01 alpha pic X(03). | ||
| 01 alpha2 pic X(03). | ||
|  | ||
| 01 num1 pic 9(03). | ||
| 01 num2 comp-1. | ||
| 01 num3 comp-2. | ||
| 01 num4 pic 9(03) comp-3. | ||
| 01 num5 pic 9(03) comp-4. | ||
| 01 num6 pic 9(03) comp-5. | ||
| 01 num7 pic 9(03) packed-decimal. | ||
| 01 num8 pic 9(03) binary. | ||
| 01 num9 pic 9(03) comp. | ||
|  | ||
| PROCEDURE DIVISION. | ||
|  | ||
| * Ok | ||
| move alpha to alpha2 | ||
| * Ok because num1 is an extended numeric | ||
| move alpha to num1 | ||
| * Ok as it is not a numeric | ||
| move alpha to num2 | ||
| * Ok as it is not a numeric | ||
| move alpha to num3 | ||
|  | ||
| * Ko because it is a comp variable | ||
| Line 30[12,38] <37, Warning, General> - Warning: Moving alphanumeric 'alpha' to numeric 'num4' declared with an USAGE may lead to unexpected results. | ||
| move alpha to num4 | ||
| * Ko because it is a comp variable | ||
| Line 32[12,38] <37, Warning, General> - Warning: Moving alphanumeric 'alpha' to numeric 'num5' declared with an USAGE may lead to unexpected results. | ||
| move alpha to num5 | ||
| * Ko because it is a comp variable | ||
| Line 34[12,38] <37, Warning, General> - Warning: Moving alphanumeric 'alpha' to numeric 'num6' declared with an USAGE may lead to unexpected results. | ||
| move alpha to num6 | ||
| * Ko because it is a comp variable | ||
| Line 36[12,38] <37, Warning, General> - Warning: Moving alphanumeric 'alpha' to numeric 'num7' declared with an USAGE may lead to unexpected results. | ||
| move alpha to num7 | ||
| * Ko because it is a comp variable | ||
| Line 38[12,38] <37, Warning, General> - Warning: Moving alphanumeric 'alpha' to numeric 'num8' declared with an USAGE may lead to unexpected results. | ||
| move alpha to num8 | ||
| * Ko because it is a comp variable | ||
| Line 40[12,38] <37, Warning, General> - Warning: Moving alphanumeric 'alpha' to numeric 'num9' declared with an USAGE may lead to unexpected results. | ||
| move alpha to num9 | ||
|  | ||
| * Ok because it is a function | ||
| move FUNCTION WHEN-COMPILED to num4 | ||
| * Ok because it is a function | ||
| move FUNCTION CURRENT-DATE to num4 | ||
| * Ok because it is a function | ||
| move LENGTH alpha to num4 | ||
| * Ok because it is a function | ||
| move LENGTH OF alpha to num4 | ||
|  | ||
| GOBACK | ||
| . | ||
|  | ||
| END PROGRAM Pgm. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.