From 08eb05f23914194c3adcc141664d4c2d7d88978c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 7 May 2017 15:26:09 -0400 Subject: - Renamed "AST" to "Code". --- new-luxc/source/luxc/analyser/lux.lux | 16 +++++------ new-luxc/source/luxc/compiler.lux | 4 +-- new-luxc/source/luxc/compiler/expr.jvm.lux | 2 +- new-luxc/source/luxc/compiler/statement.jvm.lux | 4 +-- new-luxc/source/luxc/lang.lux | 4 +-- new-luxc/source/luxc/parser.lux | 38 ++++++++++++------------- 6 files changed, 34 insertions(+), 34 deletions(-) (limited to 'new-luxc/source/luxc') diff --git a/new-luxc/source/luxc/analyser/lux.lux b/new-luxc/source/luxc/analyser/lux.lux index 86f9839dc..f0e9a3538 100644 --- a/new-luxc/source/luxc/analyser/lux.lux +++ b/new-luxc/source/luxc/analyser/lux.lux @@ -94,7 +94,7 @@ (analyse-definition cursor reference))) (def: #export (analyse-check analyse eval cursor type value) - (-> Analyser Eval Cursor AST AST (Lux Analysis)) + (-> Analyser Eval Cursor Code Code (Lux Analysis)) (do Monad [actual (eval Type type) #let [actual (:! Type actual)] @@ -105,7 +105,7 @@ (analyse eval value)))) (def: #export (analyse-coerce analyse eval cursor type value) - (-> Analyser Eval Cursor AST AST (Lux Analysis)) + (-> Analyser Eval Cursor Code Code (Lux Analysis)) (do Monad [actual (eval Type type) #let [actual (:! Type actual)] @@ -117,8 +117,8 @@ (wrap (&common;replace-type actual =value)))) (def: (analyse-typed-tuple analyse cursor members) - (-> (-> AST (Lux Analysis)) Cursor - (List AST) + (-> (-> Code (Lux Analysis)) Cursor + (List Code) (Lux Analysis)) (do Monad [expected macro;expected-type] @@ -174,8 +174,8 @@ (#lang;Structure (#lang;Tuple members))])) (def: #export (analyse-tuple analyse cursor members) - (-> (-> AST (Lux Analysis)) Cursor - (List AST) + (-> (-> Code (Lux Analysis)) Cursor + (List Code) (Lux Analysis)) (do Monad [expected macro;expected-type] @@ -218,8 +218,8 @@ ))) (def: #export (analyse-variant analyse cursor tag value) - (-> (-> AST (Lux Analysis)) Cursor - Nat AST + (-> (-> Code (Lux Analysis)) Cursor + Nat Code (Lux Analysis)) (do Monad [expected macro;expected-type] diff --git a/new-luxc/source/luxc/compiler.lux b/new-luxc/source/luxc/compiler.lux index 67a9928fd..8d0ea8a2f 100644 --- a/new-luxc/source/luxc/compiler.lux +++ b/new-luxc/source/luxc/compiler.lux @@ -15,7 +15,7 @@ )) (def: (compile ast) - (-> AST (Lux Unit)) + (-> Code (Lux Unit)) (case ast (^ [_ (#;Form (list [_ (#;Symbol ["" "_lux_def"])] [_ (#;Symbol ["" def-name])] @@ -61,7 +61,7 @@ (wrap output))) (def: parse - (Lux AST) + (Lux Code) (function [compiler] (case (&parser;parse (get@ #;source compiler)) (#E;Error error) diff --git a/new-luxc/source/luxc/compiler/expr.jvm.lux b/new-luxc/source/luxc/compiler/expr.jvm.lux index 138d0d540..f0508c0d2 100644 --- a/new-luxc/source/luxc/compiler/expr.jvm.lux +++ b/new-luxc/source/luxc/compiler/expr.jvm.lux @@ -23,7 +23,7 @@ (undefined)) (def: #export (compile input) - (-> AST (Lux Compiled)) + (-> Code (Lux Compiled)) (|> input (&analyser;analyse eval) (Lux/map &synthesizer;synthesize) diff --git a/new-luxc/source/luxc/compiler/statement.jvm.lux b/new-luxc/source/luxc/compiler/statement.jvm.lux index 0e53ba37d..7e48d061f 100644 --- a/new-luxc/source/luxc/compiler/statement.jvm.lux +++ b/new-luxc/source/luxc/compiler/statement.jvm.lux @@ -12,14 +12,14 @@ (compiler ["&;" expr]))) (def: #export (compile-def def-name def-value def-meta) - (-> Text AST AST (Lux Unit)) + (-> Text Code Code (Lux Unit)) (do Monad [=def-value (&expr;compile def-value) =def-meta (&expr;compile def-meta)] (undefined))) (def: #export (compile-program prog-args prog-body) - (-> Text AST (Lux Unit)) + (-> Text Code (Lux Unit)) (do Monad [=prog-body (&env;with-local [prog-args (type (List Text))] (&expr;compile prog-body))] diff --git a/new-luxc/source/luxc/lang.lux b/new-luxc/source/luxc/lang.lux index 0c5c97192..787895466 100644 --- a/new-luxc/source/luxc/lang.lux +++ b/new-luxc/source/luxc/lang.lux @@ -38,7 +38,7 @@ Unit) (type: #export Eval - (-> Type AST (Lux Top))) + (-> Type Code (Lux Top))) (type: #export Analyser - (-> Eval AST (Lux Analysis))) + (-> Eval Code (Lux Analysis))) diff --git a/new-luxc/source/luxc/parser.lux b/new-luxc/source/luxc/parser.lux index 0115d1924..c9ba89b75 100644 --- a/new-luxc/source/luxc/parser.lux +++ b/new-luxc/source/luxc/parser.lux @@ -1,7 +1,7 @@ ## This is the LuxC's parser. ## It takes the source code of a Lux file in raw text form and ## extracts the syntactic structure of the code from it. -## It only produces Lux AST nodes, and thus removes any white-space +## It only produces Lux Code nodes, and thus removes any white-space ## and comments while processing its inputs. ## Another important aspect of the parser is that it keeps track of @@ -21,7 +21,7 @@ ## They are supposed to produce some parsed output, alongside an ## updated cursor pointing to the end position, after the parser was run. -## Lux AST nodes/tokens are annotated with cursor meta-data +## Lux Code nodes/tokens are annotated with cursor meta-data ## (file-name, line, column) to keep track of their provenance and ## location, which is helpful for documentation and debugging. @@ -139,7 +139,7 @@ (l;either (single-line-comment^ where) (multi-line-comment^ where))) -## To simplify parsing, I remove any left-padding that an AST token +## To simplify parsing, I remove any left-padding that an Code token ## may have prior to parsing the token itself. ## Left-padding is assumed to be either white-space or a comment. ## The cursor gets updated, but the padding gets ignored. @@ -208,7 +208,7 @@ ## standard library to actually produce the values from the literals. (do-template [ ] [(def: #export ( where) - (-> Cursor (Lexer [Cursor AST])) + (-> Cursor (Lexer [Cursor Code])) (do Monad [chunk ] (case (:: decode chunk) @@ -249,7 +249,7 @@ ## This parser doesn't delegate the work of producing the value to a ## codec, since the raw-char^ parser already takes care of that magic. (def: #export (parse-char where) - (-> Cursor (Lexer [Cursor AST])) + (-> Cursor (Lexer [Cursor Code])) (do Monad [[chunk value] (l;enclosed ["#\"" "\""] raw-char^)] @@ -259,7 +259,7 @@ ## This parser looks so complex because text in Lux can be multi-line ## and there are rules regarding how this is handled. (def: #export (parse-text where) - (-> Cursor (Lexer [Cursor AST])) + (-> Cursor (Lexer [Cursor Code])) (do Monad [## Lux text "is delimited by double-quotes", as usual in most ## programming languages. @@ -346,15 +346,15 @@ ## Form and tuple syntax is mostly the same, differing only in the ## delimiters involved. -## They may have an arbitrary number of arbitrary AST nodes as elements. +## They may have an arbitrary number of arbitrary Code nodes as elements. (do-template [ ] [(def: ( where parse-ast) (-> Cursor - (-> Cursor (Lexer [Cursor AST])) - (Lexer [Cursor AST])) + (-> Cursor (Lexer [Cursor Code])) + (Lexer [Cursor Code])) (do Monad [_ (l;text ) - [where' elems] (loop [elems (: (V;Vector AST) + [where' elems] (loop [elems (: (V;Vector Code) V;empty) where where] (l;either (do @ @@ -384,16 +384,16 @@ ## Semantically, though, records and tuples are just 2 different ## representations for the same thing (a tuple). ## In normal Lux syntax, the key position in the pair will be a tag -## AST node, however, record AST nodes allow any AST node to occupy -## this position, since it may be useful when processing AST syntax in +## Code node, however, record Code nodes allow any Code node to occupy +## this position, since it may be useful when processing Code syntax in ## macros. (def: (parse-record where parse-ast) (-> Cursor - (-> Cursor (Lexer [Cursor AST])) - (Lexer [Cursor AST])) + (-> Cursor (Lexer [Cursor Code])) + (Lexer [Cursor Code])) (do Monad [_ (l;text "{") - [where' elems] (loop [elems (: (V;Vector [AST AST]) + [where' elems] (loop [elems (: (V;Vector [Code Code]) V;empty) where where] (l;either (do @ @@ -428,7 +428,7 @@ ## possible). ## In particular, no white-space can be used, and neither can other ## characters which are already used by Lux as delimiters for other -## AST nodes (thereby reducing ambiguity while parsing). +## Code nodes (thereby reducing ambiguity while parsing). ## Additionally, the first character in an identifier's part cannot be ## a digit, to avoid confusion with regards to numbers. (def: ident-part^ @@ -498,7 +498,7 @@ ## construction and de-structuring (during pattern-matching). (do-template [ ] [(def: #export ( where) - (-> Cursor (Lexer [Cursor AST])) + (-> Cursor (Lexer [Cursor Code])) (do Monad [[value length] ] (wrap [(update@ #;column (|>. ($_ n.+ length)) where) @@ -509,7 +509,7 @@ ) (def: (parse-ast where) - (-> Cursor (Lexer [Cursor AST])) + (-> Cursor (Lexer [Cursor Code])) (do Monad [where (left-padding^ where)] ($_ l;either @@ -528,7 +528,7 @@ ))) (def: #export (parse [where code]) - (-> [Cursor Text] (Error [[Cursor Text] AST])) + (-> [Cursor Text] (Error [[Cursor Text] Code])) (case (l;run' code (parse-ast where)) (#E;Error error) (#E;Error error) -- cgit v1.2.3