Tact Documentation
GitHubGitHub (opens in a new tab)
  • Getting started
  • Writing your first contract
  • Deploying your contract
  • Learn
    • Tact Hello World
    • Tact wallet contract
    • Tact jetton contract
  • Guides
    • Type system
    • Functions
    • Statements
    • Message lifecycle
    • Send messages
    • Contract upgrades
    • Compatibility with Func
    • Grammar
  • Reference
    • Common
    • Strings
    • Random
    • Math
    • Cells, Builders and Slices
    • Advanced
  • Libraries
    • @stdlib/deploy
    • @stdlib/ownable
    • @stdlib/stoppable
  • Tools
    • Typescript
    • VS Code Extension
  • Getting started
  • Writing your first contract
  • Deploying your contract
  • Learn
    • Tact Hello World
    • Tact wallet contract
    • Tact jetton contract
  • Guides
    • Type system
    • Functions
    • Statements
    • Message lifecycle
    • Send messages
    • Contract upgrades
    • Compatibility with Func
    • Grammar
  • Reference
    • Common
    • Strings
    • Random
    • Math
    • Cells, Builders and Slices
    • Advanced
  • Libraries
    • @stdlib/deploy
    • @stdlib/ownable
    • @stdlib/stoppable
  • Tools
    • Typescript
    • VS Code Extension
Edit this page
Guides
Grammar

Tact Grammar Files

Main Tact grammar is defined in OHM (opens in a new tab), but alternative grammars that are useful for editors are defined too.

Example of code highlight using current Textmate grammer:

import "@stdlib/ownable";
 
struct SampleStruct {
    message: Int as uint32;
}
 
message(0x1234) MyMessage {
    data: SampleStruct;
}
 
trait MyTrait {
    get fun traitState(): Int {
        return 0;
    }
}
 
contract MyContract with MyTrait, Ownable {
 
    owner: Address;
 
    init(owner: Address) {
        self.owner = owner;
    }
}
 
Compatibility with FuncCommon

MIT 2023 © Steve Korshakov.