Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add language: Tact, and extension to JSON #6689

Merged
merged 10 commits into from
Nov 25, 2024
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,9 @@
[submodule "vendor/grammars/syntax-mcfunction"]
path = vendor/grammars/syntax-mcfunction
url = https://github.com/MinecraftCommands/syntax-mcfunction.git
[submodule "vendor/grammars/tact-sublime"]
path = vendor/grammars/tact-sublime
url = https://github.com/tact-lang/tact-sublime.git
[submodule "vendor/grammars/tcl.tmbundle"]
path = vendor/grammars/tcl.tmbundle
url = https://github.com/textmate/tcl.tmbundle
Expand Down
2 changes: 2 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,8 @@ vendor/grammars/syntax:
- source.sentinel
vendor/grammars/syntax-mcfunction:
- source.mcfunction
vendor/grammars/tact-sublime:
- source.tact
vendor/grammars/tcl.tmbundle:
- source.tcl
- text.html.tcl
Expand Down
5 changes: 5 additions & 0 deletions lib/linguist/heuristics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,11 @@ disambiguations:
pattern: '^\s*(?:use\s+v6\b|\bmodule\b|\bmy\s+class\b)'
- language: Turing
pattern: '^\s*%[ \t]+|^\s*var\s+\w+(\s*:\s*\w+)?\s*:=\s*\w+'
- extensions: ['.tact']
rules:
- language: JSON
pattern: '\A\s*\{\"'
- language: Tact
- extensions: ['.tag']
rules:
- language: Java Server Pages
Expand Down
9 changes: 9 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3275,6 +3275,7 @@ JSON:
- ".jsonl"
- ".mcmeta"
- ".sarif"
- ".tact"
- ".tfstate"
- ".tfstate.backup"
- ".topojson"
Expand Down Expand Up @@ -7225,6 +7226,14 @@ TXL:
tm_scope: source.txl
ace_mode: text
language_id: 366
Tact:
type: programming
color: "#48b5ff"
extensions:
- ".tact"
ace_mode: text
tm_scope: source.tact
language_id: 606708469
Talon:
type: programming
ace_mode: text
Expand Down
1 change: 1 addition & 0 deletions samples/JSON/landing.tact
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"project":{"createdAt":1629543532823,"description":"","layout":{"layouts":{"VestBack":[{"index":0,"x":0,"y":0},{"index":1,"x":0.333,"y":0},{"index":2,"x":0.667,"y":0},{"index":3,"x":1,"y":0},{"index":4,"x":0,"y":0.25},{"index":5,"x":0.333,"y":0.25},{"index":6,"x":0.667,"y":0.25},{"index":7,"x":1,"y":0.25},{"index":8,"x":0,"y":0.5},{"index":9,"x":0.333,"y":0.5},{"index":10,"x":0.667,"y":0.5},{"index":11,"x":1,"y":0.5},{"index":12,"x":0,"y":0.75},{"index":13,"x":0.333,"y":0.75},{"index":14,"x":0.667,"y":0.75},{"index":15,"x":1,"y":0.75},{"index":16,"x":0,"y":1},{"index":17,"x":0.333,"y":1},{"index":18,"x":0.667,"y":1},{"index":19,"x":1,"y":1}],"VestFront":[{"index":0,"x":0,"y":0},{"index":1,"x":0.333,"y":0},{"index":2,"x":0.667,"y":0},{"index":3,"x":1,"y":0},{"index":4,"x":0,"y":0.25},{"index":5,"x":0.333,"y":0.25},{"index":6,"x":0.667,"y":0.25},{"index":7,"x":1,"y":0.25},{"index":8,"x":0,"y":0.5},{"index":9,"x":0.333,"y":0.5},{"index":10,"x":0.667,"y":0.5},{"index":11,"x":1,"y":0.5},{"index":12,"x":0,"y":0.75},{"index":13,"x":0.333,"y":0.75},{"index":14,"x":0.667,"y":0.75},{"index":15,"x":1,"y":0.75},{"index":16,"x":0,"y":1},{"index":17,"x":0.333,"y":1},{"index":18,"x":0.667,"y":1},{"index":19,"x":1,"y":1}]},"name":"Tactot","type":"Tactot"},"mediaFileDuration":3,"name":"landing","tracks":[{"effects":[{"modes":{"VestBack":{"dotMode":{"dotConnected":false,"feedback":[{"endTime":300,"playbackType":"NONE","startTime":0,"pointList":[]}]},"mode":"PATH_MODE","pathMode":{"feedback":[{"movingPattern":"CONST_SPEED","playbackType":"FADE_OUT","pointList":[{"intensity":0.7,"time":0,"x":0,"y":1},{"intensity":0.7,"time":300,"x":0,"y":0}],"visible":true},{"movingPattern":"CONST_SPEED","playbackType":"FADE_OUT","pointList":[{"intensity":0.7,"time":0,"x":0.33,"y":1},{"intensity":0.7,"time":300,"x":0.34,"y":0}],"visible":true},{"movingPattern":"CONST_SPEED","playbackType":"FADE_OUT","pointList":[{"intensity":0.7,"time":0,"x":0.67,"y":1},{"intensity":0.7,"time":300,"x":0.67,"y":0}],"visible":true},{"movingPattern":"CONST_SPEED","playbackType":"FADE_OUT","pointList":[{"intensity":0.7,"time":0,"x":1,"y":1},{"intensity":0.7,"time":300,"x":1,"y":0}],"visible":true},{"movingPattern":"CONST_SPEED","playbackType":"NONE","pointList":[{"intensity":0.7,"time":0,"x":0,"y":1},{"intensity":0.7,"time":73,"x":0.33,"y":0.76},{"intensity":0.7,"time":150,"x":0,"y":0.48},{"intensity":0.7,"time":223,"x":0.34,"y":0.25},{"intensity":0.7,"time":300,"x":0,"y":0}],"visible":true},{"movingPattern":"CONST_SPEED","playbackType":"NONE","pointList":[{"intensity":0.7,"time":0,"x":1,"y":1},{"intensity":0.7,"time":74,"x":0.67,"y":0.75},{"intensity":0.7,"time":148,"x":1,"y":0.5},{"intensity":0.7,"time":223,"x":0.66,"y":0.25},{"intensity":0.7,"time":300,"x":1,"y":0}],"visible":true}]}},"VestFront":{"dotMode":{"dotConnected":false,"feedback":[{"endTime":300,"playbackType":"NONE","startTime":0,"pointList":[]}]},"mode":"PATH_MODE","pathMode":{"feedback":[{"movingPattern":"CONST_SPEED","playbackType":"FADE_OUT","pointList":[{"intensity":0.7,"time":0,"x":0,"y":1},{"intensity":0.7,"time":300,"x":0,"y":0}],"visible":true},{"movingPattern":"CONST_SPEED","playbackType":"FADE_OUT","pointList":[{"intensity":0.7,"time":0,"x":0.33,"y":1},{"intensity":0.7,"time":300,"x":0.34,"y":0}],"visible":true},{"movingPattern":"CONST_SPEED","playbackType":"FADE_OUT","pointList":[{"intensity":0.7,"time":0,"x":0.67,"y":1},{"intensity":0.7,"time":300,"x":0.67,"y":0}],"visible":true},{"movingPattern":"CONST_SPEED","playbackType":"FADE_OUT","pointList":[{"intensity":0.7,"time":0,"x":1,"y":1},{"intensity":0.7,"time":300,"x":1,"y":0}],"visible":true},{"movingPattern":"CONST_SPEED","playbackType":"NONE","pointList":[{"intensity":0.7,"time":0,"x":0,"y":1},{"intensity":0.7,"time":73,"x":0.33,"y":0.76},{"intensity":0.7,"time":150,"x":0,"y":0.48},{"intensity":0.7,"time":223,"x":0.34,"y":0.25},{"intensity":0.7,"time":300,"x":0,"y":0}],"visible":true},{"movingPattern":"CONST_SPEED","playbackType":"NONE","pointList":[{"intensity":0.7,"time":0,"x":1,"y":1},{"intensity":0.7,"time":74,"x":0.67,"y":0.75},{"intensity":0.7,"time":148,"x":1,"y":0.5},{"intensity":0.7,"time":223,"x":0.66,"y":0.25},{"intensity":0.7,"time":300,"x":1,"y":0}],"visible":true}]}}},"name":"Effect 1","offsetTime":300,"startTime":550}],"enable":true},{"enable":true,"effects":[]}],"updatedAt":1630238182973},"durationMillis":0,"intervalMillis":20,"size":20}
20 changes: 20 additions & 0 deletions samples/Tact/deployable_counter.tact
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// this trait has to be imported
import "@stdlib/deploy";

// the Deployable trait adds a default receiver for the "Deploy" message
contract Counter with Deployable {

val: Int as uint32;

init() {
self.val = 0;
}

receive("increment") {
self.val = self.val + 1;
}

get fun value(): Int {
return self.val;
}
}
Loading
Loading