Giter Club home page Giter Club logo

sublime-p's Introduction

Sublime-P

P language plugin for Sublime Text 3. Includes basic syntax highlighting, comments format and some snippets.

Screenshot

Screenshot

Install

Use the Command Palette to Add Repository and add this GitHub repository. Then use the Command Palette to Install Package and search for and install Sublime-P.

Conventions

The syntax highlighting assumes the following conventions, but you don't have to follow them.

  • Type names end with Type. E.g. StartMessageType.
  • Fields end with V. E.g. TimerV.
  • Events start with e. E.g. eStop, eStart.
  • Machine names end with Machine. E.g. ElevatorMachine.
  • State names have no conventions and so have no color.

These conventions are followed by the snippets, so you don't have to remember them.

Snippets

Snippets include: event, implementation, machine, module, test, type, var (for fields), whileindex. To use a snippet, start typing one of these words and press tab. Then continue typing to replace the placeholder names and press tab further times to jump to the next placeholder or cursor position.

E.g. Start typing while. The whileindex completion pops up. Press tab to get:

index = 0;
while(index < sizeof(Array))
{
	
    index = index + 1;
}

Typing will replace all instances of index. Pressing tab jumps to Array which is the next placeholder. Pressing tab again places the cursor after the first curly brace.

Making changes to p.tmLanguage

The p.tmLanguage file defines the syntax highlighting. It is a generated file, but is committed for convenience. To make changes, do the following:

  1. Install Package Control in Sublime Text 3 and then use the Command Palette Ctrl+Shift+P to Install Package and search for and install PackageDev.
  2. Open p.YAML-tmLanguage.
  3. Make your changes.
  4. Use the Command Palette to execute Build With: Convert to ... - Property List.

sublime-p's People

Contributors

ankushdesai avatar paulthomson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

cephdon wlxiong

sublime-p's Issues

Syntax highlighting rules do not include strings, some keywords.

Strings and many keywords (including announce, receive, eventset, float, data, as, case, group, hot, keys, move, pop, swap, values, refines, compose, union, hidee, hidei, rename, safe, and to) are not highlighted in the editor.

Most languages also highlight numbers. We should follow this, and highlight $ and $$ (non-deterministic choices) in the same way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.