From 87fc13e4e6b38c86ae92a22658994e4942080c04 Mon Sep 17 00:00:00 2001 From: Paul Hartman Date: Tue, 6 Jun 2023 03:53:19 -0700 Subject: [PATCH 1/4] Update download links to point to latest LangTrans release --- downloads.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/downloads.md b/downloads.md index 4daf72c..cb30b27 100644 --- a/downloads.md +++ b/downloads.md @@ -4,7 +4,7 @@ Some feature shown works only in latest version in [GitHub Repo](https://github.com/LangTrans/LangTrans) {% endhint %} -* [Standalone](https://github.com/LangTrans/LangTrans/releases/download/1.6/langtrans.exe) -* [Installer](https://github.com/LangTrans/LangTrans/releases/download/1.6/LangTrans\_Installer.exe) +* [Standalone](https://github.com/LangTrans/LangTrans/releases/download/latest/langtrans.exe) +* [Installer](https://github.com/LangTrans/LangTrans/releases/download/latest/LangTrans\_Installer.exe) * [Releases](https://github.com/LangTrans/LangTrans/releases) * [GitHub Repo](https://github.com/LangTrans/LangTrans) From 9979d9f5127153999c4de609494357c023b2dba4 Mon Sep 17 00:00:00 2001 From: Paul Hartman Date: Tue, 6 Jun 2023 04:03:42 -0700 Subject: [PATCH 2/4] Adjust phrasing of README.md for clarity --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 81caf21..7f302db 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,10 @@ Description: Customize Programming Languages LangTrans customizes any programming language. You can make your own syntax for any programming language. -## How it works? - -LangTrans converts your syntax into the original syntax. - -Regular expressions extract tokens from your language. You should make a template of the original language syntax. - -LangTrans takes both as input and converts code written in the new syntax to the original syntax. +## How does it work? +LangTrans transpiles your syntax into the original syntax. +You define tokens from your language, and a template of the original language's syntax, using regular expressions. +LangTrans takes both definitions as input and converts code written in the new syntax to the original syntax. From 431a4431f18141ead894f9fd7ac49cab03ff2e43 Mon Sep 17 00:00:00 2001 From: Paul Hartman Date: Tue, 6 Jun 2023 04:29:48 -0700 Subject: [PATCH 3/4] Clarify implementation.md slightly and fix some minor grammatical errors --- implementation.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/implementation.md b/implementation.md index b7db437..b1e4ef4 100644 --- a/implementation.md +++ b/implementation.md @@ -1,6 +1,6 @@ # Implementation -To customize you should extract tokens with regular expression. Then you should create the template of original language with token you extracted. +To customize, you define tokens for your new syntax using regular expressions. Then you create the template of the original language by referencing the tokens you defined. ## Token Extraction @@ -26,10 +26,9 @@ typeofsynax: _1typeofsyntax: regex: regex2 tokens: [token1,token2,token3] -#Code here(like above) -#................... -#................... +# More lines of code #................... + settings: collections: collection_name: [typeofsyntax1,typeofsyntax2] @@ -54,13 +53,13 @@ settings: Name of syntax you wanted to match -**Eg. **arithmetic, loop etc. +**Eg.** arithmetic, loop etc. If one type have same pattern but different regular expression to match. You can write `_` for next regex. -**Eg. **`_1typeofsyntax` +**Eg.** `_1typeofsyntax` Both regex use one template @@ -90,11 +89,11 @@ If it is False it works only after calling it otherwise it works normally. If it is True it works only once -**next** +#### **next** To pass converted syntax into another or same typeofsyntax -**token1** +#### **token1** To modify token1 matched @@ -130,11 +129,11 @@ For setting variables, collections, after command {% tabs %} {% tab title="variables" %} -You can make variables than can used inside [regular expression](implementation.md#regex) by `` +You can make variables than can be used inside [regular expressions](implementation.md#regex) by `` {% endtab %} {% tab title="varfile" %} -Name of YAML file to import variables +Name of YAML file that defines variables {% hint style="info" %} Filename doesn't need extension (base name only) @@ -169,9 +168,9 @@ YAML file with error definitions for [linting](implementation.md#linting) {% endtabs %} {% hint style="info" %} -__[_regex_ ](implementation.md#regex)and [_tokens_ ](implementation.md#tokens)should be in all typeofsyntax. +[_regex_ ](implementation.md#regex)and [_tokens_ ](implementation.md#tokens)should be in all typeofsyntax. -Others are optional +Other options are optional. {% endhint %} ### Example From 52aac28a9145e3fb470cb305fc2b08b56ca29d10 Mon Sep 17 00:00:00 2001 From: Paul Hartman Date: Tue, 6 Jun 2023 04:35:06 -0700 Subject: [PATCH 4/4] Adjust wording of command-line.md for clarity and readability --- command-line.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/command-line.md b/command-line.md index a072018..0153be0 100644 --- a/command-line.md +++ b/command-line.md @@ -6,15 +6,15 @@ py langtrans.py ``` -**SourceFileName** - File name of source code written with new syntax +**SourceFileName** - Name of the file with source code to transpile -**OutputFileName** - File name of source code you want to generate with original syntax +**OutputFileName** - Name of the file to output to -**SyntaxRepr** - File name of YAML file for [token extraction](implementation.md#token-extraction) without extension(.yaml) +**SyntaxRepr** - File name of YAML file with [definition of tokens](implementation.md#token-extraction) (without .yaml extension) -**PatternRepr** - File name of YAML file with [template](implementation.md#template) of original language without extension +**PatternRepr** - File name of YAML file with [template](implementation.md#template) of original language (without .yaml extension) -### **Compile** +### **To Compile** ```bash py langtrans.py -c @@ -22,11 +22,9 @@ py langtrans.py -c **compfile** -Name of compiled file(without extension) +Name of output file (without extension); compiles and generates `filename.ltz`. -`filename.ltz` will be generated. - -### **Run** +### **To Run** ```bash py langtrans.py -f @@ -41,7 +39,7 @@ py langtrans.py -f ### **Docs for token extraction file** -To generate documentation for [token extraction](implementation.md#syntax) file +To generate documentation for [definition of tokens](implementation.md#syntax) file, run: ```bash py langtrans.py -d > filename.txt