Skip to main content

Module language

Module language 

Source
Expand description

Language definition and configuration for F#.

ยง๐ŸŒ F# Language Integration

This module defines the FSharpLanguage struct, which serves as the central configuration point for the F# parser within the Oak framework.

ยง๐Ÿ› ๏ธ Language Configuration

The FSharpLanguage struct implements the Language trait and provides granular control over F# language features and versions.

ยงVersion Support

You can configure the parser for specific F# versions:

use oak_fsharp::FSharpLanguage;

let config = FSharpLanguage::new()
    .with_version(6, 0); // Enable F# 6.0 features

ยงFeature Toggles

Fine-tune specific language features:

let config = FSharpLanguage::new()
    .with_computation_expressions(true)
    .with_type_providers(false)
    .with_async_workflows(true);

ยง๐Ÿงฉ Integration

FSharpLanguage links together the lexer and parser components:

  • TokenType: FSharpTokenType
  • ElementType: FSharpElementType
  • TypedRoot: () (Future work will include typed root support)

ยง๐Ÿš€ Usage

use oak_fsharp::{FSharpParser, FSharpLanguage};

let config = FSharpLanguage::new().with_all_features();
let parser = FSharpParser::new(&config);

Structsยง

FSharpLanguage
F# language implementation.