An Erlang lexer and syntax highlighter in Gleam

Use new JavaScript API

Changed files
+10 -3
src
+6
CHANGELOG.md
··· 1 1 # Changelog 2 2 3 + ## Unreleased 4 + 5 + - Updated the JavaScript FFI code to use the new API. 6 + 7 + - `pearl` now requires Gleam v1.13 or higher. 8 + 3 9 ## v2.1.0 - 2025-09-01 4 10 5 11 - Improved the performance of lexing comments and escape sequences.
+1
gleam.toml
··· 1 1 name = "pearl" 2 2 version = "2.1.0" 3 + gleam = ">= 1.13.0" 3 4 4 5 description = "An Erlang lexer and syntax highlighter for Gleam!" 5 6 licences = ["Apache-2.0"]
+3 -3
src/pearl_ffi.mjs
··· 1 - import { Ok, Error } from "./gleam.mjs"; 1 + import { Result$Ok, Result$Error } from "./gleam.mjs"; 2 2 3 3 export function strip_prefix(string, prefix) { 4 4 if (string.startsWith(prefix)) { 5 - return new Ok(string.slice(prefix.length)); 5 + return Result$Ok(string.slice(prefix.length)); 6 6 } else { 7 - return new Error(undefined); 7 + return Result$Error(undefined); 8 8 } 9 9 }