{"size": 1149, "ext": "scrbl", "max_stars_repo_path": "lang-file/lang-file/scribblings/read-lang-file.scrbl", "max_stars_repo_name": "AlexKnauth/lang-file", "max_stars_repo_stars_event_min_datetime": "2016-05-26T01:39:43.000Z", "max_stars_repo_stars_event_max_datetime": "2020-07-06T04:33:10.000Z", "max_issues_repo_path": "lang-file/lang-file/scribblings/read-lang-file.scrbl", "max_issues_repo_name": "AlexKnauth/lang-file", "max_issues_repo_issues_event_min_datetime": "2016-07-20T23:00:22.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-19T18:19:39.000Z", "max_forks_repo_path": "lang-file/lang-file/scribblings/read-lang-file.scrbl", "max_forks_repo_name": "AlexKnauth/lang-file", "max_forks_repo_forks_event_min_datetime": "2016-05-26T14:07:41.000Z", "max_forks_repo_forks_event_max_datetime": "2020-07-06T05:11:37.000Z"}
{"max_stars_count": 4, "max_issues_count": 3, "max_forks_count": 3, "avg_line_length": 28.725, "max_line_length": 76, "alphanum_fraction": 0.6570931245}
#lang scribble/manual

@(require scribble/eval
          (for-label racket/base
                     racket/bool
                     racket/contract/base
                     lang-file/read-lang-file
                     ))

@title{read-lang-file}

source code: @url{https://github.com/AlexKnauth/lang-file}

@defmodule[lang-file/read-lang-file]

@defproc[(read-lang-file [path-string path-string?]) syntax?]{
Reads a @hash-lang[] file into a @racket[module] syntax object.
}

@defproc[(read-lang-module [port input-port?]) syntax?]{
Reads the contents of a @hash-lang[] file from @racket[port] into a
@racket[module] syntax object.

@examples[
  (require lang-file/read-lang-file)
  (read-lang-module (open-input-string "#lang racket/base\n(+ 1 2)"))
  (syntax->datum
   (read-lang-module (open-input-string "#lang racket/base\n(+ 1 2)")))
]}

@defproc[(lang-file? [path-string path-string?]) boolean?]{
Returns true if @racket[path-string] points to a valid @hash-lang[]
file, false otherwise.
}

@defproc[(lang-file-lang [path-string path-string?]) (or/c false? string?)]{
Returns a string containing the the language of a @hash-lang[] file.
}

