diff --git a/ToDo.txt b/ToDo.txt
index cb22fec..dd88ac7 100644
--- a/ToDo.txt
+++ b/ToDo.txt
@@ -29,4 +29,5 @@
12.) implement formatter with preferences.
13.) figure out how to implement a resource finder and locator for other rexxes that are called.
14.) add support for USS.
- 15.) Fix bad implementations.
\ No newline at end of file
+ 15.) Fix bad implementations.
+ 16.) Fix tokenization to go off of current value of color property. (dynamc updating)
\ No newline at end of file
diff --git a/bin/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor$1.class b/bin/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor$1.class
index e17a7f3..4305190 100644
Binary files a/bin/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor$1.class and b/bin/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor$1.class differ
diff --git a/bin/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.class b/bin/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.class
index 41f8059..aa2e472 100644
Binary files a/bin/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.class and b/bin/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.class differ
diff --git a/bin/org/imperfectmommy/rexxeditor/contentassist/RexxFunctionProposalData.class b/bin/org/imperfectmommy/rexxeditor/contentassist/RexxFunctionProposalData.class
index 222d9cf..8e974c4 100644
Binary files a/bin/org/imperfectmommy/rexxeditor/contentassist/RexxFunctionProposalData.class and b/bin/org/imperfectmommy/rexxeditor/contentassist/RexxFunctionProposalData.class differ
diff --git a/bin/org/imperfectmommy/rexxeditor/editors/ColorManager.class b/bin/org/imperfectmommy/rexxeditor/editors/ColorManager.class
index a72a8be..4de0926 100644
Binary files a/bin/org/imperfectmommy/rexxeditor/editors/ColorManager.class and b/bin/org/imperfectmommy/rexxeditor/editors/ColorManager.class differ
diff --git a/bin/org/imperfectmommy/rexxeditor/editors/RexxEditor.class b/bin/org/imperfectmommy/rexxeditor/editors/RexxEditor.class
index 06243af..a2e1414 100644
Binary files a/bin/org/imperfectmommy/rexxeditor/editors/RexxEditor.class and b/bin/org/imperfectmommy/rexxeditor/editors/RexxEditor.class differ
diff --git a/resources/configuration/FunctionDefinitions.json b/resources/configuration/FunctionDefinitions.json
index ba6c5eb..868d3ef 100644
--- a/resources/configuration/FunctionDefinitions.json
+++ b/resources/configuration/FunctionDefinitions.json
@@ -198,7 +198,7 @@
"pattern": "BITAND(String1,String2)",
"returnValue": {
"type": "String",
- "description": "Returns the String that is a result of binary ANDing String1 and String2 together. The AND starts at the far left and continues until the shorter of the two strings is exausted the length of the returned string is that of the longest passed in String."
+ "description": "Returns the String that is a result of binary ANDing String1 and String2 together. The AND starts at the far left and continues until the shorter of the two strings is exausted. The length of the returned string is that of the longest passed in String."
},
"variables": [
{
@@ -228,7 +228,7 @@
"pattern": "BITAND(String1,String2,Pad)",
"returnValue": {
"type": "String",
- "description": "Returns the String that is a result of binary ANDing String1 and String2 together with PAD applied to the shorter string until it equals the length of the longer String. The AND starts at the far left and continues until the shorter of the two strings is exausted the length of the returned string is that of the longest passed in String."
+ "description": "Returns the String that is a result of binary ANDing String1 and String2 together with PAD applied to the shorter string until it equals the length of the longer String. The AND starts at the far left and continues until the shorter of the two strings is exausted. The length of the returned string is that of the longest passed in String."
},
"variables": [
{
@@ -261,6 +261,707 @@
],
"additionalInfo": ""
},
+ {
+ "pattern": "BITOR(String1)",
+ "returnValue": {
+ "type": "String",
+ "description": "Returns the String passed into the function unmodified."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String1",
+ "offsets": [
+ 6
+ ],
+ "variableDescription": "The String to return from the function."
+ }
+ ],
+ "examples": [
+ "BITOR('73'x) == '73'x"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "BITOR(String1,String2)",
+ "returnValue": {
+ "type": "String",
+ "description": "Returns the String that is a result of binary ORing String1 and String2 together. The OR starts at the far left and continues until the shorter of the two strings is exausted. The length of the returned string is that of the longest passed in String."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String1",
+ "offsets": [
+ 6
+ ],
+ "variableDescription": "The String to OR with String2."
+ },
+ {
+ "type": "String",
+ "defaultValue": "String2",
+ "offsets": [
+ 14
+ ],
+ "variableDescription": "The String to OR with String1."
+ }
+ ],
+ "examples": [
+ "BITOR('15'x,'24'x) == '35'x",
+ "BITOR('15'x,'2456'x) == '3556'x"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "BITOR(String1,String2,Pad)",
+ "returnValue": {
+ "type": "String",
+ "description": "Returns the String that is a result of binary ORing String1 and String2 together with PAD applied to the shorter string until it equals the length of the longer String. The OR starts at the far left and continues until the shorter of the two strings is exausted. The length of the returned string is that of the longest passed in String."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String1",
+ "offsets": [
+ 6
+ ],
+ "variableDescription": "The String to OR with String2."
+ },
+ {
+ "type": "String",
+ "defaultValue": "String2",
+ "offsets": [
+ 14
+ ],
+ "variableDescription": "The String to OR with String1."
+ },
+ {
+ "type": "String",
+ "defaultValue": "Pad",
+ "offsets": [
+ 22
+ ],
+ "variableDescription": "The Padding to be applied to the shorter string before the OR is perfromed."
+ }
+ ],
+ "examples": [
+ "BITOR('15'x,'2456'x,'F0'x) == '35F6'x",
+ "BITOR('1111'x,,'4D'x) == '5D5D'x"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "BITXOR(String1)",
+ "returnValue": {
+ "type": "String",
+ "description": "Returns the String passed into the function unmodified."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String1",
+ "offsets": [
+ 7
+ ],
+ "variableDescription": "The String to return from the function."
+ }
+ ],
+ "examples": [
+ "BITXOR('12'x) == '12'x"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "BITXOR(String1,String2)",
+ "returnValue": {
+ "type": "String",
+ "description": "Returns the String that is a result of binary XORing String1 and String2 together. The XOR starts at the far left and continues until the shorter of the two strings is exausted. The length of the returned string is that of the longest passed in String."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String1",
+ "offsets": [
+ 7
+ ],
+ "variableDescription": "The String to XOR with String2."
+ },
+ {
+ "type": "String",
+ "defaultValue": "String2",
+ "offsets": [
+ 15
+ ],
+ "variableDescription": "The String to XOR with String1."
+ }
+ ],
+ "examples": [
+ "BITXOR('12'x,'22'x) == '30'x",
+ "BITXOR('1211'x,'22'x) == '3011'x",
+ "BITXOR('1111'x,'444444'x) == '555544'x"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "BITXOR(String1,String2,Pad)",
+ "returnValue": {
+ "type": "String",
+ "description": "Returns the String that is a result of binary XORing String1 and String2 together with PAD applied to the shorter string until it equals the length of the longer String. The XOR starts at the far left and continues until the shorter of the two strings is exausted. The length of the returned string is that of the longest passed in String."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String1",
+ "offsets": [
+ 7
+ ],
+ "variableDescription": "The String to XOR with String2."
+ },
+ {
+ "type": "String",
+ "defaultValue": "String2",
+ "offsets": [
+ 15
+ ],
+ "variableDescription": "The String to XOR with String1."
+ },
+ {
+ "type": "String",
+ "defaultValue": "Pad",
+ "offsets": [
+ 23
+ ],
+ "variableDescription": "The Padding to be aplied to the shorter string before the XOR is perfromed."
+ }
+ ],
+ "examples": [
+ "BITXOR('1111'x,'444444'x,'40'x) == '555504'x",
+ "BITXOR('1111'x,,'4D'x) == '5C5C'x"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "B2X(binary-string)",
+ "returnValue": {
+ "type": "String",
+ "description": "The hexadecimal value that the passed in binary String represents."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "binary-string",
+ "offsets": [
+ 4
+ ],
+ "variableDescription": "A String representation of a binary value (only ones and zeros and spaces)."
+ }
+ ],
+ "examples": [
+ "B2X('11000011') == 'C3'",
+ "B2X('1 1111 0000') == '1F0'"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "CENTER(String,Length)",
+ "returnValue": {
+ "type": "String",
+ "description": "A Centered String in the spcified Length amount of space. Padded equally on both sides with spaces. If Length is less than the length of String then String is truncated from both sides to the length Length. Additionally, if an odd number of characters are truncated or added, the Right hand end loses or gains one more character than the left hand end. May also be specified as CENTRE."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String",
+ "offsets": [
+ 7
+ ],
+ "variableDescription": "The String to center in Length."
+ },
+ {
+ "type": "String",
+ "defaultValue": "Length",
+ "offsets": [
+ 14
+ ],
+ "variableDescription": "The Length to center String into."
+ }
+ ],
+ "examples": [
+ "CENTER('ABC',7) == ' ABC '",
+ "CENTER('ABC',8) == ' ABC '",
+ "CENTER('The blue sky',8) == 'e blue s'",
+ "CENTER('The blue sky',7) == 'e blue '"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "CENTER(String,Length,Pad)",
+ "returnValue": {
+ "type": "String",
+ "description": "A Centered String in the spcified Length amount of space. Padded equally on both sides with Pad. If Length is less than the length of String then String is truncated from both sides to the length Length. Additionally, if an odd number of characters are truncated or added, the Right hand end loses or gains one more character than the left hand end. May also be specified as CENTRE."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String",
+ "offsets": [
+ 7
+ ],
+ "variableDescription": "The String to center in Length."
+ },
+ {
+ "type": "String",
+ "defaultValue": "Length",
+ "offsets": [
+ 14
+ ],
+ "variableDescription": "The Length to center String into."
+ },
+ {
+ "type": "Character",
+ "defaultValue": "Pad",
+ "offsets": [
+ 21
+ ],
+ "variableDescription": "The Pad character to add around String."
+
+ }
+ ],
+ "examples": [
+ "CENTER('ABC',8,'-') == '--ABC---'"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "CENTRE(String,Length)",
+ "returnValue": {
+ "type": "String",
+ "description": "A Centered String in the spcified Length amount of space. Padded equally on both sides with spaces. If Length is less than the length of String then String is truncated from both sides to the length Length. Additionally, if an odd number of characters are truncated or added, the Right hand end loses or gains one more character than the left hand end. May also be specified as CENTER."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String",
+ "offsets": [
+ 7
+ ],
+ "variableDescription": "The String to center in Length."
+ },
+ {
+ "type": "String",
+ "defaultValue": "Length",
+ "offsets": [
+ 14
+ ],
+ "variableDescription": "The Length to center String into."
+ }
+ ],
+ "examples": [
+ "CENTRE('ABC',7) == ' ABC '",
+ "CENTRE('ABC',8) == ' ABC '"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "CENTRE(String,Length,Pad)",
+ "returnValue": {
+ "type": "String",
+ "description": "A Centered String in the spcified Length amount of space. Padded equally on both sides with Pad. If Length is less than the length of String then String is truncated from both sides to the length Length. Additionally, if an odd number of characters are truncated or added, the Right hand end loses or gains one more character than the left hand end. May also be specified as CENTER."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String",
+ "offsets": [
+ 7
+ ],
+ "variableDescription": "The String to center in Length."
+ },
+ {
+ "type": "String",
+ "defaultValue": "Length",
+ "offsets": [
+ 14
+ ],
+ "variableDescription": "The Length to center String into."
+ },
+ {
+ "type": "Character",
+ "defaultValue": "Pad",
+ "offsets": [
+ 21
+ ],
+ "variableDescription": "The Pad character to add around String."
+
+ }
+ ],
+ "examples": [
+ "CENTRE('ABC',8,'-') == '--ABC---'"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "CHARIN()",
+ "returnValue": {
+ "type": "",
+ "description": ""
+ },
+ "variables": [
+ {
+ "type": "",
+ "defaultValue": "",
+ "offsets": [
+ 0
+ ],
+ "variableDescription": ""
+ }
+ ],
+ "examples": [
+ ""
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "CHAROUT()",
+ "returnValue": {
+ "type": "",
+ "description": ""
+ },
+ "variables": [
+ {
+ "type": "",
+ "defaultValue": "",
+ "offsets": [
+ 0
+ ],
+ "variableDescription": ""
+ }
+ ],
+ "examples": [
+ ""
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "CHARS()",
+ "returnValue": {
+ "type": "",
+ "description": ""
+ },
+ "variables": [
+ {
+ "type": "",
+ "defaultValue": "",
+ "offsets": [
+ 0
+ ],
+ "variableDescription": ""
+ }
+ ],
+ "examples": [
+ ""
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "COMPARE(String1,String2)",
+ "returnValue": {
+ "type": "Integer",
+ "description": "The Character Position in which String1 and String2 differ (0 meaning that they are the same String). If one string is shorter than the other then it is padded with a spaces until their lengths are equal."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String1",
+ "offsets": [
+ 8
+ ],
+ "variableDescription": "The string to compare to String2."
+ },
+ {
+ "type": "String",
+ "defaultValue": "String2",
+ "offsets": [
+ 16
+ ],
+ "variableDescription": "The string to compare to String1."
+ }
+ ],
+ "examples": [
+ "COMPARE('abc','abc') == 0",
+ "COMPARE('abc','ak') == 2",
+ "COMPARE('ab ','ab') == 0"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "COMPARE(String1,String2,Pad)",
+ "returnValue": {
+ "type": "Integer",
+ "description": "The Character Position in which String1 and String2 differ (0 meaning that they are the same String). If one string is shorter than the other then it is padded with the Pad char until their lengths are equal."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String1",
+ "offsets": [
+ 8
+ ],
+ "variableDescription": "The string to compare to String2."
+ },
+ {
+ "type": "String",
+ "defaultValue": "String2",
+ "offsets": [
+ 16
+ ],
+ "variableDescription": "The string to compare to String1."
+ },
+ {
+ "type": "Character",
+ "defaultValue": "Pad",
+ "offsets": [
+ 24
+ ],
+ "variableDescription": "The Pad Char to add the shorter string until it matches the other strings length."
+ }
+ ],
+ "examples": [
+ "COMPARE('ab-- ','ab','-') == 5"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "CONDITION()",
+ "returnValue": {
+ "type": "String",
+ "description": "The name of the trapped condition."
+ },
+ "examples": [
+ "CONDITION() == 'CALL' /* PERHAPS */"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "CONDITION(Option)",
+ "returnValue": {
+ "type": "String.",
+ "description": "The information associated with the current trapped condition. Condition name, Description, Instruction, or State."
+
+ },
+ "variables": [
+ {
+ "type": "Character",
+ "defaultValue": "Option",
+ "offsets": [
+ 10
+ ],
+ "variableDescription": "
C | - | Condition name. Returns the name of the current trapped condition. |
D | - | Description. Returns any descriptive string associated with the current trapped condition. |
I | - | Instruction. returns the keyword for the instruction executed when the current condition was trapped. |
S | - | State. Returns the state of the current trapped condition. |
"
+ }
+ ],
+ "examples": [
+ "CONDITION('C') == 'FAILURE' /* perhaps */",
+ "CONDITION('I') == 'CALL' /* perhaps */",
+ "CONDITION('D') == 'FailureTest' /* perhaps */",
+ "CONDITION('S') == 'OFF' /* perhaps */"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "COPIES(String,N)",
+ "returnValue": {
+ "type": "String",
+ "description": "N directly concatenated copies of String."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String",
+ "offsets": [
+ 7
+ ],
+ "variableDescription": "The String to produce multiple copies of."
+ },
+ {
+ "type": "Integer",
+ "defaultValue": "N",
+ "offsets": [
+ 14
+ ],
+ "variableDescription": "The number of copies of String to produce, must be positive or 0."
+ }
+ ],
+ "examples": [
+ "COPIES('abc',3) == 'abcabcabc'",
+ "COPIES('abc',0) == ''"
+ ],
+ "additionalInfo": ""
+ },
+ {
+ "pattern": "C2D(String)",
+ "returnValue": {
+ "type": "Integer",
+ "description": "The decimal value of the binary representation (encoding) of string. If the result cannot be expressed as a whole number, an error results - that is, the result must not have more digits than the current setting of NUMERIC DIGITS."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String",
+ "offsets": [
+ 4
+ ],
+ "variableDescription": "The String to be converted. This may be the null strig, in which case '0' is returned. This is assumed to be an unsigned value."
+ }
+ ],
+ "examples": [
+ "C2D('09'x) == 9",
+ "C2D('8l'x) == 129",
+ "C2D('a') == 129 /* EBCDIC Encoding */",
+ "C2D('FF8l'x) == 65409",
+ "C2D ('') == 0"
+ ],
+ "additionalInfo": "Character to Decimal."
+ },
+ {
+ "pattern": "C2D(String,N)",
+ "returnValue": {
+ "type": "Integer",
+ "description": "The decimal value of the binary representation (encoding) of string. If the result cannot be expressed as a whole number, an error results - that is, the result must not have more digits than the current setting of NUMERIC DIGITS."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String",
+ "offsets": [
+ 4
+ ],
+ "variableDescription": "The String to be converted. This may be the null strig, in which case '0' is returned. This is assumed to be an signed value of length N."
+ },
+ {
+ "type": "Integer",
+ "defaultValue": "N",
+ "offsets": [
+ 11
+ ],
+ "variableDescription": "The number of characters (starting from the right and moving left) in which to consider the conversion of String. if N is longer than the length of String Then '00'x is prepended to the string before conversion."
+ }
+ ],
+ "examples": [
+ "C2D('81'x,l) == -127",
+ "C2D('81'x,2) == 129",
+ "C2D('FF81'x,2) == -127",
+ "C2D('FF81'x,l) == -127",
+ "C2D('FF7F'x,l) == 127",
+ "C2D('F081'x,2) == -3967",
+ "C2D('F081'x,l) == -127",
+ "C2D('0031'x,0) == 0"
+ ],
+ "additionalInfo": "Character to Decimal."
+ },
+ {
+ "pattern": "C2X(String)",
+ "returnValue": {
+ "type": "String",
+ "description": "The hexedecimal representation (unpacked value) of a character String. All values A-F will be upper case and contain no blanks."
+
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String",
+ "offsets": [
+ 4
+ ],
+ "variableDescription": "The string to be unpacked. This may be of any length, and if it is the null string then a null string is returned."
+ }
+ ],
+ "examples": [
+ "C2X('72s') == 'F7F2A2' /* EBCDIC */",
+ "C2X('0123'x) == '0123'"
+ ],
+ "additionalInfo": "Character to Hexadecimal."
+ },
+ {
+ "pattern": "DATATYPE(String)",
+ "returnValue": {
+ "type": "String",
+ "description": "The value 'NUM' or 'CHAR' depending on whether the String can be added to '0' without error."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String",
+ "offsets": [
+ 10
+ ],
+ "variableDescription": "The String to test the Datatype of."
+ }
+ ],
+ "examples": [
+ "DATATYPE(' 12 ') == 'NUM'",
+ "DATATYPE('') == 'CHAR'",
+ "DATATYPE('123*') == 'CHAR'"
+ ],
+ "additionalInfo": "Type of String."
+ },
+ {
+ "pattern": "DATATYPE(String,Type)",
+ "returnValue": {
+ "type": "Boolean",
+ "description": "Whether or not String is of the type Type. If String is null and Type is not 'x' then 0 (False) is returned."
+ },
+ "variables": [
+ {
+ "type": "String",
+ "defaultValue": "String",
+ "offsets": [
+ 10
+ ],
+ "variableDescription": "The String to test the Datatype of."
+ },
+ {
+ "type": "Char",
+ "defaultValue": "Type",
+ "offsets": [
+ 16
+ ],
+ "variableDescription": " A | - | (Alphanumeric) | Returns 1 if String only contains characters from the ranges 'a-z', 'A-Z', and '0-9'. |
B | - | (Binary) | Returns 1 if String only contains the characters '0' and/or '1'. |
L | - | (lower case) | Returns 1 if String only contains characters from the range 'a-z'. |
M | - | (Mixed Case) | Returns 1 if String only contains characters from the ranges 'a-z' and 'A-Z'. |
N | - | (Number) | Returns 1 if DATATYPE(String) would return 'NUM'. |
S | - | (Symbol) | Returns 1 if String only contains characters that are valid in REXX symbols. Note that lower case alphabetics are permitted. |
U | - | (UPPER CASE) | Returns 1 if String only contains characters from the range 'A-Z'. |
W | - | (Whole Number) | Returns 1 if String is a REXX whole number under the current setting of NUMERIC DIGITS. |
X | - | (heXadecimal) | Returns 1 if String only contains characters from the ranges 'a-f', 'A-F', '0-9', and blank (so long as blanks only appear between pairs of hexadecimal characters, as usual.) Also returns 2 if String is a null string, which is a valid hexadecimal string. |
"
+ }
+ ],
+ "examples": [
+ "DATATYPE('l2.3','N') == 1",
+ "DATATYPE('12.3','W') == 0",
+ "DATATYPE('Fred','M') == 1",
+ "DATATYPE('','M') == 0",
+ "DATATYPE('Minx','L') == 0",
+ "DATATYPE('3d?','s') == 1",
+ "DATATYPE('BCd3','X') == 1",
+ "DATATYPE('BC d3','X') == 1"
+ ],
+ "additionalInfo": "Type of String."
+ },
+ {
+ "pattern": "FUNCTION_NAME()",
+ "returnValue": {
+ "type": "",
+ "description": ""
+ },
+ "variables": [
+ {
+ "type": "",
+ "defaultValue": "",
+ "offsets": [
+ 0
+ ],
+ "variableDescription": ""
+ }
+ ],
+ "examples": [
+ ""
+ ],
+ "additionalInfo": ""
+ },
+ //TODO: C2D, C2X, DATATYPE, DATE, DELSTR, DELWORD, DIGITS< D2C, D2X, ERRORTEXT, FORM, FORMAT, FORMAT (v2), FUZZ, INSERT, LASTPOS, LEFT< LENGTH, LINEIN, Lineout, LINES, MAX, MIN, OVERLAY
{
"pattern": "POS(Needle,Haystack)",
"returnValue": {
@@ -331,6 +1032,7 @@
],
"additionalInfo": "Position of starting at."
},
+ //TODO: QUEUED, RANDOM, REVERSE, RIGHT, SIGN< SOURCELINE, SPACE< STREAM< STRIP, SUBSTR, SUBWORD, SYMBOL, TIME, TRACE, TRANSLATE, TRUNC, VALUE, VERIFY, WORD< WORDINDEX< WORDLENGTH, WORDPOS, WORDS, XRANGE, X2B, X3C, X2D
{
"pattern": "FUNCTION_NAME()",
"returnValue": {
@@ -352,4 +1054,4 @@
],
"additionalInfo": ""
}
-]
\ No newline at end of file
+]
diff --git a/resources/configuration/tbl.html b/resources/configuration/tbl.html
new file mode 100644
index 0000000..605f606
--- /dev/null
+++ b/resources/configuration/tbl.html
@@ -0,0 +1,129 @@
+
+
+
+ A
+ |
+
+ -
+ |
+
+ (Alphanumeric)
+ |
+
+ Returns 1 if String only contains characters from the ranges 'a-z', 'A-Z', and '0-9'.
+ |
+
+
+
+ B
+ |
+
+ -
+ |
+
+ (Binary)
+ |
+
+ Returns 1 if String only contains the characters '0' and/or '1'.
+ |
+
+
+
+ L
+ |
+
+ -
+ |
+
+ (lower case)
+ |
+
+ Returns 1 if String only contains characters from the range 'a-z'.
+ |
+
+
+
+ M
+ |
+
+ -
+ |
+
+ (Mixed Case)
+ |
+
+ Returns 1 if String only contains characters from the ranges 'a-z' and 'A-Z'.
+ |
+
+
+
+ N
+ |
+
+ -
+ |
+
+ (Number)
+ |
+
+ Returns 1 if DATATYPE(String) would return 'NUM'.
+ |
+
+
+
+ S
+ |
+
+ -
+ |
+
+ (Symbol)
+ |
+
+ Returns 1 if String only contains characters that are valid in REXX symbols. Note that lower case alphabetics are permitted.
+
+ |
+
+
+
+ U
+ |
+
+ -
+ |
+
+ (UPPER CASE)
+ |
+
+ Returns 1 if String only contains characters from the range 'A-Z'.
+ |
+
+
+
+ W
+ |
+
+ -
+ |
+
+ (Whole Number)
+ |
+
+ Returns 1 if String is a REXX whole number under the current setting of NUMERIC DIGITS.
+ |
+
+
+
+ X
+ |
+
+ -
+ |
+
+ (heXadecimal)
+ |
+
+ Returns 1 if String only contains characters from the ranges "a-f', "A-F", "0-9", and blank (so long as blanks only appear between pairs of hexadecimal characters, as usual.) Also returns 1 if String is a null string, which is a valid hexadecimal string.
+ |
+
+
\ No newline at end of file
diff --git a/src/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.java b/src/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.java
index 3d85159..47efb7c 100644
--- a/src/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.java
+++ b/src/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.java
@@ -40,32 +40,43 @@ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int
IDocument document = viewer.getDocument();
FindReplaceDocumentAdapter adapter = new FindReplaceDocumentAdapter(document);
String foundString = "";
+ IRegion region2 = null;
try {
- IRegion region2 = adapter.find(offset - 1,"\\s", false, false, false, true);
- foundString = document.get(region2.getOffset() + 1, offset - region2.getOffset() - 1);
+ region2 = adapter.find(offset - 1,"\\s", false, false, false, true);
+ region2 = new Region(region2.getOffset() + 1, region2.getLength());
+ foundString = document.get(region2.getOffset(), offset - region2.getOffset());
} catch (BadLocationException e1) {
e1.printStackTrace();
}
- final String finalFoundString = foundString;
+ final String finalFoundString = foundString.toUpperCase();
List proposals = new ArrayList<>();
- String[] functionNames= RexxFunctionProposalData.getFunctionMap().keySet().stream().filter(k -> k.contains(finalFoundString)).sorted().toArray(String[]::new);
+ String[] functionNames= RexxFunctionProposalData.getFunctionMap().keySet().stream().filter(k -> k.startsWith(finalFoundString)).sorted().toArray(String[]::new);
+ TemplateContextType type = new TemplateContextType("TemplateVariableContext");
+ type.addResolver(new TemplateVariableResolver());
+ Image image = null;
+ try {
+ Bundle bundle = org.eclipse.core.runtime.Platform.getBundle("RexxEditor");
+ URL fUrl = bundle.getEntry("icons/function.gif");
+ image = new Image(null, fUrl.openConnection().getInputStream());
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
for (String functionName: functionNames) {
- proposals.add(buildCompletionProposalFromKey(functionName, viewer, offset));
+ proposals.add(buildCompletionProposalFromKey(functionName, region2, type, image));
}
return proposals.toArray(ICompletionProposal[]::new);
}
- private RexxCompletionProposal buildCompletionProposalFromKey(String string, ITextViewer viewer, int offset) {
+ private RexxCompletionProposal buildCompletionProposalFromKey(String string, IRegion region, TemplateContextType type, Image image) {
RexxFunctionProposalData data = RexxFunctionProposalData.getFunctionMap().get(string);
Template template = data.getTemplate();
- TemplateContextType type = new TemplateContextType();
- type.addResolver(new TemplateVariableResolver());
TemplateContext context = new TemplateContext(type) {
@Override
public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {
- TemplateVariable[] templateVariables = new TemplateVariable[0];
+ TemplateVariable[] templateVariables = new TemplateVariable[0];
if (data.getVariables() != null) {
templateVariables = Arrays.stream(data.getVariables()).map(var -> var.getVariable()).toArray(TemplateVariable[]::new);
}
@@ -77,16 +88,6 @@ public boolean canEvaluate(Template template) {
return true;
}
};
- IRegion region = new Region(offset - 1 , 1);
- Image image = null;
- try {
- Bundle bundle = org.eclipse.core.runtime.Platform.getBundle("RexxEditor");
- URL fUrl = bundle.getEntry("icons/function.gif");
- image = new Image(null, fUrl.openConnection().getInputStream());
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
return new RexxCompletionProposal(template, context, region, image, 0);
}
@@ -98,12 +99,12 @@ public IContextInformation[] computeContextInformation(ITextViewer viewer, int o
@Override
public char[] getCompletionProposalAutoActivationCharacters() {
- return "ADP".toCharArray();
+ return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
}
@Override
public char[] getContextInformationAutoActivationCharacters() {
- return "ADP".toCharArray();
+ return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
}
@Override
diff --git a/src/org/imperfectmommy/rexxeditor/contentassist/RexxFunctionProposalData.java b/src/org/imperfectmommy/rexxeditor/contentassist/RexxFunctionProposalData.java
index 0f7a7f7..7bce974 100644
--- a/src/org/imperfectmommy/rexxeditor/contentassist/RexxFunctionProposalData.java
+++ b/src/org/imperfectmommy/rexxeditor/contentassist/RexxFunctionProposalData.java
@@ -10,6 +10,8 @@
import org.eclipse.jface.text.templates.Template;
import org.osgi.framework.Bundle;
+import com.fasterxml.jackson.annotation.JsonFormat.Feature;
+import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.ObjectMapper;
public class RexxFunctionProposalData {
@@ -79,6 +81,7 @@ public static Map getFunctionMap() {
if (functionMap.isEmpty()) {
try {
ObjectMapper mapper = new ObjectMapper();
+ mapper.enable(JsonParser.Feature.ALLOW_COMMENTS);
Bundle bundle = org.eclipse.core.runtime.Platform.getBundle("RexxEditor");
URL fUrl = bundle.getEntry("resources/configuration/FunctionDefinitions.json");
RexxFunctionProposalData[] data = mapper.readValue(fUrl.openConnection().getInputStream(), RexxFunctionProposalData[].class);
diff --git a/src/org/imperfectmommy/rexxeditor/editors/ColorManager.java b/src/org/imperfectmommy/rexxeditor/editors/ColorManager.java
index 520d44e..a414dbb 100644
--- a/src/org/imperfectmommy/rexxeditor/editors/ColorManager.java
+++ b/src/org/imperfectmommy/rexxeditor/editors/ColorManager.java
@@ -67,13 +67,5 @@ public boolean affectsTextPresentation(PropertyChangeEvent event) {
return (token != null);
}
- public void handlePreferenceStoreChanged(PropertyChangeEvent event) {
- String prefKey = event.getProperty();
- Color color = (Color) fColorTable.get(prefKey);
- if (color != null) {
- String colorName = preferenceStore.getString(prefKey);
- color = new Color(Display.getCurrent(), StringConverter
- .asRGB(colorName));
- }
- }
+
}
diff --git a/src/org/imperfectmommy/rexxeditor/editors/RexxEditor.java b/src/org/imperfectmommy/rexxeditor/editors/RexxEditor.java
index 397ef50..0e9bd19 100644
--- a/src/org/imperfectmommy/rexxeditor/editors/RexxEditor.java
+++ b/src/org/imperfectmommy/rexxeditor/editors/RexxEditor.java
@@ -3,9 +3,6 @@
import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.source.AnnotationRulerColumn;
-import org.eclipse.jface.text.source.CompositeRuler;
-import org.eclipse.jface.text.source.IVerticalRuler;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.editors.text.TextEditor;
@@ -13,67 +10,69 @@
import org.imperfectmommy.rexxeditor.Activator;
import org.imperfectmommy.rexxeditor.contentoutliner.RexxContentElement;
import org.imperfectmommy.rexxeditor.contentoutliner.RexxContentOutlinePage;
+import org.imperfectmommy.rexxeditor.preferences.RexxPreferencePage;
public class RexxEditor extends TextEditor {
- private RexxContentOutlinePage fOutlinePage;
- private ColorManager colorManager;
+ private RexxContentOutlinePage fOutlinePage;
+ private ColorManager colorManager;
- public RexxEditor() {
- super();
- Activator plugin = Activator.getActivator();
- colorManager = new ColorManager(plugin.getPreferenceStore());
- setSourceViewerConfiguration(new RexxConfiguration(colorManager, this));
- setPreferenceStore(plugin.getPreferenceStore());
- }
+ public RexxEditor() {
+ super();
+ Activator plugin = Activator.getActivator();
+ this.colorManager = new ColorManager(plugin.getPreferenceStore());
+ this.setSourceViewerConfiguration(new RexxConfiguration(this.colorManager, this));
+ // setPreferenceStore(plugin.getPreferenceStore());
+ }
- public void dispose() {
- colorManager.dispose();
- if (fOutlinePage != null)
- fOutlinePage.setInput(null);
- super.dispose();
- }
-
- protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
- colorManager.handlePreferenceStoreChanged(event);
- super.handlePreferenceStoreChanged(event);
- }
-
- @SuppressWarnings("unchecked")
@Override
- public T getAdapter(Class adapter) {
- if (IContentOutlinePage.class.equals(adapter)) {
- if (fOutlinePage == null) {
- fOutlinePage = new RexxContentOutlinePage(getDocumentProvider(), this);
- if (getEditorInput() != null)
- fOutlinePage.setInput(getEditorInput());
- }
- return (T) fOutlinePage;
- }
- return super.getAdapter(adapter);
- }
+ public void dispose() {
+ this.colorManager.dispose();
+ if (this.fOutlinePage != null) {
+ this.fOutlinePage.setInput(null);
+ }
+ super.dispose();
+ }
+ @Override
+ public void doSetInput(IEditorInput input) throws CoreException {
+ super.doSetInput(input);
+ if (this.fOutlinePage != null) {
+ this.fOutlinePage.setInput(input);
+ }
+ }
- public void update(ArrayList updateList) {
+ @SuppressWarnings("unchecked")
+ @Override
+ public T getAdapter(Class adapter) {
+ if (IContentOutlinePage.class.equals(adapter)) {
+ if (this.fOutlinePage == null) {
+ this.fOutlinePage = new RexxContentOutlinePage(this.getDocumentProvider(), this);
+ if (this.getEditorInput() != null) {
+ this.fOutlinePage.setInput(this.getEditorInput());
+ }
+ }
+ return (T) this.fOutlinePage;
+ }
+ return super.getAdapter(adapter);
+ }
- if (fOutlinePage != null) {
- fOutlinePage.update(updateList);
- }
- }
+ @Override
+ protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
+ super.handlePreferenceStoreChanged(event);
+ }
- public void doSetInput(IEditorInput input) throws CoreException {
- super.doSetInput(input);
+ public void update(ArrayList updateList) {
+ if (this.fOutlinePage != null) {
+ this.fOutlinePage.update(updateList);
+ }
+ }
- if (fOutlinePage != null)
- fOutlinePage.setInput(input);
- }
-
- protected IVerticalRuler createVerticalRuler() {
- CompositeRuler ruler = new CompositeRuler();
- ruler.addDecorator(0, new AnnotationRulerColumn(VERTICAL_RULER_WIDTH));
- ruler.addDecorator(1, createLineNumberRulerColumn());
- return ruler;
- }
-
+ /*
+ * protected IVerticalRuler createVerticalRuler() { CompositeRuler ruler = new
+ * CompositeRuler(); ruler.addDecorator(0, new
+ * AnnotationRulerColumn(VERTICAL_RULER_WIDTH)); ruler.addDecorator(1,
+ * createLineNumberRulerColumn()); return ruler; }
+ */
}
\ No newline at end of file
diff --git a/src/org/imperfectmommy/rexxeditor/preferences/RexxPreferencePage.java b/src/org/imperfectmommy/rexxeditor/preferences/RexxPreferencePage.java
index 8fb1ba9..38a8095 100644
--- a/src/org/imperfectmommy/rexxeditor/preferences/RexxPreferencePage.java
+++ b/src/org/imperfectmommy/rexxeditor/preferences/RexxPreferencePage.java
@@ -92,5 +92,5 @@ public void init(IWorkbench workbench) {
}
-
+
}