Sign in

    moonrockz/gleam-parser/dialect does not have a README file

    Dialect

    pub(all) struct Dialect {
    name : String
    keywords : ArrayView[String]
    attributes : ArrayView[String]
    targets : ArrayView[String]
    deprecations : ArrayView[Rule]
    } derive(Eq,
    Debug
    )

    What the parser accepts: the reserved words, the attribute names (@external, …), the target names, and the deprecated syntax it warns about. Dialect::gleam_1_19() is the default and the only built-in.

    test {
    let d = @dialect.Dialect::gleam_1_19()
    inspect(d.knows_attribute("deprecated"), content="true")
    inspect(d.warns(DeprecatedListPrepend), content="true")
    }

    Dialect::gleam_1_19

    fn Dialect::gleam_1_19() -> Dialect

    Gleam 1.19: the compiler's 22 reserved words, the four attributes, the two targets, and every deprecation warning on.

    Dialect::knows_attribute

    fn Dialect::knows_attribute(self : Dialect, name : String) -> Bool

    Dialect::knows_target

    fn Dialect::knows_target(self : Dialect, name : String) -> Bool

    Dialect::warns

    fn Dialect::warns(self : Dialect, rule : Rule) -> Bool

    Rule

    pub(all) enum Rule {
    DeprecatedListPrepend
    DeprecatedListPattern
    DeprecatedListCatchAllPattern
    DeprecatedListSpreadAsVariablePattern
    DeprecatedRecordSpreadPattern
    DeprecatedEmptyClauseGuard
    DeprecatedTargetShorthand
    } derive(Eq, Hash,
    Debug
    )

    A deprecated-syntax rule the parser warns about: one per kind of the compiler's DeprecatedSyntaxWarning.

    Rule::all

    fn Rule::all() -> Array[Rule]

    Rule::name

    fn Rule::name(self : Rule) -> String

    The rule's name, as a diagnostic names it.

    Source Files