linter-csound

Lint Csound orchestras in Pulsar and Atom Forks

nwhetsell

1,092

1

0.5.15

MIT

GitHub

This package provides the following services:

Csound Linting in Pulsar and Atom Forks

Actions

This Pulsar package adds syntax checking for Csound orchestras.

Including Files

The linter-csound preprocessor searches paths for files included using #include in this order:

  1. The paths returned by Pulsar’s Project::getPaths. (This is usually one path that’s roughly equivalent to the current directory.)

  2. The path of the file being preprocessed.

  3. If there are files named .csound-include-directories in the paths returned by Project::getPaths, the paths (one per line) contained in each .csound-include-directories file. For example, if you create a file named .csound-include-directories in the root folder of your project, and this file contains

    /usr/local/csound/udos
    /usr/local/csound/more-udos
    

    then linter-csound will search /usr/local/csound/udos and /usr/local/csound/more-udos for included files.

  4. Paths you enter in linter-csound’s Settings.

Contributing

Open an issue, or fork this project and make a pull request.

linter-csound’s Orchestra Parser

To check the syntax of orchestras, linter-csound uses a preprocessor and parser generated using the GerHobbelt fork of Jison. The grammar used by the parser is based on this JavaScript grammar and this C grammar. To generate the preprocessor and parser on macOS, open a Terminal, cd to linter-csound/lib/csound-parser, and then run:

npm install https://github.com/GerHobbelt/jison/archive/0.6.1-215.tar.gz
node generate-parser.js

The linter-csound preprocessor and parser try to match Csound’s behavior, but linter-csound’s implementations are quite different. Here is how linter-csound’s Jison files correspond to Csound’s Flex/Bison files:

This Jison file Corresponds to this Flex/Bison file
preprocessor.jisonlex csound_pre.lex
orchestra.jisonlex csound_orc.lex
orchestra.jison csound_orc.y

Known Differences from Csound’s Preprocessor

Csound’s preprocessor:

Known Differences from Csound’s Parser