Skip to content

Commit

Permalink
fix string functions
Browse files Browse the repository at this point in the history
  • Loading branch information
heterophyllus committed Jan 30, 2020
1 parent f0cdb74 commit 4905b98
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 35 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ All notable changes to the "vscode-zemax" extension will be documented in this f

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [0.3.0]
- Add snippets

## [0.2.2]
- small fix
- Small fix

## [0.2.0]
- Add icon and syntax screenshot
- change function identification end
- Small change of function identification

## [0.1.0]
- Initial release
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Zemax OpticStudio ZPL language support for Visual Studio Code

This extension adds syntax highlighting for [Zemax OpticStudio](https://www.zemax.com/products/opticstudio) ZPL macros.
This extension adds syntax highlighting and snippets for [Zemax OpticStudio](https://www.zemax.com/products/opticstudio) ZPL macros.

## Screenshot
![syntax](images/syntax.png)
Expand Down
61 changes: 31 additions & 30 deletions snippets/zemax.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
},
"GNUM":{
"prefix":"GNUM",
"body":"GNUM(${str})",
"body":"GNUM(${1:str})",
"description":"Glass number in the catalog"
},
"GPAR":{
Expand Down Expand Up @@ -661,7 +661,7 @@
},
"WAVL":{
"prefix":"WAVL",
"body":"WAVL(${wav})",
"body":"WAVL(${1:wav})",
"description":"Wavelength in micrometer"
},
"WINL":{
Expand Down Expand Up @@ -704,27 +704,27 @@

"$BUFFER":{
"prefix":"$BUFFER",
"body":"$BUFFER()",
"body":"\\$BUFFER()",
"description":"Get string from buffer"
},
"$CALLSTR":{
"prefix":"$CALLSTR",
"body":"$CALLSTR(${1:i})",
"body":"\\$CALLSTR(${1:i})",
"description":"Get string at specified index of the buffer"
},
"$COAT":{
"prefix":"$COAT",
"body":"$COAT(${1:i})",
"body":"\\$COAT(${1:i})",
"description":"Coating name"
},
"$COATINGPATH":{
"prefix":"$COATINGPATH",
"body":"$COATINGPATH()",
"body":"\\$COATINGPATH()",
"description":"Coating file path"
},
"$COMMENT":{
"prefix":"$COMMENT",
"body":"$COMMENT(${1:i})",
"body":"\\$COMMENT(${1:i})",
"description":"Comment"
},
"DATAPATH":{
Expand All @@ -734,42 +734,42 @@
},
"$DATE":{
"prefix":"$DATE",
"body":"$DATE()",
"body":"\\$DATE()",
"description":"Current date and time"
},
"$EXTENSIONPATH":{
"prefix":"$EXTENSIONPATH",
"body":"$EXTENSIONPATH()",
"body":"\\$EXTENSIONPATH()",
"description":"Zemax extension path"
},
"$FILENAME":{
"prefix":"$FILENAME",
"body":"$FILENAME()",
"body":"\\$FILENAME()",
"description":"Current lens file name"
},
"$FILEPATH":{
"prefix":"$FILEPATH",
"body":"$FILEPATH()",
"body":"\\$FILEPATH()",
"description":"Current lens file (full path)"
},
"$GETSTRING":{
"prefix":"$GETSTRING",
"body":"$GETSTRING(${1:str},${2:n})",
"body":"\\$GETSTRING(${1:str},${2:n})",
"description":"Get substring of string separated with space"
},
"$GETSTRINGC":{
"prefix":"$GETSTRINGC",
"body":"$GETSTRINGC(${1:str},${2:n})",
"body":"\\$GETSTRINGC(${1:str},${2:n})",
"description":"Get substring of string separated with comma"
},
"$GLASS":{
"prefix":"$GLASS",
"body":"$GLASS(${1:i})",
"body":"\\$GLASS(${1:i})",
"description":"Glass name"
},
"$GLASSCATALOG":{
"prefix":"$GLASSCATALOG",
"body":"$GLASSCATALOG(${1:i})",
"body":"\\$GLASSCATALOG(${1:i})",
"description":"Glass catalog"
},
"GLASSPATH":{
Expand All @@ -779,12 +779,12 @@
},
"$LEFTSTRING":{
"prefix":"$LEFTSTRING",
"body":"$LEFTSTRING(${1:A},${2:n})",
"body":"\\$LEFTSTRING(${1:A},${2:n})",
"description":"Left n characters"
},
"$LENSNAME":{
"prefix":"$LENSNAME",
"body":"$LENSNAME()",
"body":"\\$LENSNAME()",
"description":"Lens title"
},
"MACROPATH":{
Expand All @@ -794,22 +794,22 @@
},
"$NOTE":{
"prefix":"$NOTE",
"body":"$NOTE(${1:line})",
"body":"\\$NOTE(${1:line})",
"description":"Note defined on General System Data dialog"
},
"$OBJECTPATH":{
"prefix":"$OBJECTPATH",
"body":"$OBJECTPATH()",
"body":"\\$OBJECTPATH()",
"description":"NSC object path"
},
"$PATHNAME":{
"prefix":"$PATHNAME",
"body":"$PATHNAME()",
"body":"\\$PATHNAME()",
"description":"Current lens file path"
},
"$PROGRAMPATH":{
"prefix":"$PROGRAMPATH",
"body":"$PROGRAMPATH()",
"body":"\\$PROGRAMPATH()",
"description":"Program file path"
},
"QUOTE":{
Expand All @@ -819,32 +819,32 @@
},
"$RIGHTSTRING":{
"prefix":"$RIGHTSTRING",
"body":"$RIGHTSTRING(${1:A},${2:n})",
"body":"\\$RIGHTSTRING(${1:A},${2:n})",
"description":"Right n characters"
},
"$STR":{
"prefix":"$STR",
"body":"$STR(${1:expr})",
"body":"\\$STR(${1:expr})",
"description":"String in a format"
},
"$TEMPFILENAME":{
"prefix":"$TEMPFILENAME",
"body":"$TEMPFILENAME()",
"body":"\\$TEMPFILENAME()",
"description":"Temporary file path (full)"
},
"$TOLCOMMENT":{
"prefix":"$TOLCOMMENT",
"body":"$TOLCOMMENT(${1:operand})",
"body":"\\$TOLCOMMENT(${1:operand})",
"description":"Comment of the tolerance operand"
},
"$TOLOPERAND":{
"prefix":"$TOLOPERAND",
"body":"$TOLOPERAND(${1:operand})",
"body":"\\$TOLOPERAND(${1:operand})",
"description":"Operand name of the tolerance operand"
},
"$UNITS":{
"prefix":"$UNITS",
"body":"$UNITS()",
"body":"\\$UNITS()",
"description":"Current lens unit"
},

Expand Down Expand Up @@ -923,7 +923,7 @@
},
"DELETEMFO":{
"prefix":"DELETEMFO",
"body":"DELETEMFO ${1:row/all}",
"body":"DELETEMFO",
"description":"Delete operand on merit function editor"
},
"DELETEOBJECT":{
Expand Down Expand Up @@ -1068,7 +1068,7 @@
},
"IMASHOW":{
"prefix":"IMASHOW",
"body":"IMASHOW ${1:filename.ima}",
"body":"IMASHOW ${1:file}",
"description":"Display IMA/BIM file on the viewer window"
},
"IMASUM":{
Expand Down Expand Up @@ -1348,7 +1348,7 @@
},
"SAVETOLERANCE":{
"prefix":"SAVETOLERANCE",
"body":"SAVETOLERANCE ${file}",
"body":"SAVETOLERANCE ${1:file}",
"description":""
},
"SAVEWINDOW":{
Expand Down Expand Up @@ -1553,4 +1553,5 @@
}



}
4 changes: 2 additions & 2 deletions syntaxes/zemax.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
},
{
"comment": "type for PLOT",
"match": "\\b((?i)PLOT)\\s+((?i)NEW|TITLE|TITLE[XY]|BANNER|WINASPECT|COMM[1-6]|RANGE[XY]|CHECK|TICK|FORMAT[XY]|DATA|LINE|LABEL)\\b",
"match": "\\b((?i)PLOT)\\s+((?i)NEW|TITLE|TITLE|BANNER|WINASPECT|COMM|RANGE[XY]|CHECK|TICK|FORMAT[XY]|DATA|LINE|LABEL)\\b",
"captures": {
"1":{
"name": "keyword.language.zemax"
Expand All @@ -173,7 +173,7 @@
},
{
"comment": "type for PLOT2D",
"match": "\\b((?i)PLOT2D)\\s+((?i)NEW|TITLE|COMM[1-5]|RANGE|ASPECT|WINASPECT|DATA|ACTIVECURSOR|DISPLAYTYPE|CONTOURINTERVAL|SURFACESCALE|LOGPLOT|HIDEADDRESS|CONFIG|GO)\\b",
"match": "\\b((?i)PLOT2D)\\s+((?i)NEW|TITLE|COMM|RANGE|ASPECT|WINASPECT|DATA|ACTIVECURSOR|DISPLAYTYPE|CONTOURINTERVAL|SURFACESCALE|LOGPLOT|HIDEADDRESS|CONFIG)\\b",
"captures": {
"1":{
"name": "keyword.language.zemax"
Expand Down

0 comments on commit 4905b98

Please sign in to comment.