| LamPlus Language ExtensionA Visual Studio Code extension providing syntax highlighting and language support for the LamPlus functional programming language. Features
Syntax Highlighting: Full syntax highlighting for LamPlus language constructsAuto-completion: Bracket and quote auto-completionComment Support: Line comments using #Code Folding: Support for folding code blocksFile Extensions: Supports .lamand.lampfiles Language FeaturesLamPlus is a functional programming language with the following key features: Keywords
Definitions: def,fail,type,rec,effectControl Flow: main,let,in,switch,on,match,with,handle,returnLambda: \(backslash for lambda expressions) Types
Function Types: A -> BEffect Types: A ~> BSum Types: + {'label1: Type1, 'label2: Type2}Product Types: (Type1, Type2, Type3)Type Parameters: Type[T1, T2] Identifiers
Global Types/Functions: Start with uppercase letter (e.g., List,Option)Local Variables: Start with lowercase letter or underscore (e.g., x,_temp)Effects: Start with $(e.g.,$Console,$IO)Labels: Start with '(e.g.,'some,'none) Operators
->: Function type arrow~>: Effect type arrow<~: Resume operator=: Assignment:: Type annotation|: Pattern alternative+: Sum type constructor Example Code# Type definitions
type Option[T] = + {'some: T, 'none: ()}
type List[T] = + {'cons: (T, List[T]), 'nil: ()}
# Effect definition
effect $Console: String ~> ()
# Function definition
def map[A, B]: (A -> B, List[A]) -> List[B] = 
  \f. \lst. 
    match lst with {
      'nil x: 'nil (),
      'cons (head, tail): 'cons (f head, map f tail)
    }
# Main function with effects
main: () = 
  let numbers: List[Int] = 'cons (1, 'cons (2, 'nil ())) in
  handle 
    $Console "Hello, LamPlus!"
  with {
    $Console msg k: 
      let () = print msg in k (),
    return x: x
  }
 Installation
Download and install the extension from the VS Code MarketplaceOpen any .lamor.lampfile to see syntax highlighting in action DevelopmentTo develop this extension: 
Clone this repositoryOpen in VS CodePress F5to open a new Extension Development Host windowOpen a .lamfile to test the syntax highlighting Language GrammarThis extension is based on a Lark parser grammar that defines the complete syntax of the LamPlus language. The TextMate grammar provides syntax highlighting for: 
Keywords and control structuresType definitions and annotationsFunction definitions and lambda expressionsPattern matching constructsEffect definitions and handlersComments and documentation ContributingContributions are welcome! Please feel free to submit issues and pull requests. LicenseMIT License - see LICENSE file for details. |  |