Skip to content

Commit

Permalink
1st official release of Semantic Highlight for Spin2
Browse files Browse the repository at this point in the history
- bumped ver number for relase
- added missing debug_* constants - syntax hilight
- made more symbols all case-insensative
- general fixes and cleanup as tested against PNut and P2 Obex files
  • Loading branch information
ironsheep committed Mar 19, 2021
1 parent 58f49b7 commit 544ba0a
Show file tree
Hide file tree
Showing 8 changed files with 503 additions and 175 deletions.
47 changes: 45 additions & 2 deletions spin2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,46 @@ Possible next additions:
- Add new-file templates as Snippets
- Add additional Snippets as the community identifies them

## [1.0.0] 2021-03-18

The Official Release of Semantic Highlighting

In this release we clean things up a bit more, we deliver unknown name hightlighted in brighter red, and **herein** we report on the state of testing against various code-sets.

**NOTE:** _with this new **unknown names** coloring feature we were able to find two files that shouldn't compile due to undefined symbols but actually do compile. The findings are being reported to Chip. The author of the files confirmed that the two files are missing symbols._

Semantic Adjustments:

- NEW FEATURE! **Unknown names** in the file are now hightlighted with noticable bright red
- BUGFIX: pasm - repaired variable/label hightlight when short names
- BUGFIX: by default the compiler treats the first lines in file as being in CON, this highlighter does now as well.
- BUGFIX: recognize round(), float(), and trunc() in DAT, CON and PUB/PRI
- BUGFIX: built-in constants should now be colored correctly

Syntax Adjustments:

- BUGFIX: adjusted built-in symbol recognition, now independent of case
- BUGFIX: added missing, newly added to PNut, `DEBUG_*` variables

### - Known Issues w/v1.0.0

- debug() statements that don't use double-quoted strings currently can't be parsed
- Syntax highlight of DAT section sometimes fails... RES and FIT not colored correctly
- Semantic highlight: the 'modification' attribute is being over-applied, should use more than := as test!!!!
- *I'm sure there are more issues...*

### REPORT: Source code shipped with PNut

- **LIMITATIONs**: all highlighting is working with the exception of:
- FILE `Spin2_interpreter.spin2` - breaks the syntax highlighter, but the sematic highlighter works.
- (meaning pasm instruction names, built-in names, conditions, etc. are not highlighted)
- All files with debug() statements that don't use double-quoted strings can't be parsed correctly

### REPORT: Source code shipped in P2 OBEX

- For all P2 Obex files, highlighting is working with the exception of:
- FILE `Parktransformation.spin2` I'm checking the Chip as to why this is.

## [0.3.4] 2021-03-17

5th Release of Semantic Highlighting
Expand All @@ -38,14 +78,14 @@ Syntax Adjustments:

### - Known Issues w/v0.3.4

- debug() statements that don't use double-quoted strings just can't be parsed
- Pasm: doesn't recognize round(), float(), and trunc() as pasm operand
- Incorrectly colors **built-in** constants (should be own color)
- Syntax highlight of DAT section sometimes fails... RES and FIT not colored correctly
- Semantic highlight: the 'modification' attribute is being over-applied
- Semantic highlight: the 'modification' attribute should use more than := as test!!!!
- *I'm sure there are more issues...*


## [0.3.3] 2021-03-16

4th Release of Semantic Highlighting
Expand Down Expand Up @@ -87,6 +127,7 @@ Syntax Adjustments:
- BUGFIX adjusted pub/pri to allow space before open paren

### - Known Issues w/v0.3.3

- Pasm: doesn't recognize round(), float(), and trunc() as pasm operand
- Spin: Badly handles strings (should be ignoring contents of them)
- Incorrectly colors **built-in** constants (should be own color)
Expand All @@ -97,6 +138,7 @@ Syntax Adjustments:
- *I'm sure there are more issues...*

## [0.3.2] 2021-03-12

3rd Release of Semantic Highlighting

This represents an overall improvement in parsing when there is less whitespace between things
Expand Down Expand Up @@ -128,8 +170,8 @@ Syntax Fixes:
- Semantic highlight: the 'modification' attribute should use more than := as test!!!!
- *I'm sure there are more issues...*


## [0.3.1] 2021-03-09

2nd Release of Semantic Highlighting

### - What's new
Expand Down Expand Up @@ -173,6 +215,7 @@ Syntax Fixes:


## [0.3.0] 2021-03-07

Preview Release of Semantic Highlighting

- Spin2: Initial Semantic Highlighting support (partial: Spin only, no Pasm)
Expand Down
4 changes: 4 additions & 0 deletions spin2/TEST/jm_test.spin2
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
con

SBUS_RX = 1

obj

sbus : "sbus.spin2"
Expand Down
118 changes: 60 additions & 58 deletions spin2/TEST/test-file-003.spin2
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ DAT
_xinfreq
_xtlfreq


' alignment
ALIGNL
ALIGNW

BYTE
WORD
LONG
WORD
LONG

BYTE name[23]

' assembly start
Expand Down Expand Up @@ -155,7 +155,7 @@ DAT
DRVRND
DRVZ
ENCOD
EXECF  
EXECF
FBLOCK
FGE
FGES
Expand All @@ -177,8 +177,8 @@ DAT
GETPTR
GETQX
GETQY
GETRND  
GETRND          
GETRND
GETRND
GETSCP
GETWORD
GETWORD
Expand Down Expand Up @@ -369,7 +369,7 @@ DAT
SHR
SIGNX
SKIP
SKIPF  
SKIPF
SPLITB
SPLITW
STALLI
Expand Down Expand Up @@ -440,61 +440,63 @@ DAT
' flag write controls
WC | WZ | WCZ
XORC | XORZ
ORC | ORZ
ANDC | ANDZ
ORC | ORZ
ANDC | ANDZ

' instruction conditionals
_RET_        
IF_NC_AND_NZ 
IF_NZ_AND_NC 
IF_A         
IF_00
IF_NC_AND_Z  
IF_Z_AND_NC  
IF_01        
IF_NC        
IF_AE        
IF_0X        
IF_C_AND_NZ  
IF_NZ_AND_C  
IF_10        
IF_NZ        
IF_NE        
IF_X0        
IF_C_NE_Z    
IF_Z_NE_C    
IF_DIFF      
IF_NC_OR_NZ  
IF_NZ_OR_NC  
IF_NOT_11    
IF_C_AND_Z   
IF_Z_AND_C   
IF_11        
IF_C_EQ_Z    
IF_Z_EQ_C    
IF_SAME      
IF_Z         
IF_E         
IF_X1        
IF_NC_OR_Z   
IF_Z_OR_NC   
IF_NOT_10    
IF_C         
IF_B         
IF_1X        
IF_C_OR_NZ   
IF_NZ_OR_C   
IF_NOT_01    
IF_C_OR_Z    
IF_Z_OR_C    
IF_BE        
IF_NOT_00    
_RET_        
IF_NC_AND_NZ 
IF_NZ_AND_NC 
IF_A         
IF_00
IF_NC_AND_Z  
IF_Z_AND_NC  
IF_01        
IF_NC        
IF_AE        
IF_0X        
IF_C_AND_NZ  
IF_NZ_AND_C  
IF_10        
IF_NZ        
IF_NE        
IF_X0        
IF_C_NE_Z    
IF_Z_NE_C    
IF_DIFF      
IF_NC_OR_NZ  
IF_NZ_OR_NC  
IF_NOT_11    
IF_C_AND_Z   
IF_Z_AND_C   
IF_11        
IF_C_EQ_Z    
IF_Z_EQ_C    
IF_SAME      
IF_Z         
IF_E         
IF_X1        
IF_NC_OR_Z   
IF_Z_OR_NC   
IF_NOT_10    
IF_C         
IF_B         
IF_1X        
IF_C_OR_NZ   
IF_NZ_OR_C   
IF_NOT_01    
IF_C_OR_Z    
IF_Z_OR_C    
IF_BE        
IF_NOT_00    

FIT

DAT { instructions by group }

ORG
ORGH
ORGF
CALL ' Branch
CALL ' Branch
CALLA ' Branch
Expand Down Expand Up @@ -532,7 +534,7 @@ DAT { instructions by group }

SKIP    ' Branch
SKIPF   ' Branch

TJF ' Branch
TJNF ' Branch
TJNS ' Branch
Expand Down Expand Up @@ -1001,7 +1003,7 @@ DAT { instructions by group }
P_TT_10
P_TT_11
P_USB_PAIR

' symbols that are used to setup streamers
X_16P_2DAC8_WFWORD
X_16P_4DAC4_WFWORD
Expand Down Expand Up @@ -1112,4 +1114,4 @@ CON { license }
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=================================================================================================
}}
}}
77 changes: 76 additions & 1 deletion spin2/TEST/test-file-004.spin2
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,81 @@ PUB allnamedOperators()
ROUND
TRUNC


PUB allDebugMethods()
' conditionals
IF
IFNOT
' String Output *
ZSTR
LSTR
' Unsigned Decimal
UDEC
UDEC_BYTE
UDEC_WORD
UDEC_LONG
UDEC_REG_ARRAY
UDEC_BYTE_ARRAY
UDEC_WORD_ARRAY
UDEC_LONG_ARRAY
' Signed Decimal
SDEC
SDEC_BYTE
SDEC_WORD
SDEC_LONG
SDEC_REG_ARRAY
SDEC_BYTE_ARRAY
SDEC_WORD_ARRAY
SDEC_LONG_ARRAY
' Hexadecimal Output, unsigned *
UHEX
UHEX_BYTE
UHEX_WORD
UHEX_LONG
UHEX_REG_ARRAY
UHEX_BYTE_ARRAY
UHEX_WORD_ARRAY
UHEX_LONG_ARRAY
' Hexadecimal Output, signed *
SHEX
SHEX_BYTE
SHEX_WORD
SHEX_LONG
SHEX_REG_ARRAY
SHEX_BYTE_ARRAY
SHEX_WORD_ARRAY
SHEX_LONG_ARRAY
' Binary Output, unsigned *
UBIN
UBIN_BYTE
UBIN_WORD
UBIN_LONG
UBIN_REG_ARRAY
UBIN_BYTE_ARRAY
UBIN_WORD_ARRAY
UBIN_LONG_ARRAY
' Binary Output, signed *
SBIN
SBIN_BYTE
SBIN_WORD
SBIN_LONG
SBIN_REG_ARRAY
SBIN_BYTE_ARRAY
SBIN_WORD_ARRAY
SBIN_LONG_ARRAY
' DEBUG constants
DEBUG_COGS
DEBUG_DELAY
DEBUG_PIN
DEBUG_BAUD
DEBUG_TIMESTAMP
DEBUG_LOG_SIZE
DEBUG_LEFT
DEBUG_TOP
DEBUG_WIDTH
DEBUG_HEIGHT
DEBUG_DISPLAY_LEFT
DEBUG_DISPLAY_TOP
DEBUG_WINDOWS_OFF

PUB allFlowControl()
ABORT
Expand All @@ -214,6 +288,7 @@ PUB allFlowControl()
TO
UNTIL
WHILE
RETURN


PUB allSmartPinAliases()
Expand Down
2 changes: 1 addition & 1 deletion spin2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Spin2",
"description": "Spin2/Pasm2 Syntax/Semantic Highlighting w/Code Outline support",
"icon": "images/Propeller.ico",
"version": "0.3.4",
"version": "1.0.0",
"publisher": "IronSheepProductionsLLC",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 544ba0a

Please sign in to comment.