read-lang-file
read-lang-file
read-lang-module
lang-file?
lang-file-lang
6.12

read-lang-file

source code: https://github.com/AlexKnauth/lang-file

 (require lang-file/read-lang-file) package: lang-file

procedure

(read-lang-file path-string)  syntax?

  path-string : path-string?
Reads a #lang file into a module syntax object.

procedure

(read-lang-module port)  syntax?

  port : input-port?
Reads the contents of a #lang file from port into a module syntax object.

Examples:
> (require lang-file/read-lang-file)
> (read-lang-module (open-input-string "#lang racket/base\n(+ 1 2)"))

#<syntax:1:0 (module anonymous-module rack...>

> (syntax->datum
   (read-lang-module (open-input-string "#lang racket/base\n(+ 1 2)")))

'(module anonymous-module racket/base (#%module-begin (+ 1 2)))

procedure

(lang-file? path-string)  boolean?

  path-string : path-string?
Returns true if path-string points to a valid #lang file, false otherwise.

procedure

(lang-file-lang path-string)  (or/c false? string?)

  path-string : path-string?
Returns a string containing the the language of a #lang file.