Code Monkey home page Code Monkey logo

textmate's Introduction

textmate

GitHub issues License

TextMate Language Grammars

  • name
    • This should be a unique name for the grammar, following the convention of being a dot-separated name where each new (left-most) part specializes the name.
    • Normally it would be a two-part name where the first is either text or source and the second is the name of the language or document type.
    • But if you are specializing an existing type, you probably want to derive the name from the type you are specializing.
  • scopeName
    • This should be a unique name for the grammar.
  • fileTypes
    • This is an array of file type extensions that the grammar should (by default) be used with.
  • firstLineMatch
    • A regular expression which is matched against the first line of the document (when it is first loaded).
  • patterns
    • An array with the actual rules used to parse the document.
  • repository
    • A dictionary (i.e. key/value pairs) of rules which can be included from other places in the grammar.
    • The key is the name of the rule and the value is the actual rule.
  • name
    • The name which gets assigned to the portion matched.
    • This is used for styling and scope-specific settings and actions, which means it should generally be derived from one of the standard names.
  • match
    • A regular expression which is used to identify the portion of text to which the name should be assigned.
    • Example: '\b(true|false)\b'.
  • begin, end
    • These keys allow matches which span several lines and must both be mutually exclusive with the match key.
    • Each is a regular expression pattern. begin is the pattern that starts the block and end is the pattern which ends the block.
    • Captures from the begin pattern can be referenced in the end pattern by using normal regular expression back-references.
  • contentName
    • This key is similar to the name key but only assigns the name to the text between what is matched by the begin/end patterns.
  • captures, beginCaptures, endCaptures
    • These keys allow you to assign attributes to the captures of the match, begin, or end patterns.
    • Using the captures key for a begin/end rule is short-hand for giving both beginCaptures and endCaptures with same values.
    • The value of these keys is a dictionary with the key being the capture number and the value being a dictionary of attributes to assign to the captured text.
    • Currently name is the only attribute supported.
  • include
    • This allows you to reference a different language, recursively reference the grammar itself or a rule declared in this fileโ€™s repository.

Sources

VSCode Specific

Examples

JSON Schema

Tools

textmate's People

Contributors

dunstontc avatar

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.