Skip to content

Commit

Permalink
small spin2 fixes, getting ever better
Browse files Browse the repository at this point in the history
  • Loading branch information
ironsheep committed Dec 1, 2020
1 parent dbfbed5 commit 1a4353e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 17 deletions.
6 changes: 6 additions & 0 deletions spin2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Possible next additions:
- Add new-file templates as Snippets
- Add additional Snippets as the community identifies them

## [0.2.2] 2020-11-30

### Minor update

- Spin2: Added missing named operators

## [0.2.1] 2020-11-25

### Minor repairs
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 Hightlighting and Code Outline support",
"icon": "images/Propeller.ico",
"version": "0.2.1",
"version": "0.2.2",
"publisher": "IronSheep",
"repository": {
"type": "git",
Expand Down
20 changes: 12 additions & 8 deletions spin2/syntaxes/spin2.tmLanguage.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,10 @@ repository:
'1':
name: constant.numeric.base4.spin2
spin_field_operations:
name: keyword.spin.operators.fields.spin2
name: keyword.operator.field.spin2
match: '(?i)\b(ADDBITS|ADDPINS)\b'

spin_float_operators:
name: keyword.spin.operators.float.spin2
name: keyword.operator.float.spin2
match: '(?i)\b(FLOAT|ROUND|TRUNC)\b'
spin_language_tiny:
name: meta.block.spin.language.spin2
Expand All @@ -397,6 +396,8 @@ repository:
include: '#string'
-
include: '#spin_field_operations'
-
include: '#spin_float_operators'
-
include: '#debug_functions'
-
Expand All @@ -409,7 +410,7 @@ repository:
include: '#cog_register_names'
-
name: keyword.control.flow.spin2
match: '(?i)\b(IF|ELSEIF|ELSEIFNOT|ELSE|IFNOT|NOT|CASE|CASE_FAST|OTHER|REPEAT|FROM|TO|STEP|UNTIL|WHILE|NEXT|QUIT|RETURN|ABORT)\b'
match: '(?i)\b(IF|ELSEIF|ELSEIFNOT|ELSE|IFNOT|CASE|CASE_FAST|OTHER|REPEAT|FROM|TO|STEP|UNTIL|WHILE|NEXT|QUIT|RETURN|ABORT)\b'
-
name: keyword.spin.methods.hub.spin2
match: '(?i)\b(COG(CHK|ID|INIT|SPIN|STOP)|(HUB|CLK)SET|LOCK(NEW|RET|TRY|REL|CHK)|(COG|POLL|WAIT)ATN)\b'
Expand Down Expand Up @@ -452,6 +453,12 @@ repository:
-
name: constant.language.clkset.spin2
match: '\b(clkmode_|clkfreq_)\b'
-
name: keyword.operator.unary.spin2
match: '(?i)\b(!!|NOT|!|-|ABS|ENCOD|DECOD|BMASK|ONES|SQRT|QLOG|QEXP)\b'
-
name: keyword.operator.binary.spin2
match: '(?i)(SAR|ROR|ROL|REV|ZEROX|SIGNX|SCAS?|FRAC|AND|XOR|OR)'
smartpins_constants:
name: meta.block.spin.language.spin2
patterns:
Expand Down Expand Up @@ -529,13 +536,10 @@ repository:
match: '(?i)(~~|~|\\)'
-
name: keyword.operator.binary.spin2
match: '(?i)(>>|<<|SAR|ROR|ROL|REV|ZEROX|SIGNX|&|^|\|*|/|+/|//|+//|SCA|SCAS|FRAC|+|-|#>|<#|<|+<|<=|+<=|==|<>|>=|+>=|>|+>|<=>|&&|AND||^^|XOR|\|\||OR)'
match: '(?i)(>>|<<|SAR|ROR|ROL|REV|ZEROX|SIGNX|&|^|\|*|/|+/|//|+//|SCAS?|FRAC|+|-|#>|<#|<|+<|<=|+<=|==|<>|>=|+>=|>|+>|<=>|&&|AND||^^|XOR|\|\||OR)'
-
name: keyword.operator.address.spin2
match: '(?i)\b(@@|@|#)\b'
-
name: keyword.operator.unary.spin2
match: '(?i)\b(!!|NOT|!|-|ABS|ENCOD|DECOD|BMASK|ONES|SQRT|QLOG|QEXP)\b'
string:
name: string.quoted.double.spin2
begin: '"'
Expand Down
23 changes: 15 additions & 8 deletions spin2/syntaxes/spin2.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -584,11 +584,11 @@
}
},
"spin_field_operations": {
"name": "keyword.spin.operators.fields.spin2",
"name": "keyword.operator.field.spin2",
"match": "(?i)\\b(ADDBITS|ADDPINS)\\b"
},
"spin_float_operators": {
"name": "keyword.spin.operators.float.spin2",
"name": "keyword.operator.float.spin2",
"match": "(?i)\\b(FLOAT|ROUND|TRUNC)\\b"
},
"spin_language_tiny": {
Expand All @@ -612,6 +612,9 @@
{
"include": "#spin_field_operations"
},
{
"include": "#spin_float_operators"
},
{
"include": "#debug_functions"
},
Expand All @@ -629,7 +632,7 @@
},
{
"name": "keyword.control.flow.spin2",
"match": "(?i)\\b(IF|ELSEIF|ELSEIFNOT|ELSE|IFNOT|NOT|CASE|CASE_FAST|OTHER|REPEAT|FROM|TO|STEP|UNTIL|WHILE|NEXT|QUIT|RETURN|ABORT)\\b"
"match": "(?i)\\b(IF|ELSEIF|ELSEIFNOT|ELSE|IFNOT|CASE|CASE_FAST|OTHER|REPEAT|FROM|TO|STEP|UNTIL|WHILE|NEXT|QUIT|RETURN|ABORT)\\b"
},
{
"name": "keyword.spin.methods.hub.spin2",
Expand Down Expand Up @@ -686,6 +689,14 @@
{
"name": "constant.language.clkset.spin2",
"match": "\\b(clkmode_|clkfreq_)\\b"
},
{
"name": "keyword.operator.unary.spin2",
"match": "(?i)\\b(!!|NOT|!|-|ABS|ENCOD|DECOD|BMASK|ONES|SQRT|QLOG|QEXP)\\b"
},
{
"name": "keyword.operator.binary.spin2",
"match": "(?i)(SAR|ROR|ROL|REV|ZEROX|SIGNX|SCAS?|FRAC|AND|XOR|OR)"
}
]
},
Expand Down Expand Up @@ -792,15 +803,11 @@
},
{
"name": "keyword.operator.binary.spin2",
"match": "(?i)(>>|<<|SAR|ROR|ROL|REV|ZEROX|SIGNX|&|^|\\|*|/|+/|//|+//|SCA|SCAS|FRAC|+|-|#>|<#|<|+<|<=|+<=|==|<>|>=|+>=|>|+>|<=>|&&|AND||^^|XOR|\\|\\||OR)"
"match": "(?i)(>>|<<|SAR|ROR|ROL|REV|ZEROX|SIGNX|&|^|\\|*|/|+/|//|+//|SCAS?|FRAC|+|-|#>|<#|<|+<|<=|+<=|==|<>|>=|+>=|>|+>|<=>|&&|AND||^^|XOR|\\|\\||OR)"
},
{
"name": "keyword.operator.address.spin2",
"match": "(?i)\\b(@@|@|#)\\b"
},
{
"name": "keyword.operator.unary.spin2",
"match": "(?i)\\b(!!|NOT|!|-|ABS|ENCOD|DECOD|BMASK|ONES|SQRT|QLOG|QEXP)\\b"
}
]
},
Expand Down

0 comments on commit 1a4353e

Please sign in to comment.