Skip to content

Commit

Permalink
Merge pull request #139 from chrjorgensen/fix/variants-in-identifiers
Browse files Browse the repository at this point in the history
Fix variants in identifiers
  • Loading branch information
barrettotte authored Jun 14, 2024
2 parents 1cc914d + 20a6a75 commit 517d0b0
Show file tree
Hide file tree
Showing 6 changed files with 248 additions and 9 deletions.
4 changes: 2 additions & 2 deletions syntaxes/cl.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"patterns": [
{
"name": "keyword.control.cl.label",
"match": "^\\s*[a-zA-Z_@#$][a-zA-Z0-9_@#$]*:"
"match": "^\\s*[a-zA-Z_@#$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_@#$§ÆØÅÄ֣ѥàÐŞİ]*:"
},
{
"name": "keyword.other.cl",
Expand Down Expand Up @@ -185,7 +185,7 @@
"patterns": [
{
"name": "variable.parameter.cl",
"match": "[&][a-zA-Z_@#$][a-zA-Z0-9_@#$]*"
"match": "[&][a-zA-Z_@#$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_@#$§ÆØÅÄ֣ѥàÐŞİ]*"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions syntaxes/cmd.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"patterns": [
{
"name": "keyword.control.cmd.label",
"match": "^\\s*[a-zA-Z_][a-zA-Z0-9_]*:"
"match": "^\\s*[a-zA-Z_@#$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_@#$§ÆØÅÄ֣ѥàÐŞİ]*:"
},
{
"name": "keyword.other.cmd",
Expand Down Expand Up @@ -99,7 +99,7 @@
"patterns": [
{
"name": "variable.parameter.cmd",
"match": "[&][a-zA-Z_][a-zA-Z0-9_]*"
"match": "[&][a-zA-Z_@#$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_@#$§ÆØÅÄ֣ѥàÐŞİ]*"
}
]
}
Expand Down
10 changes: 5 additions & 5 deletions syntaxes/rpgle.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@
},
{
"name": "support.function.rpgle.sql",
"match": "[a-zA-Z_#@$][a-zA-Z0-9_#@$]*(?=\\()"
"match": "[a-zA-Z_#@$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_#@$§ÆØÅÄ֣ѥàÐŞİ]*(?=\\()"
},
{
"name": "constant.language.rpgle.sql.schema",
"match": "[a-zA-Z_#@$][a-zA-Z0-9_#@$]*(\\.|\\/)[a-zA-Z_#@$][a-zA-Z0-9_#@$]*"
"match": "[a-zA-Z_#@$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_#@$§ÆØÅÄ֣ѥàÐŞİ]*(\\.|\\/)[a-zA-Z_#@$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_#@$§ÆØÅÄ֣ѥàÐŞİ]*"
},
{
"name": "variable.parameter.rpgle.sql",
"match": "[:][a-zA-Z_#@$][a-zA-Z0-9_#@$\\.]*"
"match": "[:][a-zA-Z_#@$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_#@$§ÆØÅÄ֣ѥàÐŞİ\\.]*"
},
{
"name": "keyword.operator.rpgle.sql.reserved",
Expand Down Expand Up @@ -160,7 +160,7 @@
"patterns": [
{
"name": "variable.other.rpgle.free.definition.identifier",
"begin": "[a-zA-Z_#@$][a-zA-Z0-9_#@$]*",
"begin": "[a-zA-Z_#@$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_#@$§ÆØÅÄ֣ѥàÐŞİ]*",
"end": "(?=\n)",
"patterns": [
{
Expand Down Expand Up @@ -600,7 +600,7 @@
},
{
"name": "variable.other",
"match": "((?i)[a-zA-Z_#@$][a-zA-Z0-9_#@$]*)|\\(|\\)|\\%"
"match": "((?i)[a-zA-Z_#@$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_#@$§ÆØÅÄ֣ѥàÐŞİ]*)|\\(|\\)|\\%"
}
]
},
Expand Down
68 changes: 68 additions & 0 deletions tests/issues/136.clle
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
pgm

dcl &@te@st@ *char 1
dcl &#te#st# *char 1
dcl &$te$st$ *char 1

/* note: double click doesn't select full identifier */
/* but, single clicking highlights full identifier */
/* I guess that's the correct behavior? */

/* Additional variants: https://docs.google.com/spreadsheets/d/1J4yEGkfhtmACfdDVyD2XNJe0jjrIK77Um6-wsvW0etM/edit?usp=sharing */

/* CCSID 273 (Austria and Germany) */
dcl &@te@st@ *char 1
dcl &§te§st§ *char 1
dcl &$te$st$ *char 1

/* CCSID 277 (Denmark and Norway) */
dcl &ØteØstØ *char 1
dcl &ÆteÆstÆ *char 1
dcl &ÅteÅstÅ *char 1

/* CCSID 278 (Finland and Sweden) */
dcl &ÖteÖstÖ *char 1
dcl &ÄteÄstÄ *char 1
dcl &ÅteÅstÅ *char 1

/* CCSID 280 (Italy) */
dcl &§te§st§ *char 1
dcl &£te£st£ *char 1
dcl &$te$st$ *char 1

/* CCSID 284 (Spain and Latin America) */
dcl &@te@st@ *char 1
dcl &ÑteÑstÑ *char 1
dcl &$te$st$ *char 1

/* CCSID 285 (Ireland and the United Kingdom) */
dcl &@te@st@ *char 1
dcl &#te#st# *char 1
dcl &£te£st£ *char 1

/* CCSID 290 (Japan (katakana)) */
dcl &@te@st@ *char 1
dcl &#te#st# *char 1
dcl &¥te¥st¥ *char 1

/* CCSID 297 (France) */
dcl &àteàstà *char 1
dcl &£te£st£ *char 1
dcl &$te$st$ *char 1

/* CCSID 423 (Greece) */
dcl &§te§st§ *char 1
dcl &£te£st£ *char 1
dcl &$te$st$ *char 1

/* CCSID 871 (Iceland) */
dcl &ÐteÐstÐ *char 1
dcl &#te#st# *char 1
dcl &$te$st$ *char 1

/* CCSID 905 (Turkey - Latin-3) */
dcl &ŞteŞstŞ *char 1
dcl &ÖteÖstÖ *char 1
dcl &İteİstİ *char 1

endpgm
114 changes: 114 additions & 0 deletions tests/issues/136.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
cmd prompt( 'Variant characters in identifiers' )

parm &@te@st@ *char 1
parm &#te#st# *char 1
parm &$te$st$ *char 1

parm &qualified qual@#$ prompt( 'Object' )
qual@#$: qual *name 10
qual *name 10 prompt( 'Library' )

/* note: double click doesn't select full identifier */
/* but, single clicking highlights full identifier */
/* I guess that's the correct behavior? */

/* Additional variants: https://docs.google.com/spreadsheets/d/1J4yEGkfhtmACfdDVyD2XNJe0jjrIK77Um6-wsvW0etM/edit?usp=sharing */

/* CCSID 273 (Austria and Germany) */
parm &@te@st@ *char 1
parm &#te#st# *char 1
parm &$te$st$ *char 1

parm &qualified qual@#$ prompt( 'Object' )
qual@#$: qual *name 10
qual *name 10 prompt( 'Library' )

/* CCSID 277 (Denmark and Norway) */
parm &ØteØstØ *char 1
parm &ÆteÆstÆ *char 1
parm &ÅteÅstÅ *char 1

parm &qualified qualØÆÅ prompt( 'Object' )
qualØÆÅ: qual *name 10
qual *name 10 prompt( 'Library' )

/* CCSID 278 (Finland and Sweden) */
parm &ÖteÖstÖ *char 1
parm &ÄteÄstÄ *char 1
parm &ÅteÅstÅ *char 1

parm &qualified qualÖÄÅ prompt( 'Object' )
qualÖÄÅ: qual *name 10
qual *name 10 prompt( 'Library' )

/* CCSID 280 (Italy) */
parm &§te§st§ *char 1
parm &£te£st£ *char 1
parm &$te$st$ *char 1

parm &qualified qual§£$ prompt( 'Object' )
qual§£$: qual *name 10
qual *name 10 prompt( 'Library' )

/* CCSID 284 (Spain and Latin America) */
parm &@te@st@ *char 1
parm &ÑteÑstÑ *char 1
parm &$te$st$ *char 1

parm &qualified qual@Ñ$ prompt( 'Object' )
qual@Ñ$: qual *name 10
qual *name 10 prompt( 'Library' )

/* CCSID 285 (Ireland and the United Kingdom) */
parm &@te@st@ *char 1
parm &#te#st# *char 1
parm &£te£st£ *char 1

parm &qualified qual@#£ prompt( 'Object' )
qual@#£: qual *name 10
qual *name 10 prompt( 'Library' )

/* CCSID 290 (Japan (katakana)) */
parm &@te@st@ *char 1
parm &#te#st# *char 1
parm &¥te¥st¥ *char 1

parm &qualified qual@#¥ prompt( 'Object' )
qual@#¥: qual *name 10
qual *name 10 prompt( 'Library' )

/* CCSID 297 (France) */
parm &àteàstà *char 1
parm &£te£st£ *char 1
parm &$te$st$ *char 1

parm &qualified qualà£$ prompt( 'Object' )
qualà£$: qual *name 10
qual *name 10 prompt( 'Library' )

/* CCSID 423 (Greece) */
parm &§te§st§ *char 1
parm &£te£st£ *char 1
parm &$te$st$ *char 1

parm &qualified qual§£$ prompt( 'Object' )
qual§£$: qual *name 10
qual *name 10 prompt( 'Library' )

/* CCSID 871 (Iceland) */
parm &ÐteÐstÐ *char 1
parm &#te#st# *char 1
parm &$te$st$ *char 1

parm &qualified qualÐ#$ prompt( 'Object' )
qualÐ#$: qual *name 10
qual *name 10 prompt( 'Library' )

/* CCSID 905 (Turkey - Latin-3) */
parm &ŞteŞstŞ *char 1
parm &ÖteÖstÖ *char 1
parm &İteİstİ *char 1

parm &qualified qualŞÖİ prompt( 'Object' )
qualŞÖİ: qual *name 10
qual *name 10 prompt( 'Library' )
57 changes: 57 additions & 0 deletions tests/issues/136.rpgle
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,60 @@ dcl-s $te$st$ char(16) inz(*blanks);
// note: double click doesn't select full identifier
// but, single clicking highlights full identifier
// I guess that's the correct behavior?

// Additional variants: https://docs.google.com/spreadsheets/d/1J4yEGkfhtmACfdDVyD2XNJe0jjrIK77Um6-wsvW0etM/edit?usp=sharing

// CCSID 273 (Austria and Germany)
dcl-s @te@st@ char(16) inz(*blanks);
dcl-s §te§st§ char(16) inz(*blanks);
dcl-s $te$st$ char(16) inz(*blanks);

// CCSID 277 (Denmark and Norway)
dcl-s ØteØstØ char(16) inz(*blanks);
dcl-s ÆteÆstÆ char(16) inz(*blanks);
dcl-s ÅteÅstÅ char(16) inz(*blanks);

// CCSID 278 (Finland and Sweden)
dcl-s ÖteÖstÖ char(16) inz(*blanks);
dcl-s ÄteÄstÄ char(16) inz(*blanks);
dcl-s ÅteÅstÅ char(16) inz(*blanks);

// CCSID 280 (Italy)
dcl-s §te§st§ char(16) inz(*blanks);
dcl-s £te£st£ char(16) inz(*blanks);
dcl-s $te$st$ char(16) inz(*blanks);

// CCSID 284 (Spain and Latin America)
dcl-s @te@st@ char(16) inz(*blanks);
dcl-s ÑteÑstÑ char(16) inz(*blanks);
dcl-s $te$st$ char(16) inz(*blanks);

// CCSID 285 (Ireland and the United Kingdom)
dcl-s @te@st@ char(16) inz(*blanks);
dcl-s #te#st# char(16) inz(*blanks);
dcl-s £te£st£ char(16) inz(*blanks);

// CCSID 290 (Japan (katakana))
dcl-s @te@st@ char(16) inz(*blanks);
dcl-s #te#st# char(16) inz(*blanks);
dcl-s ¥te¥st¥ char(16) inz(*blanks);

// CCSID 297 (France)
dcl-s àteàstà char(16) inz(*blanks);
dcl-s £te£st£ char(16) inz(*blanks);
dcl-s $te$st$ char(16) inz(*blanks);

// CCSID 423 (Greece)
dcl-s §te§st§ char(16) inz(*blanks);
dcl-s £te£st£ char(16) inz(*blanks);
dcl-s $te$st$ char(16) inz(*blanks);

// CCSID 871 (Iceland)
dcl-s ÐteÐstÐ char(16) inz(*blanks);
dcl-s #te#st# char(16) inz(*blanks);
dcl-s $te$st$ char(16) inz(*blanks);

// CCSID 905 (Turkey - Latin-3)
dcl-s ŞteŞstŞ char(16) inz(*blanks);
dcl-s ÖteÖstÖ char(16) inz(*blanks);
dcl-s İteİstİ char(16) inz(*blanks);

0 comments on commit 517d0b0

Please sign in to comment.