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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,9 @@
[submodule "vendor/grammars/syntax"]
path = vendor/grammars/syntax
url = https://github.com/hashicorp/syntax.git
[submodule "vendor/grammars/tact-vscode"]
path = vendor/grammars/tact-vscode
url = https://github.com/tact-lang/tact-vscode.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 @@ -1043,6 +1043,8 @@ vendor/grammars/syntax:
- source.hcl
- source.hcl.terraform
- source.sentinel
vendor/grammars/tact-vscode:
- 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 @@ -713,6 +713,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*\{\"project\"\:'
- 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 @@ -3168,6 +3168,7 @@ JSON:
- ".JSON-tmLanguage"
- ".jsonl"
- ".mcmeta"
- ".tact"
- ".tfstate"
- ".tfstate.backup"
- ".topojson"
Expand Down Expand Up @@ -6970,6 +6971,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