reactxpy 0.1.2__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. {reactxpy-0.1.2/reactxpy.egg-info → reactxpy-0.1.4}/PKG-INFO +2 -2
  2. {reactxpy-0.1.2 → reactxpy-0.1.4}/README.md +1 -1
  3. {reactxpy-0.1.2 → reactxpy-0.1.4/reactxpy.egg-info}/PKG-INFO +2 -2
  4. {reactxpy-0.1.2 → reactxpy-0.1.4}/setup.py +1 -1
  5. {reactxpy-0.1.2 → reactxpy-0.1.4}/src/lexer.cpp +35 -5
  6. {reactxpy-0.1.2 → reactxpy-0.1.4}/src/parser.cpp +9 -3
  7. {reactxpy-0.1.2 → reactxpy-0.1.4}/MANIFEST.in +0 -0
  8. {reactxpy-0.1.2 → reactxpy-0.1.4}/pyproject.toml +0 -0
  9. {reactxpy-0.1.2 → reactxpy-0.1.4}/reactxpy/__init__.py +0 -0
  10. {reactxpy-0.1.2 → reactxpy-0.1.4}/reactxpy/cli.py +0 -0
  11. {reactxpy-0.1.2 → reactxpy-0.1.4}/reactxpy/create_app.py +0 -0
  12. {reactxpy-0.1.2 → reactxpy-0.1.4}/reactxpy.egg-info/SOURCES.txt +0 -0
  13. {reactxpy-0.1.2 → reactxpy-0.1.4}/reactxpy.egg-info/dependency_links.txt +0 -0
  14. {reactxpy-0.1.2 → reactxpy-0.1.4}/reactxpy.egg-info/entry_points.txt +0 -0
  15. {reactxpy-0.1.2 → reactxpy-0.1.4}/reactxpy.egg-info/not-zip-safe +0 -0
  16. {reactxpy-0.1.2 → reactxpy-0.1.4}/reactxpy.egg-info/top_level.txt +0 -0
  17. {reactxpy-0.1.2 → reactxpy-0.1.4}/setup.cfg +0 -0
  18. {reactxpy-0.1.2 → reactxpy-0.1.4}/src/ast.h +0 -0
  19. {reactxpy-0.1.2 → reactxpy-0.1.4}/src/generator.cpp +0 -0
  20. {reactxpy-0.1.2 → reactxpy-0.1.4}/src/generator.h +0 -0
  21. {reactxpy-0.1.2 → reactxpy-0.1.4}/src/lexer.h +0 -0
  22. {reactxpy-0.1.2 → reactxpy-0.1.4}/src/linker.cpp +0 -0
  23. {reactxpy-0.1.2 → reactxpy-0.1.4}/src/linker.h +0 -0
  24. {reactxpy-0.1.2 → reactxpy-0.1.4}/src/main.cpp +0 -0
  25. {reactxpy-0.1.2 → reactxpy-0.1.4}/src/parser.h +0 -0
  26. {reactxpy-0.1.2 → reactxpy-0.1.4}/src/test_parser.cpp +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reactxpy
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: ReactXPy compiler for web applications.
5
5
  Author: Anish Kumar
6
6
  Description-Content-Type: text/markdown
@@ -22,6 +22,7 @@ If you love Python's indentation-based readability but need the dynamic, compone
22
22
  - **Pure Python Syntax for Components:** Define your UI components using standard `def ComponentName(props):` definitions, free of brackets and JavaScript boilerplate.
23
23
  - **Native Inline JSX:** Seamlessly blend standard HTML/JSX tags directly inside your Python functions. The C++ parser intelligently distinguishes Python control flow from DOM declarations.
24
24
  - **State & Hooks Engine (NEW):** ReactXPy v2 natively supports React Hooks! Utilize `useState` and `useEffect` with standard Python assignments and lambdas.
25
+ - **Advanced AST Lexical Engine (v0.1.3):** The C++ parser natively processes single quotes (`'`), Javascript backticks (`` ` ``), and pythonic multiline triple quotes (`"""`). It actively converts multiline text elements into native ES6 Template literals!
25
26
  - **Dynamic Props & Interpolation:** Pass data across components naturally using `{props.value}` syntax. Evaluate complex math or logic inside interpolations instantly.
26
27
  - **Native Event Handling:** Bind Python functions directly to DOM events like `onClick={triggerFunc}` without dealing with `this` binding or context scoping.
27
28
  - **Powerful Conditional Rendering:** Drive UI states with intuitive boolean logic such as `{isActive && <div class="badge">Online</div>}` right inside the tree.
@@ -157,7 +158,6 @@ ReactXPy is an actively maintained open-source framework. The current horizon fe
157
158
 
158
159
  ---
159
160
 
160
-
161
161
  ### License
162
162
 
163
163
  MIT License - Have fun building!
@@ -11,6 +11,7 @@ If you love Python's indentation-based readability but need the dynamic, compone
11
11
  - **Pure Python Syntax for Components:** Define your UI components using standard `def ComponentName(props):` definitions, free of brackets and JavaScript boilerplate.
12
12
  - **Native Inline JSX:** Seamlessly blend standard HTML/JSX tags directly inside your Python functions. The C++ parser intelligently distinguishes Python control flow from DOM declarations.
13
13
  - **State & Hooks Engine (NEW):** ReactXPy v2 natively supports React Hooks! Utilize `useState` and `useEffect` with standard Python assignments and lambdas.
14
+ - **Advanced AST Lexical Engine (v0.1.3):** The C++ parser natively processes single quotes (`'`), Javascript backticks (`` ` ``), and pythonic multiline triple quotes (`"""`). It actively converts multiline text elements into native ES6 Template literals!
14
15
  - **Dynamic Props & Interpolation:** Pass data across components naturally using `{props.value}` syntax. Evaluate complex math or logic inside interpolations instantly.
15
16
  - **Native Event Handling:** Bind Python functions directly to DOM events like `onClick={triggerFunc}` without dealing with `this` binding or context scoping.
16
17
  - **Powerful Conditional Rendering:** Drive UI states with intuitive boolean logic such as `{isActive && <div class="badge">Online</div>}` right inside the tree.
@@ -146,7 +147,6 @@ ReactXPy is an actively maintained open-source framework. The current horizon fe
146
147
 
147
148
  ---
148
149
 
149
-
150
150
  ### License
151
151
 
152
152
  MIT License - Have fun building!
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reactxpy
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: ReactXPy compiler for web applications.
5
5
  Author: Anish Kumar
6
6
  Description-Content-Type: text/markdown
@@ -22,6 +22,7 @@ If you love Python's indentation-based readability but need the dynamic, compone
22
22
  - **Pure Python Syntax for Components:** Define your UI components using standard `def ComponentName(props):` definitions, free of brackets and JavaScript boilerplate.
23
23
  - **Native Inline JSX:** Seamlessly blend standard HTML/JSX tags directly inside your Python functions. The C++ parser intelligently distinguishes Python control flow from DOM declarations.
24
24
  - **State & Hooks Engine (NEW):** ReactXPy v2 natively supports React Hooks! Utilize `useState` and `useEffect` with standard Python assignments and lambdas.
25
+ - **Advanced AST Lexical Engine (v0.1.3):** The C++ parser natively processes single quotes (`'`), Javascript backticks (`` ` ``), and pythonic multiline triple quotes (`"""`). It actively converts multiline text elements into native ES6 Template literals!
25
26
  - **Dynamic Props & Interpolation:** Pass data across components naturally using `{props.value}` syntax. Evaluate complex math or logic inside interpolations instantly.
26
27
  - **Native Event Handling:** Bind Python functions directly to DOM events like `onClick={triggerFunc}` without dealing with `this` binding or context scoping.
27
28
  - **Powerful Conditional Rendering:** Drive UI states with intuitive boolean logic such as `{isActive && <div class="badge">Online</div>}` right inside the tree.
@@ -157,7 +158,6 @@ ReactXPy is an actively maintained open-source framework. The current horizon fe
157
158
 
158
159
  ---
159
160
 
160
-
161
161
  ### License
162
162
 
163
163
  MIT License - Have fun building!
@@ -48,7 +48,7 @@ reactxpy_ext = Extension("reactxpy.dummy", sources=[])
48
48
 
49
49
  setup(
50
50
  name="reactxpy",
51
- version="0.1.2",
51
+ version="0.1.4",
52
52
  description="ReactXPy compiler for web applications.",
53
53
  long_description=long_description,
54
54
  long_description_content_type="text/markdown",
@@ -98,12 +98,38 @@ vector<Token> Lexer::tokenize(){
98
98
  }
99
99
 
100
100
  // STRING
101
- if(peek()=='"'){
102
- pos++;
101
+ if(peek() == '"' || peek() == '\'' || peek() == '`'){
102
+ char quote = peek();
103
+ bool isTriple = false;
104
+
105
+ if(pos + 2 < source.size() && peek(1) == quote && peek(2) == quote) {
106
+ isTriple = true;
107
+ pos += 3;
108
+ } else {
109
+ pos++;
110
+ }
111
+
103
112
  string v;
104
- while(peek()!='"' && peek()!='\0')
105
- v+=source[pos++];
106
- if(peek()=='"') pos++;
113
+ while(pos < source.size()){
114
+ if(isTriple){
115
+ if(pos + 2 < source.size() && peek() == quote && peek(1) == quote && peek(2) == quote){
116
+ pos += 3;
117
+ break;
118
+ }
119
+ } else {
120
+ if(peek() == quote) {
121
+ pos++;
122
+ break;
123
+ }
124
+ }
125
+
126
+ if(peek() == '\\' && pos + 1 < source.size()){
127
+ v += source[pos++];
128
+ v += source[pos++];
129
+ } else {
130
+ v += source[pos++];
131
+ }
132
+ }
107
133
  tokens.push_back({STRING,v});
108
134
  continue;
109
135
  }
@@ -248,6 +274,10 @@ vector<Token> Lexer::tokenize(){
248
274
  if(c==':'){tokens.push_back({COLON,":"});pos++;continue;}
249
275
  if(c==','){tokens.push_back({COMMA,","});pos++;continue;}
250
276
  if(c=='='){tokens.push_back({EQUAL,"="});pos++;continue;}
277
+
278
+ // Add Brace Token Parsers for valid internal JS Mapping
279
+ if(c=='{'){tokens.push_back({IDENTIFIER,"{"});pos++;continue;}
280
+ if(c=='}'){tokens.push_back({IDENTIFIER,"}"});pos++;continue;}
251
281
 
252
282
  // Catch all unknown valid operators (like +, -, ||, &&, ;, !, ?)
253
283
  if(!isSpace(c) && !isAlpha(c) && !isdigit(c)) {
@@ -111,9 +111,15 @@ FunctionNode Parser::parseFunction() {
111
111
 
112
112
  Token t = advance();
113
113
 
114
- // preserve strings
115
- if (t.type == STRING)
116
- body += "\"" + t.value + "\"";
114
+ // preserve strings (output as JS template literals to support multiline)
115
+ if (t.type == STRING) {
116
+ string escaped;
117
+ for(char c : t.value) {
118
+ if(c == '`') escaped += "\\`";
119
+ else escaped += c;
120
+ }
121
+ body += "`" + escaped + "`";
122
+ }
117
123
  else
118
124
  body += t.value;
119
125
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes