Skip to content

Commit efaf25b

Browse files
authored
Merge pull request #193 from Typee-Language/master
#160-Front-End Parser Tests enhancement
2 parents 7d9ea31 + 43cdf12 commit efaf25b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2388
-871
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+30-17
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,48 @@
11
---
22
name: Bug report
3-
about: Create a report to help us improve
3+
about: Create a report to help us improve Typee environment
44

55
---
66

77
**Describe the bug**
8-
A clear and concise description of what the bug is.
8+
9+
[_A clear and concise description of what the bug is._]
10+
[_May deal with translator internal error,
11+
erroneous translated syntax or unexpected behavior
12+
when running translated code._]
13+
914

1015
**To Reproduce**
16+
1117
Steps to reproduce the behavior:
12-
1. Go to '...'
13-
2. Click on '....'
14-
3. Scroll down to '....'
15-
4. See error
1618

19+
[_Ex._
20+
1. _Directory Tree: Xxx/Yyy/Zzz/_
21+
2. _Translated Typee module: mmm.ty_
22+
3. _Command line as typed for translation: typee -opt1 -opt2 ..._
23+
4. ...
24+
5. ...
25+
6. ... _any other valuable information to reproduce the error_]
26+
27+
1728
**Expected behavior**
18-
A clear and concise description of what you expected to happen.
29+
30+
[_A clear and concise description of what you expected to happen._]
31+
1932

2033
**Screenshots**
21-
If applicable, add screenshots to help explain your problem.
34+
35+
[_If applicable, add screenshots to help explain your problem._]
36+
2237

2338
**Desktop (please complete the following information):**
24-
- OS: [e.g. iOS]
25-
- Browser [e.g. chrome, safari]
26-
- Version [e.g. 22]
2739

28-
**Smartphone (please complete the following information):**
29-
- Device: [e.g. iPhone6]
30-
- OS: [e.g. iOS8.1]
31-
- Browser [e.g. stock browser, safari]
32-
- Version [e.g. 22]
40+
- OS: [_e.g. iOS, MacOS X, Win32, Win64, Linux/Ubuntu, Linux/Fedora, ..._]
41+
- Version [_e.g. 8_]
42+
- Translator: [_e.g. C++17, C#, Java 8.1, Java for Android 9, Python 3.8, ..._]
3343

44+
3445
**Additional context**
35-
Add any other context about the problem here.
46+
47+
[_Add any other context about the problem here._]
48+
[_For instance, you may copy here Typee code and finally erroneous translated code._]
+12-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
---
22
name: Feature request
3-
about: Suggest an idea for this project
3+
about: Suggest an idea to enhance Typee project
44

55
---
66

77
**Is your feature request related to a problem? Please describe.**
8-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
8+
9+
[_A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]_]
10+
911

1012
**Describe the solution you'd like**
11-
A clear and concise description of what you want to happen.
13+
14+
[_A clear and concise description of what you want to happen._]
15+
1216

1317
**Describe alternatives you've considered**
14-
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
[_A clear and concise description of any alternative solutions or features you've considered._]
20+
1521

1622
**Additional context**
17-
Add any other context or screenshots about the feature request here.
23+
24+
[_Add any other context or screenshots about the feature request here._]

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ __pycache__
1212
* - Copie.grm
1313
*-new.grm
1414
* - Copy.grm
15+
UML*

Language-specifications/typee_specs_LL1-v9-1-EBNF.grm

+16-4
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ SOFTWARE.
4040
( <dotted name'> | <function call> |
4141
<subscription or slicing> )*
4242

43-
<atom> ::= [<decr>|<incr>] <dotted name> [<decr>|<incr>] |
44-
<enclosure> | <reference> | <scalar> |
45-
<string> | <boolean>
43+
<atom> ::= (<decr>|<incr>) <dotted name> [<decr>|<incr>] |
44+
<dotted name>
45+
[<decr> | <incr> | <for comprehension> ] |
46+
<enclosure> | <reference> | <scalar> |
47+
<string> | <boolean>
4648

4749
<boolean> ::= <TRUE> | <FALSE>
4850

@@ -341,7 +343,17 @@ SOFTWARE.
341343
<simple statement end> ::= ';'
342344

343345
<statements block> ::= '{' [<statements list>] '}' |
344-
[<nop statement>] <simple statement end>
346+
(<empty statement>)* |
347+
<compound statement> | <simple statement>
348+
349+
350+
<statements block> ::= '{' <statements list> '}'
351+
| <empty statement> <statements block> ###
352+
| <compound statement> ###
353+
| <simple statement> ###
354+
## | <nop statement> <simple statement end> ###
355+
## | <simple statement end> ###
356+
345357

346358
<assert statement> ::= 'assert' <expression> ( ',' <expression>)*
347359

Language-specifications/typee_specs_LL1-v9-1.grm

+9-5
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@ SOFTWARE.
4545

4646
<atom> ::= <decr> <dotted name> <incr or decr>
4747
| <incr> <dotted name> <incr or decr>
48-
| <dotted name> <incr or decr>
48+
| <dotted name> <atom'>
4949
| <enclosure>
5050
| <reference>
5151
| <scalar>
5252
| <string>
5353
| <boolean>
54+
<atom'> ::= <incr or decr>
55+
| <for comprehension>
5456

5557
<boolean> ::= <TRUE>
5658
| <FALSE>
@@ -64,7 +66,9 @@ SOFTWARE.
6466

6567
<incr> ::= '++'
6668

67-
<incr or decr> ::= <decr> | <incr> | EPS
69+
<incr or decr> ::= <decr>
70+
| <incr>
71+
| EPS
6872

6973
<is instance of> ::= '->' <dotted name>
7074

@@ -472,9 +476,9 @@ SOFTWARE.
472476
<simple statement end> ::= ';'
473477

474478
<statements block> ::= '{' <statements list> '}'
475-
| <nop statement> <simple statement end>
476-
| <simple statement end>
477-
479+
| <compound statement>
480+
| <empty statement> <statements block>
481+
| <simple statement>
478482

479483
<assert statement> ::= 'assert' <expression> <assert statement'>
480484
<assert statement'> ::= ',' <expression>

Notepad++XML-configs/grammars.xml

+16-16
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Keywords name="Numbers, suffix1"></Keywords>
1414
<Keywords name="Numbers, suffix2"></Keywords>
1515
<Keywords name="Numbers, range"></Keywords>
16-
<Keywords name="Operators1"></Keywords>
16+
<Keywords name="Operators1">* +</Keywords>
1717
<Keywords name="Operators2"></Keywords>
1818
<Keywords name="Folders in code1, open"></Keywords>
1919
<Keywords name="Folders in code1, middle"></Keywords>
@@ -25,39 +25,39 @@
2525
<Keywords name="Folders in comment, middle"></Keywords>
2626
<Keywords name="Folders in comment, close"></Keywords>
2727
<Keywords name="Keywords1">::= | -</Keywords>
28-
<Keywords name="Keywords2">EPS</Keywords>
28+
<Keywords name="Keywords2">EPS EPSILON</Keywords>
2929
<Keywords name="Keywords3"></Keywords>
3030
<Keywords name="Keywords4"></Keywords>
3131
<Keywords name="Keywords5"></Keywords>
3232
<Keywords name="Keywords6"></Keywords>
3333
<Keywords name="Keywords7"></Keywords>
3434
<Keywords name="Keywords8"></Keywords>
35-
<Keywords name="Delimiters">00&lt; 01 02&gt; 03&apos; 04\ 05&apos; 06&quot; 07\ 08&quot; 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
35+
<Keywords name="Delimiters">00[ 01\ 02] 03( 04\ 05) 06&quot; 07\ 08&quot; 09&apos; 10\ 11&apos; 12&lt; 13\ 14&gt; 15{ 16\ 17} 18$ 19 20; 21 22 23</Keywords>
3636
</KeywordLists>
3737
<Styles>
38-
<WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
39-
<WordsStyle name="COMMENTS" fgColor="00A0A0" bgColor="FFFFFF" fontName="Courier New" fontStyle="3" nesting="0" />
40-
<WordsStyle name="LINE COMMENTS" fgColor="000000" bgColor="FFFF00" fontName="Courier New" fontStyle="0" nesting="0" />
38+
<WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="9" nesting="0" />
39+
<WordsStyle name="COMMENTS" fgColor="00A0A0" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" />
40+
<WordsStyle name="LINE COMMENTS" fgColor="707070" bgColor="FFFFA8" fontName="" fontStyle="2" nesting="0" />
4141
<WordsStyle name="NUMBERS" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
42-
<WordsStyle name="KEYWORDS1" fgColor="008040" bgColor="FFFFFF" fontName="Courier New" fontStyle="1" nesting="0" />
43-
<WordsStyle name="KEYWORDS2" fgColor="008040" bgColor="FFFFFF" fontName="Courier New" fontStyle="3" nesting="0" />
42+
<WordsStyle name="KEYWORDS1" fgColor="008040" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
43+
<WordsStyle name="KEYWORDS2" fgColor="008040" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" />
4444
<WordsStyle name="KEYWORDS3" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
4545
<WordsStyle name="KEYWORDS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
4646
<WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
4747
<WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
4848
<WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
4949
<WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
50-
<WordsStyle name="OPERATORS" fgColor="000000" bgColor="FFFF00" fontName="" fontStyle="0" nesting="0" />
50+
<WordsStyle name="OPERATORS" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
5151
<WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
5252
<WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
5353
<WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
54-
<WordsStyle name="DELIMITERS1" fgColor="0000A0" bgColor="FFFFFF" fontName="Courier New" fontStyle="0" nesting="0" />
55-
<WordsStyle name="DELIMITERS2" fgColor="C86400" bgColor="FFFFFF" fontName="Courier New" fontStyle="1" nesting="0" />
56-
<WordsStyle name="DELIMITERS3" fgColor="C86400" bgColor="FFFFFF" fontName="Courier New" fontStyle="1" nesting="0" />
57-
<WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
58-
<WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
59-
<WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
60-
<WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
54+
<WordsStyle name="DELIMITERS1" fgColor="0000A0" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
55+
<WordsStyle name="DELIMITERS2" fgColor="0000A0" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
56+
<WordsStyle name="DELIMITERS3" fgColor="C86400" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
57+
<WordsStyle name="DELIMITERS4" fgColor="C86400" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
58+
<WordsStyle name="DELIMITERS5" fgColor="0000A0" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
59+
<WordsStyle name="DELIMITERS6" fgColor="007979" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
60+
<WordsStyle name="DELIMITERS7" fgColor="004040" bgColor="24F4FF" fontName="" fontStyle="2" nesting="0" />
6161
<WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
6262
</Styles>
6363
</UserLang>

Notepad++XML-configs/typee.xml

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<NotepadPlus>
2-
<UserLang name="typee" ext="ty typee" udlVersion="2.1">
2+
<UserLang name="Typee" ext="ty typee TY TYPEE" udlVersion="2.1">
33
<Settings>
44
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
55
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
@@ -13,7 +13,7 @@
1313
<Keywords name="Numbers, suffix1"></Keywords>
1414
<Keywords name="Numbers, suffix2"></Keywords>
1515
<Keywords name="Numbers, range"></Keywords>
16-
<Keywords name="Operators1">@ &amp; / ^ : . | ! &gt; &lt; - % + * = &lt;= == != &gt;= -- ++ # ** ^^ @= &amp;= /= ^= |= != -= %= += *= ^^= **= &gt;&gt;&gt; &gt;&gt;&gt;= &lt;&lt;&lt; &lt;&lt;&lt;= &gt;&lt; &gt;&lt;= !! !!= :: ::=</Keywords>
16+
<Keywords name="Operators1">@ &amp; / ^ : . | ! &gt; &lt; - % + * = &lt;= == != &gt;= -- ++ # ** ^^ @= &amp;= /= ^= |= != -= %= += *= ^^= **= &gt;&gt;&gt; &gt;&gt;&gt;= &lt;&lt;&lt; &lt;&lt;&lt;= &gt;&lt; &gt;&lt;= !! !!= :: ::= ?? ??= &lt;&lt; &lt;&lt;= &gt;&gt; &gt;&gt;=</Keywords>
1717
<Keywords name="Operators2"></Keywords>
1818
<Keywords name="Folders in code1, open">{</Keywords>
1919
<Keywords name="Folders in code1, middle"></Keywords>
@@ -24,35 +24,35 @@
2424
<Keywords name="Folders in comment, open"></Keywords>
2525
<Keywords name="Folders in comment, middle"></Keywords>
2626
<Keywords name="Folders in comment, close"></Keywords>
27-
<Keywords name="Keywords1">abstract all and array as assert break case cast class continue const del elif else elseif elsif embed ensure enum except file False false final finally for forever from hidden if import in is lambda list map None none nop not operator or pass private protected public raise repeat require ret return set static switch True true try type unnamed until volatile while with</Keywords>
28-
<Keywords name="Keywords2">? bool char char16 float32 float64 int8 int16 int32 int64 str str16 uint8 uint16 uint32 uint64 </Keywords>
27+
<Keywords name="Keywords1">abstract all and array as assert break case cast class continue const del delete destroy elif else elseif elsif embed ensure enum except exclude exit file False false final finally for forever forward from fwd hidden if import in is lambda list map None none nop not operator or pass private protected public raise repeat require ret return set static switch True true try type unnamed until volatile while with</Keywords>
28+
<Keywords name="Keywords2">? bool char char16 float32 float64 int8 int16 int32 int64 str str16 uint8 uint16 uint32 uint64</Keywords>
2929
<Keywords name="Keywords3">me</Keywords>
30-
<Keywords name="Keywords4"></Keywords>
31-
<Keywords name="Keywords5"></Keywords>
32-
<Keywords name="Keywords6"></Keywords>
30+
<Keywords name="Keywords4">android cpp cs csharp java py python</Keywords>
31+
<Keywords name="Keywords5">catch def define double Double enum extends implements ifdef ifndef include isinstance len none None NULL null object Object ref rethrow string System struct throw typedef typename typeof using void</Keywords>
32+
<Keywords name="Keywords6">base Byte byte Boolean boolean Char complex decimal Decimal float int Int16 Int32 Int64 long SByte sbyte Single short string String uint UInt16 UInt32 UInt64 ulong undef unsigned ushort this</Keywords>
3333
<Keywords name="Keywords7"></Keywords>
3434
<Keywords name="Keywords8"></Keywords>
3535
<Keywords name="Delimiters">00&quot; 01\ 02&quot; 03&apos; 04\ 05&apos; 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
3636
</KeywordLists>
3737
<Styles>
38-
<WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
39-
<WordsStyle name="COMMENTS" fgColor="808080" bgColor="FFFFFF" fontName="Courier New" fontStyle="2" nesting="0" />
40-
<WordsStyle name="LINE COMMENTS" fgColor="808080" bgColor="FFFFFF" fontName="Courier New" fontStyle="2" nesting="0" />
41-
<WordsStyle name="NUMBERS" fgColor="000000" bgColor="FFFFFF" fontName="Courier New" fontStyle="0" fontSize="10" nesting="0" />
42-
<WordsStyle name="KEYWORDS1" fgColor="0000FF" bgColor="FFFFFF" fontName="Courier New" fontStyle="1" nesting="0" />
43-
<WordsStyle name="KEYWORDS2" fgColor="0000C0" bgColor="FFFFFF" fontName="Courier New" fontStyle="3" fontSize="10" nesting="0" />
44-
<WordsStyle name="KEYWORDS3" fgColor="000000" bgColor="FFFFFF" fontName="Courier New" fontStyle="3" fontSize="10" nesting="0" />
45-
<WordsStyle name="KEYWORDS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
46-
<WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
47-
<WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
38+
<WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="9" nesting="0" />
39+
<WordsStyle name="COMMENTS" fgColor="B95C00" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" />
40+
<WordsStyle name="LINE COMMENTS" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" />
41+
<WordsStyle name="NUMBERS" fgColor="339944" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
42+
<WordsStyle name="KEYWORDS1" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
43+
<WordsStyle name="KEYWORDS2" fgColor="0000C0" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" />
44+
<WordsStyle name="KEYWORDS3" fgColor="0000A0" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" />
45+
<WordsStyle name="KEYWORDS4" fgColor="0000A0" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" />
46+
<WordsStyle name="KEYWORDS5" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
47+
<WordsStyle name="KEYWORDS6" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" />
4848
<WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
4949
<WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
50-
<WordsStyle name="OPERATORS" fgColor="0000C6" bgColor="FFFFFF" fontName="Courier New" fontStyle="0" fontSize="10" nesting="0" />
50+
<WordsStyle name="OPERATORS" fgColor="FF8811" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
5151
<WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
5252
<WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
5353
<WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
54-
<WordsStyle name="DELIMITERS1" fgColor="008080" bgColor="FFFFFF" fontName="Courier New" fontStyle="2" nesting="0" />
55-
<WordsStyle name="DELIMITERS2" fgColor="008080" bgColor="FFFFFF" fontName="Courier New" fontStyle="2" nesting="0" />
54+
<WordsStyle name="DELIMITERS1" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" />
55+
<WordsStyle name="DELIMITERS2" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" />
5656
<WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
5757
<WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
5858
<WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />

0 commit comments

Comments
 (0)