An open API service indexing awesome lists of open source software.

https://github.com/pb-shrugged/tree-sitter-powerscript

Powerscript grammar for Tree-sitter
https://github.com/pb-shrugged/tree-sitter-powerscript

parser powerbuilder powerscript tree-sitter

Last synced: about 1 month ago
JSON representation

Powerscript grammar for Tree-sitter

Awesome Lists containing this project

README

          

# tree-sitter-powerscript

Powerscript grammar for [Tree-sitter](https://tree-sitter.github.io/tree-sitter/).

## Supported File Types

- `.srs` - Structure
- `.srf` - Function
- `.srw` - Window
- `.sru` - User Object
- `.sra` - Application
- `.srm` - Menu

## Installation

### As a npm package on your project

```bash
npm install tree-sitter-powerscript
```

### Usage with Tree-sitter CLI

```bash
# Install tree-sitter CLI
npm install -g tree-sitter-cli

# Clone this repository
git clone https://github.com/pb-shrugged/tree-sitter-powerscript.git
cd tree-sitter-powerscript

# Generate the parser
tree-sitter generate

# Test the parser
tree-sitter test

# Parse a powerscript file
tree-sitter parse path/to/your/file.sru
```

## Usage

### Node.js

```javascript
const Parser = require('tree-sitter');
const Powerscript = require('tree-sitter-powerscript');

const parser = new Parser();
parser.setLanguage(Powerscript);

const sourceCode = `
global type w_main from window
end type

on w_main.create
// Window creation code
end on
`;

const tree = parser.parse(sourceCode);
console.log(tree.rootNode.toString());
```

## Development

### Prerequisites

- Node.js
- tree-sitter CLI

### Setup

```bash
git clone https://github.com/pb-shrugged/tree-sitter-powerscript.git
cd tree-sitter-powerscript
npm install
```

### Development Commands

```bash
# Generate the grammar
npm run ts:generate

# Run tests
npm run ts:test

# Build WebAssembly
npm run ts:run

# Lint code
npm run lint

# Run all tests
npm test
```

## CI/CD Pipeline

This project uses GitHub Actions for continuous integration and deployment:

- [**Lint**](/.github/workflows/lint.yml): Runs lint on push and pull request
- [**CI Workflow**](/.github/workflows/ci.yml): Runs tests on every push and pull request
- [**Publish Workflow**](/.github/workflows/publish.yml): Automatically creates GitHub releases and publishes to NPM when tags are pushed

### Automated Releases

To create a new release:

1. Manually update the tree-sitter version with `tree-sitter version ` then create the git tag: `git tag v && git push origin v`

The release process will automatically:
- Generate cross-platform binaries
- Create a GitHub release with assets
- Publish the package to NPM

## Contributing

We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

### Quick Start for Contributors

1. Fork the repository
2. Create a feature branch: `git checkout -b feature/amazing-feature`
3. Make your changes and add tests
4. Run tests: `npm run ts:test` for the test/corpus files and `npm run test` for the bindings/node files
5. Commit your changes: `git commit -m 'Add amazing feature'`
6. Push to the branch: `git push origin feature/amazing-feature`
7. Open a Pull Request

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Links

- [NPM Package](https://www.npmjs.com/package/@pb-shrugged/tree-sitter-powerscript)
- [GitHub Repository](https://github.com/pb-shrugged/tree-sitter-powerscript)
- [Tree-sitter Documentation](https://tree-sitter.github.io/tree-sitter/)
- [PowerBuilder Documentation](https://docs.appeon.com/#pb)