Repository: CrossGL/crosstl

Issue:
ToDO for  translator frontend 
- this task is to add support for `translator` frontend add token in `lexer` so it can also identify these tokens. for this task the one file  `crosstl/src/translator/lexer.py`

List of task 

- [x] #42 
- [x] #43 
- [x] #44 
- [x] #45 
- [x] #46 
- [x] #47 
- [x] #48 
- [x] #49 
- [x] #50 
- [x] #51 
- [x] #52 
- [x] #53 
- [x] #54 
- [x] #55 
- [x] #56 
- [x] #57 
- [x] #58 
- [x] #59 
- [x] #60 

## how to assign task

- you can assign the task to  your self just comment down the name of task on the issue  which you want to work  we will be assign that task to you. 

- we are not limited to these task only feel free to create any issue weather it is `adding new feature` , `bug` some or some `fix` and start working on that .

for and query feel free to ask  on our [discord](https://discord.com/invite/uyRQKXhcyW) server we will be happy to help you out 😄 

Happy coding 🚀 

Thanks for contributing here 
sam


<!-- BOT_STATE: {"assignee": "samthakur587", "assigned_at": "2024-12-26T13:58:38.905601+00:00", "reminder_sent": false, "unassigned": false} -->

Discussion:
github-actions[bot]: This pull request has been marked as stale because it has been inactive for more than 14 days. Please update this pull request or it will be automatically closed in 7 days.

Patch:
diff --git a/crosstl/translator/lexer.py b/crosstl/translator/lexer.py
index 84cad4f..c260361 100644
--- a/crosstl/translator/lexer.py
+++ b/crosstl/translator/lexer.py
@@ -21,6 +21,7 @@ TOKENS = OrderedDict(
         ("FRAGMENT", r"\bfragment\b"),
         ("FLOAT_NUMBER", r"\d*\.\d+|\d+\.\d*"),
         ("FLOAT", r"\bfloat\b"),
+        ("UNSIGNED_INT", r"\bunsigned int\b"),
         ("INT", r"\bint\b"),
         ("UINT", r"\buint\b"),
         ("DOUBLE", r"\bdouble\b"),
@@ -77,6 +78,7 @@ TOKENS = OrderedDict(
         ("BITWISE_OR", r"\|"),
         ("BITWISE_XOR", r"\^"),
         ("BITWISE_NOT", r"~"),
+        ("DOUBLE", r"\bdouble\b"),
     ]
 )
 


Test patch:
diff --git a/tests/test_translator/test_lexer.py b/tests/test_translator/test_lexer.py
index f4793b0..5164c59 100644
--- a/tests/test_translator/test_lexer.py
+++ b/tests/test_translator/test_lexer.py
@@ -152,6 +152,7 @@ def test_data_types_tokenization():
     float c;
     double d;
     bool e;
+    unsigned int f;
     """
     try:
         tokens = tokenize_code(code)
@@ -160,6 +161,9 @@ def test_data_types_tokenization():
         assert any(t[0] == "FLOAT" for t in tokens), "Missing 'FLOAT' token"
         assert any(t[0] == "DOUBLE" for t in tokens), "Missing 'DOUBLE' token"
         assert any(t[0] == "BOOL" for t in tokens), "Missing 'BOOL' token"
+        assert any(
+            t[0] == "UNSIGNED_INT" for t in tokens
+        ), "Missing 'UNSIGNED INT' token"
     except SyntaxError:
         pytest.fail("Data types tokenization not implemented.")