Skip to content

Commit 3bb8c95

Browse files
committed
تبصرہ اور تقریب
1 parent 21c20b3 commit 3bb8c95

4 files changed

Lines changed: 27 additions & 0 deletions

File tree

compiled.en.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
def ykh_tqryb ( ykh_dlyl):
3+
print ("میں کچھ کام کر سکتا ہوں!")
4+
print (ykh_dlyl)
5+
6+
ykh_tqryb("کچھ کرو!")

samples/تبصرہ۔پای

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#یہ ایک تبصرہ ہے۔
2+
3+
#چھاپ ("یہ ایک" + " " + "جملہ ہے۔")
4+
چھاپ ("یہ بھی ایک" + " " + "جملہ ہے۔")

samples/تقریب۔پای

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
وضح ایک_تقریب ( ایک_دلیل):
3+
چھاپ ("میں کچھ کام کر سکتا ہوں!")
4+
چھاپ (ایک_دلیل)
5+
6+
ایک_تقریب("کچھ کرو!")

src/lex.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def t_NUMBER(t):
180180
'ID',
181181

182182
'newline',
183+
'COMMENT',
183184
# 'tab',
184185

185186
] + list(reserved.values())
@@ -257,6 +258,16 @@ def t_STRING(t):
257258

258259
return t
259260

261+
# Comments rule
262+
def t_COMMENT(t):
263+
r'\#.*\n'
264+
265+
# ------------- Debugging ---------------
266+
# print ("Found a comment!", t.value)
267+
# ------------- Debugging ---------------
268+
269+
return t
270+
260271
# Build the lexer
261272
lexer = lex.lex()
262273

0 commit comments

Comments
 (0)