GithubHelp home page GithubHelp logo

merico-dev / tree-sitter-c-sharp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tree-sitter/tree-sitter-c-sharp

1.0 2.0 1.0 63.37 MB

C# Grammar for tree-sitter

License: MIT License

Python 0.57% JavaScript 79.86% Shell 2.02% Scheme 7.91% C# 0.38% C++ 1.47% Rust 5.51% Swift 1.88% C 0.41%

tree-sitter-c-sharp's Introduction

tree-sitter-c-sharp

Build Status

C# grammar for tree-sitter based on an export of the Roslyn grammar export with various changes in order to:

  • Deal with differences between the parsing technologies
  • Work around some bugs in that grammar
  • Handle #if, #else, #elif, #endif blocks
  • Support syntax highlighting/parsing of fragments
  • Simplify the output tree

Status

Comprehensive support for C# exists with the following exceptions:

  • async and await cannot be used as identifiers

C# 7.0 features (complete)

  • Tuples
  • Discards
  • Basic pattern matching
  • Recursive pattern matching
  • Ref locals and return
  • Local function statements
  • Expression bodied constructors
  • Expression bodied destructors/finalizers
  • Throw expressions
  • Binary and _ literal support

C# 7.1 (complete)

  • async main method
  • Default literals (as default_expression)
  • Inferred tuple element names
  • Generic type pattern matching

C# 7.2 (complete)

  • in parameter modifiers
  • ref readonly method returns
  • readonly struct
  • ref struct
  • Non-trailing named arguments
  • _ leading binary and hex literals
  • private protected modifier
  • Conditional ref expressions

C# 7.3 (complete)

  • stackalloc array initializers
  • unmanaged generic type parameter constraint
  • Attributes attached to auto property backing fields
  • out support for parameters on initializers, constructors etc.

C# 8.0 (complete)

  • readonly members
  • Default interface methods
  • switch expressions
  • switch property patterns
  • switch tuple patterns
  • static local functions
  • Nullable reference types
  • Null-forgiving operator
  • Null-coalescing assignment

C# 9.0 (complete)

  • Covariant returns
  • Extending partial methods
  • Extension GetEnumerator
  • Function pointers
  • Init properties
  • Lambda discard parameters
  • Local function attributes
  • Module initializers
  • Native integers
  • Patterns
    • Simple type patterns
    • Relational patterns
    • Logical patterns
  • Records
  • Skip Locals Init
  • Static anonymous functions
  • Target-typed conditional expression
  • Target-typed new
  • Top-level statements

References

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.