From 7db42ab1b9d3c764772ca63c74bf44bb2b8b8325 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 9 Jul 2022 14:35:38 -0400 Subject: First-class programs instead of having a "lux program" extension. --- stdlib/source/program/aedifex/parser.lux | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'stdlib/source/program/aedifex/parser.lux') diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux index 95197c4d9..0327a4cd9 100644 --- a/stdlib/source/program/aedifex/parser.lux +++ b/stdlib/source/program/aedifex/parser.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except Module) + [lux (.except type) [abstract [monad (.only do)]] [control @@ -19,10 +19,7 @@ [compiler [meta [cli - [compiler (.only Compiler)]] - [archive - [module - [descriptor (.only Module)]]]]]] + [compiler (.only Compiler)]]]]] [world [net (.only URL)]]]] ["[0]" // @@ -171,9 +168,13 @@ (Parser /.Target) .text) -(def module - (Parser Module) - .text) +(def module_or_program + (Parser Symbol) + .symbol) + +(def program + (Parser Symbol) + .global) (def deploy_repository (Parser [Text //repository.Address]) @@ -234,12 +235,12 @@ (|> ..target (..singular input "target") (<>.else /.default_target))) - ^program (is (Parser (Maybe Module)) + ^program (is (Parser (Maybe Symbol)) (<>.maybe - (..singular input "program" ..module))) - ^test (is (Parser (Maybe Module)) + (..singular input "program" ..module_or_program))) + ^test (is (Parser (Maybe Symbol)) (<>.maybe - (..singular input "test" ..module))) + (..singular input "test" ..program))) ^deploy_repositories (is (Parser (Dictionary Text //repository.Address)) (<| (at ! each (dictionary.of_list text.hash)) (<>.else (list)) -- cgit v1.2.3