{"id":19051935,"url":"https://github.com/benknoble/smlnj-parser-style","last_synced_at":"2026-03-19T07:55:19.060Z","repository":{"id":70216262,"uuid":"307753842","full_name":"benknoble/smlnj-parser-style","owner":"benknoble","description":"An SML parser and style-checker built on the SML-NJ compiler","archived":false,"fork":false,"pushed_at":"2020-12-03T00:24:24.000Z","size":1235,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-12T14:34:28.480Z","etag":null,"topics":["linter","parser","sml","sml-nj","smlnj","stylelint"],"latest_commit_sha":null,"homepage":"","language":"Standard ML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benknoble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-27T15:59:57.000Z","updated_at":"2022-11-16T13:49:07.000Z","dependencies_parsed_at":"2023-03-11T08:19:00.456Z","dependency_job_id":null,"html_url":"https://github.com/benknoble/smlnj-parser-style","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/benknoble/smlnj-parser-style","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fsmlnj-parser-style","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fsmlnj-parser-style/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fsmlnj-parser-style/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fsmlnj-parser-style/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benknoble","download_url":"https://codeload.github.com/benknoble/smlnj-parser-style/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fsmlnj-parser-style/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30083004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T13:22:36.021Z","status":"ssl_error","status_checked_at":"2026-03-04T13:20:45.750Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linter","parser","sml","sml-nj","smlnj","stylelint"],"created_at":"2024-11-08T23:20:05.875Z","updated_at":"2026-03-04T14:02:25.244Z","avatar_url":"https://github.com/benknoble.png","language":"Standard ML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SML-NJ Parser \u0026 Style-checks\n\n[![This project is considered experimental](https://img.shields.io/badge/status-experimental-critical.svg)](https://benknoble.github.io/status/experimental/)\n\nFor UNC Comp 524\n\nThis repository contains supporting libraries and style-checks for SML programs\nfor UNC Comp 524. They depend on [SML/NJ](https://www.smlnj.org/), which\nhelpfully exposes Compiler internals as structures which can be used, e.g., to\nparse a file and create an AST.\n\nAn example of parsing a file follows (`sml style-utils/sources.cm`):\n\n```sml\n(* make an AST *)\nval parsed = FileParser.parse \"...\";\n#ast parsed;\n\n(* pretty print it *)\nval depth = ...; (* 1, 2, …, 999, … *)\nFileParser.pp depth parsed;\n```\n\nCreating style-checks for UNC Comp 524 is work-in-progress; an example of making\na grader is in `524-f20-a3/a3grader.sml` (see also `524-f20-a3.cm`). The core\nidea is to write some checks with a return type `result` and a stringifier\n`result_to_string`, and pass that structure to `GraderFn`---this gives you a\nstructure ascribing to `GRADER`, whose `runall` method takes a string\nrepresenting a file-path and runs all of your checks. For example,\n`A3Grader.runall` on a passing implementation:\n\n```\n$ sml -m 524-f20-a3.cm\n- A3Grader.runall \"SocialDistance.sml\";\nno disallowed functions: pass\nmatching derived safe calls matching safe with matcher: pass\nmatching given safe calls matching safe with matcher: pass\ncurryable interpolated safe calls interpolated safe: pass\ncurried once interpolated safe calls curryable interpolated safe: pass\ncurried twice interpolated safe calls curried once interpolated safe: pass\ncurried matching given safe calls curryable matching safe with given safe matcher: pass\ncurried matching derived safe calls curryable matching safe with derived safe matcher: pass\nno magic numbers in functions: pass\nval it = () : unit\n```\n\nUtilities, such as an easy-to-use `result` type and stringifier and\nregexp-matcher for declarations, are in `GraderUtils`. Opening it is a quick way\nto get started building a grader.\n\nNote that `pass b` is `Pass` if `b` is true, while `fail b` is `Fail` if `b` is\ntrue (and vice-versa for when `b` is false). This makes it easy to write checks\nlike\n\n```sml\n(* fail when f is true *)\nval does_not_f = fail o f\n(* pass when g is true *)\nval does_g = pass o g\n```\n\n---\n\nAll SML/NJ systems contain compiled versions of the libraries we depend on.\n\nTo obtain a reference or source copy of the libraries that we depend on, the\nsimplest route is to edit `config/targets` in your installation to include the\nline\n```\nrequest src-smlnj\n```\nThen run `config/install.{sh,bat}` with appropriate permissions. Extract\n`compiler.tgz` and `system.tgz` from the installation directory to obtain the\nfull source.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenknoble%2Fsmlnj-parser-style","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenknoble%2Fsmlnj-parser-style","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenknoble%2Fsmlnj-parser-style/lists"}