tree-sitter-t32


Nametree-sitter-t32 JSON
Version 6.0.1 PyPI version JSON
download
home_pageNone
SummaryLauterbach TRACE32® script language grammar for Tree-sitter
upload_time2025-07-18 19:44:54
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords lexer incremental parsing tree-sitter trace32 t32 lauterbach practice
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!--
SPDX-FileCopyrightText: 2022 Christoph Sax <c_sax@mailbox.org>

SPDX-License-Identifier: MIT
-->

# tree-sitter-t32
[![CI Status](https://ci.codeberg.org/api/badges/xasc/tree-sitter-t32/status.svg)](https://ci.codeberg.org/xasc/tree-sitter-t32)
[![status-badge](https://ci.codeberg.org/api/badges/14550/status.svg?branch=dev)](https://ci.codeberg.org/repos/14550/branches/dev)

Lauterbach TRACE32® script language grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
Support for HLL expressions was adapted from [tree-sitter-c](https://github.com/tree-sitter/tree-sitter-c.git).

A demo is available [here](https://xasc.codeberg.page/tree-sitter-t32-playground/).

## Features

- Full coverage of the PRACTICE script language including TRACE32® commands & functions
- Extended support for HLL expressions


## Quick Start

### Dependencies

- [Tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/blob/master/cli/README.md) for generating the parser from the grammar.
- A C compiler
- [Make](https://www.gnu.org/software/make/manual) [optional]
- [Yarn](https://yarnpkg.com/) [optional]


### Commands

#### Generate parser

Create and build the tree-sitter parser for the TRACE32® grammar.
```bash
tree-sitter generate
```

#### Parse TRACE32® Script

<details>

<summary>Use tree-sitter to parse a TRACE32® script.</summary>

Example:

```
; --------------------------------------------------------------------------------
; @Title: Beautify an existing PRACTICE script
; @Description:
;   Beautifies the script, fixing the CamelCasing and indentation.
; @Keywords: PRACTICE, EDIT.FORMAT, CamelCasing, indent, beautify
; @Author: MOB
; @Copyright: (C) 1989-2020 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Id: beautify.cmm 19661 2022-07-29 15:43:03Z rweiss $

PARAMETERS &script

IF "&script"==""
(
  DIALOG.File.open *.cmm
  ENTRY %LINE &script
)

IF FILE.EXIST("&script")
(
  ECHO %COLOR.GRAY "beautifying: &script"
  SETUP.EDITOR.TYPE PowerView ; required for EDIT.FORMAT
  PEDIT "&script"
  EDIT.FORMAT /Beautify
  EDIT.SAVE "&script"
  EDIT.CLOSE "&script"
  ECHO %COLOR.GREEN "beautified: &script"
)
ELSE
(
  ECHO %ERROR "Error: no such file: &script"
)

ENDDO
```

</details>

```bash
tree-sitter parse <path>
```

<details>

<summary>Prints the syntax tree</summary>

```
(script [0, 0] - [34, 0]
  (comment [0, 0] - [1, 0])
  (comment [1, 0] - [2, 0])
  (comment [2, 0] - [3, 0])
  (comment [3, 0] - [4, 0])
  (comment [4, 0] - [5, 0])
  (comment [5, 0] - [6, 0])
  (comment [6, 0] - [7, 0])
  (comment [7, 0] - [8, 0])
  (comment [8, 0] - [9, 0])
  (parameter_declaration [10, 0] - [11, 0]
    command: (identifier [10, 0] - [10, 10])
    macro: (macro [10, 11] - [10, 18]))
  (if_block [12, 0] - [18, 0]
    command: (identifier [12, 0] - [12, 2])
    condition: (binary_expression [12, 3] - [12, 16]
      left: (string [12, 3] - [12, 12]
        (macro [12, 4] - [12, 11]))
      right: (string [12, 14] - [12, 16]))
    (block [13, 0] - [17, 0]
      (command_expression [14, 2] - [15, 0]
        command: (identifier [14, 2] - [14, 18])
        arguments: (argument_list [14, 18] - [14, 24]
          (path [14, 19] - [14, 24])))
      (parameter_declaration [15, 2] - [16, 0]
        command: (identifier [15, 2] - [15, 7])
        (identifier [15, 8] - [15, 13])
        macro: (macro [15, 14] - [15, 21]))))
  (if_block [18, 0] - [32, 0]
    command: (identifier [18, 0] - [18, 2])
    condition: (call_expression [18, 3] - [18, 24]
      function: (identifier [18, 3] - [18, 13])
      arguments: (argument_list [18, 13] - [18, 24]
        (string [18, 14] - [18, 23]
          (macro [18, 15] - [18, 22]))))
    (block [19, 0] - [28, 0]
      (command_expression [20, 2] - [21, 0]
        command: (identifier [20, 2] - [20, 6])
        arguments: (argument_list [20, 6] - [20, 41]
          (format_expression [20, 7] - [20, 18]
            value: (identifier [20, 8] - [20, 13])
            value: (identifier [20, 14] - [20, 18]))
          (string [20, 19] - [20, 41]
            (macro [20, 33] - [20, 40]))))
      (command_expression [21, 2] - [22, 0]
        command: (identifier [21, 2] - [21, 19])
        arguments: (argument_list [21, 19] - [21, 29]
          (identifier [21, 20] - [21, 29]))
        (comment [21, 29] - [22, 0]))
      (command_expression [22, 2] - [23, 0]
        command: (identifier [22, 2] - [22, 7])
        arguments: (argument_list [22, 7] - [22, 17]
          (string [22, 8] - [22, 17]
            (macro [22, 9] - [22, 16]))))
      (command_expression [23, 2] - [24, 0]
        command: (identifier [23, 2] - [23, 13])
        arguments: (argument_list [23, 13] - [23, 23]
          (option_expression [23, 14] - [23, 23]
            option: (identifier [23, 15] - [23, 23]))))
      (command_expression [24, 2] - [25, 0]
        command: (identifier [24, 2] - [24, 11])
        arguments: (argument_list [24, 11] - [24, 21]
          (string [24, 12] - [24, 21]
            (macro [24, 13] - [24, 20]))))
      (command_expression [25, 2] - [26, 0]
        command: (identifier [25, 2] - [25, 12])
        arguments: (argument_list [25, 12] - [25, 22]
          (string [25, 13] - [25, 22]
            (macro [25, 14] - [25, 21]))))
      (command_expression [26, 2] - [27, 0]
        command: (identifier [26, 2] - [26, 6])
        arguments: (argument_list [26, 6] - [26, 41]
          (format_expression [26, 7] - [26, 19]
            value: (identifier [26, 8] - [26, 13])
            value: (identifier [26, 14] - [26, 19]))
          (string [26, 20] - [26, 41]
            (macro [26, 33] - [26, 40])))))
    (else_block [28, 0] - [32, 0]
      command: (identifier [28, 0] - [28, 4])
      (block [29, 0] - [32, 0]
        (command_expression [30, 2] - [31, 0]
          command: (identifier [30, 2] - [30, 6])
          arguments: (argument_list [30, 6] - [30, 44]
            (format_expression [30, 7] - [30, 13]
              value: (identifier [30, 8] - [30, 13]))
            (string [30, 14] - [30, 44]
              (macro [30, 36] - [30, 43])))))))
  (command_expression [33, 0] - [34, 0]
    command: (identifier [33, 0] - [33, 5])))
```

</details>

#### Highlight TRACE32® Script

Use tree-sitter to highlight a TRACE32® script.
```bash
tree-sitter highlight <path>
```

<details>

<summary>Prints the highlighted file</summary>

[![asciicast](https://asciinema.org/a/fY05yHO74XYG6vPngFG3zAgUb.svg)](https://asciinema.org/a/fY05yHO74XYG6vPngFG3zAgUb)

</details>

#### Create Code Navigation Tags

<details>

<summary>Use tree-sitter to create a tags file from a TRACE32® script.</summary>

```
; --------------------------------------------------------------------------------
; @Title: Example test case for Unittests
; @Description:
;   This is an example for a test case which can be executed with lbunit.cmm.
; @Keywords: lbtest test case
; @Author: MOB
; @Copyright: (C) 1989-2015 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Id: test_example.cmm 8648 2015-09-03 17:04:05Z mobermeir $

; the following block must be present in the beginning of every test case
PRIVATE &func &args &result
ENTRY &func %LINE &args
GOSUB &func &args // call subroutine and return result
ENTRY %LINE &result
ENDDO &result
; end of mandatory block

; SetupTestCase will be called once at the beginning of the test case
; It can be removed if it is not needed.
SetupTestCase:
(
  PRIVATE &date
  &date=DATE.DATE()+" "+DATE.TIME()
  PUTS "test case started at: &date"
  RETURN
)

; SetupTest will be called just before every test
; It can be removed if it is not needed.
SetupTest:
(
  ; here can be some setup
  Data.Set VM:0x0--0xFF 0xA
  RETURN
)

; All tests must start with "Test_"
Test_MyFirstTest:
(
  ; Assertions can be used:
  A_FALSE FALSE()
  A_TRUE (1.+1.==2.)
  RETURN
)

Test_MySecondTest:
(
  A_NUM_EQ 0xA Data.Byte(VM:0x0)
  A_X_PASS Data.Set VM:0x0 0xB
  A_NUM_EQ 0xB Data.Byte(VM:0x0)
  RETURN
)

Test_MyThirdTest:
(
  ; Tests can return "PASS", "FAIL" or "NOT_EXEC"
  ; (alternatively or in addition to assertions)
  IF (0xA!=Data.Byte(VM:0x0))
  (
    RETURN "FAIL"
  )
  ELSE IF (0xB==Data.Byte(VM:0x0))
  (
    RETURN "NOT_EXEC"
  )
  ELSE
  (
    RETURN "PASS"
  )
  RETURN // same as "PASS"
)

MyHelper:
(
  A_NUM_EQ 0xA Data.Byte(VM:0x10)
  RETURN
)

Test_MyFourthTest:
(
  ; tests can call helper functions
  RePeaT 2.
  (
    GOSUB MyHelper
  )
  RETURN
)

DisabledTest_MyFifthTest:
(
  ; this routine will not be executed since it doesn't start with "Test_"
  RETURN
)

; TearDownTest will be called just after every test
; It can be removed if it is not needed.
TearDownTest:
(
  ; here could be some cleanup
  Break.RESet
  RETURN
)

; TearDownTestCase will be called once at the end of the test case
; It can be removed if it is not needed.
TearDownTestCase:
(
  PRIVATE &date
  &date=DATE.DATE()+" "+DATE.TIME()
  PUTS "test case ended at: &date"
  RETURN
)
```

</details>

```bash
tree-sitter tags <path>
```

<details>

<summary>Prints a list of tags</summary>

```
func      	 | call    	ref (13, 7) - (13, 11) `GOSUB &func &args // call subroutine and return result`
SetupTestCase	 | function	def (20, 0) - (20, 13) `SetupTestCase:`
SetupTest 	 | function	def (30, 0) - (30, 9) `SetupTest:`
Test_MyFirstTest	 | function	def (38, 0) - (38, 16) `Test_MyFirstTest:`
Test_MySecondTest	 | function	def (46, 0) - (46, 17) `Test_MySecondTest:`
Test_MyThirdTest	 | function	def (54, 0) - (54, 16) `Test_MyThirdTest:`
MyHelper  	 | function	def (73, 0) - (73, 8) `MyHelper:`
Test_MyFourthTest	 | function	def (79, 0) - (79, 17) `Test_MyFourthTest:`
MyHelper  	 | call    	ref (84, 10) - (84, 18) `GOSUB MyHelper`
DisabledTest_MyFifthTest	 | function	def (89, 0) - (89, 24) `DisabledTest_MyFifthTest:`
TearDownTest	 | function	def (97, 0) - (97, 12) `TearDownTest:`
TearDownTestCase	 | function	def (106, 0) - (106, 16) `TearDownTestCase:`
```

</details>


## Development

There is a makefile to simplify the most common activities. The makefile expects you to have Yarn installed and set up.

To build the parser from the grammar:

    make build


To run all tests:

    make test-all


## Editor Support

| Editor                                                     | Plugin                                                                | Syntax Highlighting | Local Variables  | Folds  | Indents  |
| -------------                                              | -------------                                                         | :-----------------: | :--------------: | :----: | :------: |
| [Neovim](https://github.com/neovim/neovim)                 | [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) | ✓                   | ✓                | ✓      | ✓        |
| [Helix](https://github.com/helix-editor/helix/tree/master) |                                                                       | ✓                   |                  |        |          |

### nvim-treesitter

Run
```vim
:TSInstall t32
```
to automatically install the supported grammar.

## Limitations

- `(symbol)` nodes that represent an unquoted module, like `\module`, cannot be
  differentiated from node type `(trace32_hll_variable)`, e.g. `\x`.
- `(symbol)` nodes that depend on the hex radix mode cannot always be
  kept apart from `(address)` nodes, e.g. `P:A::B:0x800`. To avoid conflicts always add
  the radix mode to the number.
- Commands from the `Var` command group that contain multiple chained
  `(format_expression) (_hll_expression)` blocks
- Unquoted `(path)` nodes are not clearly distinguishable from other literal types
  in command argument lists.
- For HLL expressions used at the top level of commands, the use of spaces is more restricted
  than for nested expressions inside parentheses. The grammar only models the strict behavior.
- PRACTICE comments start with either `//` or `;`. However, in HLL expressions
  `;` can be used as separator for multiple statements. The grammar will always interpret `;`
  as the start of `(comment)` node.
- `(recursive_macro_expansion)` nodes are restricted to the left-hand side of assignment
  expressions. In other contexts, recursive PRACTICE macro expansions cannot be distinguished
  from `&&` operators.


## Packages

| Language      | Package                                               | Download                                              |
| ------------- | ----------------------------------------------------- | ----------------------------------------------------- |
| Python        | [PyPI](https://pypi.org/project/tree-sitter-t32/)     | [📦](https://pypi.org/project/tree-sitter-t32/#files) |
| Rust          | [crates.io](https://crates.io/crates/tree-sitter-t32) |                                                       |

## Mirrors

This repository is mirrored to https://gitlab.com/xasc/tree-sitter-t32. The main repository is https://codeberg.org/xasc/tree-sitter-t32.


## References

- [PRACTICE Script Language User’s Guide](https://www.lauterbach.com/pdf/practice_user.pdf)
- [Training Script Language PRACTICE](https://www.lauterbach.com/pdf/training_practice.pdf)
- [PowerView User’s Guide](https://www.lauterbach.com/pdf/ide_user.pdf)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tree-sitter-t32",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "lexer, incremental, parsing, tree-sitter, trace32, t32, lauterbach, practice",
    "author": null,
    "author_email": "Christoph Sax <c_sax@mailbox.org>",
    "download_url": "https://files.pythonhosted.org/packages/58/da/c9e1615e1e41b6cc2b2f3d169129d69b5ce722b233753860eb5e97d36741/tree_sitter_t32-6.0.1.tar.gz",
    "platform": null,
    "description": "<!--\nSPDX-FileCopyrightText: 2022 Christoph Sax <c_sax@mailbox.org>\n\nSPDX-License-Identifier: MIT\n-->\n\n# tree-sitter-t32\n[![CI Status](https://ci.codeberg.org/api/badges/xasc/tree-sitter-t32/status.svg)](https://ci.codeberg.org/xasc/tree-sitter-t32)\n[![status-badge](https://ci.codeberg.org/api/badges/14550/status.svg?branch=dev)](https://ci.codeberg.org/repos/14550/branches/dev)\n\nLauterbach TRACE32\u00ae script language grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).\nSupport for HLL expressions was adapted from [tree-sitter-c](https://github.com/tree-sitter/tree-sitter-c.git).\n\nA demo is available [here](https://xasc.codeberg.page/tree-sitter-t32-playground/).\n\n## Features\n\n- Full coverage of the PRACTICE script language including TRACE32\u00ae commands & functions\n- Extended support for HLL expressions\n\n\n## Quick Start\n\n### Dependencies\n\n- [Tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/blob/master/cli/README.md) for generating the parser from the grammar.\n- A C compiler\n- [Make](https://www.gnu.org/software/make/manual) [optional]\n- [Yarn](https://yarnpkg.com/) [optional]\n\n\n### Commands\n\n#### Generate parser\n\nCreate and build the tree-sitter parser for the TRACE32\u00ae grammar.\n```bash\ntree-sitter generate\n```\n\n#### Parse TRACE32\u00ae Script\n\n<details>\n\n<summary>Use tree-sitter to parse a TRACE32\u00ae script.</summary>\n\nExample:\n\n```\n; --------------------------------------------------------------------------------\n; @Title: Beautify an existing PRACTICE script\n; @Description:\n;   Beautifies the script, fixing the CamelCasing and indentation.\n; @Keywords: PRACTICE, EDIT.FORMAT, CamelCasing, indent, beautify\n; @Author: MOB\n; @Copyright: (C) 1989-2020 Lauterbach GmbH, licensed for use with TRACE32(R) only\n; --------------------------------------------------------------------------------\n; $Id: beautify.cmm 19661 2022-07-29 15:43:03Z rweiss $\n\nPARAMETERS &script\n\nIF \"&script\"==\"\"\n(\n  DIALOG.File.open *.cmm\n  ENTRY %LINE &script\n)\n\nIF FILE.EXIST(\"&script\")\n(\n  ECHO %COLOR.GRAY \"beautifying: &script\"\n  SETUP.EDITOR.TYPE PowerView ; required for EDIT.FORMAT\n  PEDIT \"&script\"\n  EDIT.FORMAT /Beautify\n  EDIT.SAVE \"&script\"\n  EDIT.CLOSE \"&script\"\n  ECHO %COLOR.GREEN \"beautified: &script\"\n)\nELSE\n(\n  ECHO %ERROR \"Error: no such file: &script\"\n)\n\nENDDO\n```\n\n</details>\n\n```bash\ntree-sitter parse <path>\n```\n\n<details>\n\n<summary>Prints the syntax tree</summary>\n\n```\n(script [0, 0] - [34, 0]\n  (comment [0, 0] - [1, 0])\n  (comment [1, 0] - [2, 0])\n  (comment [2, 0] - [3, 0])\n  (comment [3, 0] - [4, 0])\n  (comment [4, 0] - [5, 0])\n  (comment [5, 0] - [6, 0])\n  (comment [6, 0] - [7, 0])\n  (comment [7, 0] - [8, 0])\n  (comment [8, 0] - [9, 0])\n  (parameter_declaration [10, 0] - [11, 0]\n    command: (identifier [10, 0] - [10, 10])\n    macro: (macro [10, 11] - [10, 18]))\n  (if_block [12, 0] - [18, 0]\n    command: (identifier [12, 0] - [12, 2])\n    condition: (binary_expression [12, 3] - [12, 16]\n      left: (string [12, 3] - [12, 12]\n        (macro [12, 4] - [12, 11]))\n      right: (string [12, 14] - [12, 16]))\n    (block [13, 0] - [17, 0]\n      (command_expression [14, 2] - [15, 0]\n        command: (identifier [14, 2] - [14, 18])\n        arguments: (argument_list [14, 18] - [14, 24]\n          (path [14, 19] - [14, 24])))\n      (parameter_declaration [15, 2] - [16, 0]\n        command: (identifier [15, 2] - [15, 7])\n        (identifier [15, 8] - [15, 13])\n        macro: (macro [15, 14] - [15, 21]))))\n  (if_block [18, 0] - [32, 0]\n    command: (identifier [18, 0] - [18, 2])\n    condition: (call_expression [18, 3] - [18, 24]\n      function: (identifier [18, 3] - [18, 13])\n      arguments: (argument_list [18, 13] - [18, 24]\n        (string [18, 14] - [18, 23]\n          (macro [18, 15] - [18, 22]))))\n    (block [19, 0] - [28, 0]\n      (command_expression [20, 2] - [21, 0]\n        command: (identifier [20, 2] - [20, 6])\n        arguments: (argument_list [20, 6] - [20, 41]\n          (format_expression [20, 7] - [20, 18]\n            value: (identifier [20, 8] - [20, 13])\n            value: (identifier [20, 14] - [20, 18]))\n          (string [20, 19] - [20, 41]\n            (macro [20, 33] - [20, 40]))))\n      (command_expression [21, 2] - [22, 0]\n        command: (identifier [21, 2] - [21, 19])\n        arguments: (argument_list [21, 19] - [21, 29]\n          (identifier [21, 20] - [21, 29]))\n        (comment [21, 29] - [22, 0]))\n      (command_expression [22, 2] - [23, 0]\n        command: (identifier [22, 2] - [22, 7])\n        arguments: (argument_list [22, 7] - [22, 17]\n          (string [22, 8] - [22, 17]\n            (macro [22, 9] - [22, 16]))))\n      (command_expression [23, 2] - [24, 0]\n        command: (identifier [23, 2] - [23, 13])\n        arguments: (argument_list [23, 13] - [23, 23]\n          (option_expression [23, 14] - [23, 23]\n            option: (identifier [23, 15] - [23, 23]))))\n      (command_expression [24, 2] - [25, 0]\n        command: (identifier [24, 2] - [24, 11])\n        arguments: (argument_list [24, 11] - [24, 21]\n          (string [24, 12] - [24, 21]\n            (macro [24, 13] - [24, 20]))))\n      (command_expression [25, 2] - [26, 0]\n        command: (identifier [25, 2] - [25, 12])\n        arguments: (argument_list [25, 12] - [25, 22]\n          (string [25, 13] - [25, 22]\n            (macro [25, 14] - [25, 21]))))\n      (command_expression [26, 2] - [27, 0]\n        command: (identifier [26, 2] - [26, 6])\n        arguments: (argument_list [26, 6] - [26, 41]\n          (format_expression [26, 7] - [26, 19]\n            value: (identifier [26, 8] - [26, 13])\n            value: (identifier [26, 14] - [26, 19]))\n          (string [26, 20] - [26, 41]\n            (macro [26, 33] - [26, 40])))))\n    (else_block [28, 0] - [32, 0]\n      command: (identifier [28, 0] - [28, 4])\n      (block [29, 0] - [32, 0]\n        (command_expression [30, 2] - [31, 0]\n          command: (identifier [30, 2] - [30, 6])\n          arguments: (argument_list [30, 6] - [30, 44]\n            (format_expression [30, 7] - [30, 13]\n              value: (identifier [30, 8] - [30, 13]))\n            (string [30, 14] - [30, 44]\n              (macro [30, 36] - [30, 43])))))))\n  (command_expression [33, 0] - [34, 0]\n    command: (identifier [33, 0] - [33, 5])))\n```\n\n</details>\n\n#### Highlight TRACE32\u00ae Script\n\nUse tree-sitter to highlight a TRACE32\u00ae script.\n```bash\ntree-sitter highlight <path>\n```\n\n<details>\n\n<summary>Prints the highlighted file</summary>\n\n[![asciicast](https://asciinema.org/a/fY05yHO74XYG6vPngFG3zAgUb.svg)](https://asciinema.org/a/fY05yHO74XYG6vPngFG3zAgUb)\n\n</details>\n\n#### Create Code Navigation Tags\n\n<details>\n\n<summary>Use tree-sitter to create a tags file from a TRACE32\u00ae script.</summary>\n\n```\n; --------------------------------------------------------------------------------\n; @Title: Example test case for Unittests\n; @Description:\n;   This is an example for a test case which can be executed with lbunit.cmm.\n; @Keywords: lbtest test case\n; @Author: MOB\n; @Copyright: (C) 1989-2015 Lauterbach GmbH, licensed for use with TRACE32(R) only\n; --------------------------------------------------------------------------------\n; $Id: test_example.cmm 8648 2015-09-03 17:04:05Z mobermeir $\n\n; the following block must be present in the beginning of every test case\nPRIVATE &func &args &result\nENTRY &func %LINE &args\nGOSUB &func &args // call subroutine and return result\nENTRY %LINE &result\nENDDO &result\n; end of mandatory block\n\n; SetupTestCase will be called once at the beginning of the test case\n; It can be removed if it is not needed.\nSetupTestCase:\n(\n  PRIVATE &date\n  &date=DATE.DATE()+\" \"+DATE.TIME()\n  PUTS \"test case started at: &date\"\n  RETURN\n)\n\n; SetupTest will be called just before every test\n; It can be removed if it is not needed.\nSetupTest:\n(\n  ; here can be some setup\n  Data.Set VM:0x0--0xFF 0xA\n  RETURN\n)\n\n; All tests must start with \"Test_\"\nTest_MyFirstTest:\n(\n  ; Assertions can be used:\n  A_FALSE FALSE()\n  A_TRUE (1.+1.==2.)\n  RETURN\n)\n\nTest_MySecondTest:\n(\n  A_NUM_EQ 0xA Data.Byte(VM:0x0)\n  A_X_PASS Data.Set VM:0x0 0xB\n  A_NUM_EQ 0xB Data.Byte(VM:0x0)\n  RETURN\n)\n\nTest_MyThirdTest:\n(\n  ; Tests can return \"PASS\", \"FAIL\" or \"NOT_EXEC\"\n  ; (alternatively or in addition to assertions)\n  IF (0xA!=Data.Byte(VM:0x0))\n  (\n    RETURN \"FAIL\"\n  )\n  ELSE IF (0xB==Data.Byte(VM:0x0))\n  (\n    RETURN \"NOT_EXEC\"\n  )\n  ELSE\n  (\n    RETURN \"PASS\"\n  )\n  RETURN // same as \"PASS\"\n)\n\nMyHelper:\n(\n  A_NUM_EQ 0xA Data.Byte(VM:0x10)\n  RETURN\n)\n\nTest_MyFourthTest:\n(\n  ; tests can call helper functions\n  RePeaT 2.\n  (\n    GOSUB MyHelper\n  )\n  RETURN\n)\n\nDisabledTest_MyFifthTest:\n(\n  ; this routine will not be executed since it doesn't start with \"Test_\"\n  RETURN\n)\n\n; TearDownTest will be called just after every test\n; It can be removed if it is not needed.\nTearDownTest:\n(\n  ; here could be some cleanup\n  Break.RESet\n  RETURN\n)\n\n; TearDownTestCase will be called once at the end of the test case\n; It can be removed if it is not needed.\nTearDownTestCase:\n(\n  PRIVATE &date\n  &date=DATE.DATE()+\" \"+DATE.TIME()\n  PUTS \"test case ended at: &date\"\n  RETURN\n)\n```\n\n</details>\n\n```bash\ntree-sitter tags <path>\n```\n\n<details>\n\n<summary>Prints a list of tags</summary>\n\n```\nfunc      \t | call    \tref (13, 7) - (13, 11) `GOSUB &func &args // call subroutine and return result`\nSetupTestCase\t | function\tdef (20, 0) - (20, 13) `SetupTestCase:`\nSetupTest \t | function\tdef (30, 0) - (30, 9) `SetupTest:`\nTest_MyFirstTest\t | function\tdef (38, 0) - (38, 16) `Test_MyFirstTest:`\nTest_MySecondTest\t | function\tdef (46, 0) - (46, 17) `Test_MySecondTest:`\nTest_MyThirdTest\t | function\tdef (54, 0) - (54, 16) `Test_MyThirdTest:`\nMyHelper  \t | function\tdef (73, 0) - (73, 8) `MyHelper:`\nTest_MyFourthTest\t | function\tdef (79, 0) - (79, 17) `Test_MyFourthTest:`\nMyHelper  \t | call    \tref (84, 10) - (84, 18) `GOSUB MyHelper`\nDisabledTest_MyFifthTest\t | function\tdef (89, 0) - (89, 24) `DisabledTest_MyFifthTest:`\nTearDownTest\t | function\tdef (97, 0) - (97, 12) `TearDownTest:`\nTearDownTestCase\t | function\tdef (106, 0) - (106, 16) `TearDownTestCase:`\n```\n\n</details>\n\n\n## Development\n\nThere is a makefile to simplify the most common activities. The makefile expects you to have Yarn installed and set up.\n\nTo build the parser from the grammar:\n\n    make build\n\n\nTo run all tests:\n\n    make test-all\n\n\n## Editor Support\n\n| Editor                                                     | Plugin                                                                | Syntax Highlighting | Local Variables  | Folds  | Indents  |\n| -------------                                              | -------------                                                         | :-----------------: | :--------------: | :----: | :------: |\n| [Neovim](https://github.com/neovim/neovim)                 | [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) | \u2713                   | \u2713                | \u2713      | \u2713        |\n| [Helix](https://github.com/helix-editor/helix/tree/master) |                                                                       | \u2713                   |                  |        |          |\n\n### nvim-treesitter\n\nRun\n```vim\n:TSInstall t32\n```\nto automatically install the supported grammar.\n\n## Limitations\n\n- `(symbol)` nodes that represent an unquoted module, like `\\module`, cannot be\n  differentiated from node type `(trace32_hll_variable)`, e.g. `\\x`.\n- `(symbol)` nodes that depend on the hex radix mode cannot always be\n  kept apart from `(address)` nodes, e.g. `P:A::B:0x800`. To avoid conflicts always add\n  the radix mode to the number.\n- Commands from the `Var` command group that contain multiple chained\n  `(format_expression) (_hll_expression)` blocks\n- Unquoted `(path)` nodes are not clearly distinguishable from other literal types\n  in command argument lists.\n- For HLL expressions used at the top level of commands, the use of spaces is more restricted\n  than for nested expressions inside parentheses. The grammar only models the strict behavior.\n- PRACTICE comments start with either `//` or `;`. However, in HLL expressions\n  `;` can be used as separator for multiple statements. The grammar will always interpret `;`\n  as the start of `(comment)` node.\n- `(recursive_macro_expansion)` nodes are restricted to the left-hand side of assignment\n  expressions. In other contexts, recursive PRACTICE macro expansions cannot be distinguished\n  from `&&` operators.\n\n\n## Packages\n\n| Language      | Package                                               | Download                                              |\n| ------------- | ----------------------------------------------------- | ----------------------------------------------------- |\n| Python        | [PyPI](https://pypi.org/project/tree-sitter-t32/)     | [\ud83d\udce6](https://pypi.org/project/tree-sitter-t32/#files) |\n| Rust          | [crates.io](https://crates.io/crates/tree-sitter-t32) |                                                       |\n\n## Mirrors\n\nThis repository is mirrored to https://gitlab.com/xasc/tree-sitter-t32. The main repository is https://codeberg.org/xasc/tree-sitter-t32.\n\n\n## References\n\n- [PRACTICE Script Language User\u2019s Guide](https://www.lauterbach.com/pdf/practice_user.pdf)\n- [Training Script Language PRACTICE](https://www.lauterbach.com/pdf/training_practice.pdf)\n- [PowerView User\u2019s Guide](https://www.lauterbach.com/pdf/ide_user.pdf)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Lauterbach TRACE32\u00ae script language grammar for Tree-sitter",
    "version": "6.0.1",
    "project_urls": {
        "Changelog": "https://codeberg.org/xasc/tree-sitter-t32/src/branch/main/CHANGELOG.md",
        "Homepage": "https://codeberg.org/xasc/tree-sitter-t32",
        "Issues": "https://codeberg.org/xasc/tree-sitter-t32/issues",
        "Repository": "https://codeberg.org/xasc/tree-sitter-t32.git"
    },
    "split_keywords": [
        "lexer",
        " incremental",
        " parsing",
        " tree-sitter",
        " trace32",
        " t32",
        " lauterbach",
        " practice"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "869bf6b7a129cf42906d89e8fb352d25f0265e380ab4bf48dd7365577cf33613",
                "md5": "4573c4fdae030ba6417a0387cc67c895",
                "sha256": "88b79d0ecaca956babb798cc7ac2b77f53cf3acb61c0e44269eb65c9c057d151"
            },
            "downloads": -1,
            "filename": "tree_sitter_t32-6.0.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "4573c4fdae030ba6417a0387cc67c895",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 108940,
            "upload_time": "2025-07-18T19:44:49",
            "upload_time_iso_8601": "2025-07-18T19:44:49.990773Z",
            "url": "https://files.pythonhosted.org/packages/86/9b/f6b7a129cf42906d89e8fb352d25f0265e380ab4bf48dd7365577cf33613/tree_sitter_t32-6.0.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7c526567a5b3870b438d8e17f40ec8f84a90198b2cc0bab34e0c04b39e95c084",
                "md5": "f3686e623efabf7cacf8d742b3b0df5f",
                "sha256": "15f8e9fa88437b03341cd0ce427e31f3292b46d52703762ae417696e999dc7cd"
            },
            "downloads": -1,
            "filename": "tree_sitter_t32-6.0.1-cp310-abi3-musllinux_1_2_x86_64.whl",
            "has_sig": false,
            "md5_digest": "f3686e623efabf7cacf8d742b3b0df5f",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 108402,
            "upload_time": "2025-07-18T19:44:51",
            "upload_time_iso_8601": "2025-07-18T19:44:51.394326Z",
            "url": "https://files.pythonhosted.org/packages/7c/52/6567a5b3870b438d8e17f40ec8f84a90198b2cc0bab34e0c04b39e95c084/tree_sitter_t32-6.0.1-cp310-abi3-musllinux_1_2_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5c79ed1ce1e66ebff2a3e2c160d6b2dd51cb2d77635552a6cef1f974aac9a88c",
                "md5": "4d60c84d154ff385c5282883dd99c83d",
                "sha256": "7de0a7ddc4639e5a24e967b66687973df16e44fc423ca8c8997ad67b2b1cf5cf"
            },
            "downloads": -1,
            "filename": "tree_sitter_t32-6.0.1-cp310-abi3-win32.whl",
            "has_sig": false,
            "md5_digest": "4d60c84d154ff385c5282883dd99c83d",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 89596,
            "upload_time": "2025-07-18T19:44:52",
            "upload_time_iso_8601": "2025-07-18T19:44:52.556114Z",
            "url": "https://files.pythonhosted.org/packages/5c/79/ed1ce1e66ebff2a3e2c160d6b2dd51cb2d77635552a6cef1f974aac9a88c/tree_sitter_t32-6.0.1-cp310-abi3-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "32561540c6a6ea6b02556c96ad10b4fa4ad2c756a983932b3e8e3593dd67d60a",
                "md5": "1cb2476f0c5ed7883d6284342be3ca1a",
                "sha256": "c336f9653d7ff5263c30ce0986131a00f95d45eb887340d8d87944e3771b1e89"
            },
            "downloads": -1,
            "filename": "tree_sitter_t32-6.0.1-cp310-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "1cb2476f0c5ed7883d6284342be3ca1a",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 88817,
            "upload_time": "2025-07-18T19:44:53",
            "upload_time_iso_8601": "2025-07-18T19:44:53.361212Z",
            "url": "https://files.pythonhosted.org/packages/32/56/1540c6a6ea6b02556c96ad10b4fa4ad2c756a983932b3e8e3593dd67d60a/tree_sitter_t32-6.0.1-cp310-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "58dac9e1615e1e41b6cc2b2f3d169129d69b5ce722b233753860eb5e97d36741",
                "md5": "37d2ebba21e31e6b58fe5422be5a687c",
                "sha256": "57d703e76c6db77dce1f09711789904076bb7f6446c16433b2e8a953541360ef"
            },
            "downloads": -1,
            "filename": "tree_sitter_t32-6.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "37d2ebba21e31e6b58fe5422be5a687c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 175345,
            "upload_time": "2025-07-18T19:44:54",
            "upload_time_iso_8601": "2025-07-18T19:44:54.319503Z",
            "url": "https://files.pythonhosted.org/packages/58/da/c9e1615e1e41b6cc2b2f3d169129d69b5ce722b233753860eb5e97d36741/tree_sitter_t32-6.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-18 19:44:54",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": true,
    "codeberg_user": "xasc",
    "codeberg_project": "tree-sitter-t32",
    "lcname": "tree-sitter-t32"
}
        
Elapsed time: 1.21230s