File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+
2+ def ykh_tqryb ( ykh_dlyl ):
3+ print ("میں کچھ کام کر سکتا ہوں!" )
4+ print (ykh_dlyl )
5+
6+ ykh_tqryb ("کچھ کرو!" )
Original file line number Diff line number Diff line change 1+ #یہ ایک تبصرہ ہے۔
2+
3+ #چھاپ ("یہ ایک" + " " + "جملہ ہے۔")
4+ چھاپ ("یہ بھی ایک" + " " + "جملہ ہے۔")
Original file line number Diff line number Diff line change 1+
2+ وضح ایک_تقریب ( ایک_دلیل):
3+ چھاپ ("میں کچھ کام کر سکتا ہوں!")
4+ چھاپ (ایک_دلیل)
5+
6+ ایک_تقریب("کچھ کرو!")
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments