Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more lineno

  • Loading branch information...
commit f0966cf3cd79dd96df32bc98394e822c791c49b5 1 parent 54f1d9d
@fperrad authored
Showing with 155 additions and 144 deletions.
  1. +7 −1 src/lua/lunokhod.lua
  2. +148 −143 src/lua/lunokhod.tp
View
8 src/lua/lunokhod.lua
@@ -1109,11 +1109,17 @@ end
local function exprstat (s, pos, buffer)
-- stat -> func | assignment
local buf = {}
+ local lineno = lineno
pos = primaryexpr(s, pos, buf)
- buffer[#buffer] = tconcat(buf)
pos = skip_ws(s, pos)
if tok_comma:match(s, pos) or tok_equal:match(s, pos) then
+ buffer[#buffer] = tconcat(buf)
return assignment(s, pos, buffer, 1)
+ else
+ buffer[#buffer] = '(!line '
+ buffer[#buffer] = lineno
+ buffer[#buffer] = ')'
+ buffer[#buffer] = tconcat(buf)
end
return pos
end
View
291 src/lua/lunokhod.tp
@@ -37,7 +37,7 @@
(!line 42)(!assign lineno (!add lineno 0.5))))
(!line 44)(!define syntaxerror)(!assign syntaxerror (!lambda (err)
-(!call error (!concat err (!concat " at " lineno)))))
+(!line 45)(!call error (!concat err (!concat " at " lineno)))))
(!line 48)(!define bytecode (!call literal "\x1b"))
(!line 49)(!define bom (!call literal "\xef\xbb\xbf"))
@@ -82,7 +82,7 @@
(!line 129)(!define n (!call tonumber s))
(!line 130)(!if (!ge n 256)
(!do
-(!call syntaxerror (!concat "decimal escape too large near " s))))
+(!line 131)(!call syntaxerror (!concat "decimal escape too large near " s))))
(!line 133)(!return (!call char n)))))
(!line 136)(!define unescape (!lambda (str)
(!line 137)(!return (!callmeth gsub_escape_special match (!callmeth gsub_escape_xdigit match (!callmeth gsub_escape_decimal match str))))))
@@ -212,24 +212,24 @@
(!line 279)(!define fieldsel)(!assign fieldsel (!lambda (s pos buffer)
(!line 281)(!define (capt posn) ((!callmeth capt_sel match s pos)))
-(!call assert posn)
+(!line 282)(!call assert posn)
(!line 283)(!assign pos (!call skip_ws s posn))
(!line 284)(!massign (capt posn) ((!callmeth capt_identifier match s pos)))
(!line 285)(!if (!not posn)
(!do
-(!call syntaxerror "<name> expected")))
+(!line 286)(!call syntaxerror "<name> expected")))
(!line 288)(!assign (!index buffer (!len buffer)) (!call quoted capt))
(!line 289)(!return posn)))
(!line 293)(!define yindex)(!assign yindex (!lambda (s pos buffer)
(!line 295)(!define (capt posn) ((!callmeth capt_left_bracket match s pos)))
-(!call assert posn)
+(!line 296)(!call assert posn)
(!line 297)(!assign pos (!call skip_ws s posn))
(!line 298)(!assign pos (!call expr s pos buffer !true))
(!line 299)(!massign (capt posn) ((!callmeth capt_right_bracket match s pos)))
(!line 300)(!if (!not posn)
(!do
-(!call syntaxerror "] expected")))
+(!line 301)(!call syntaxerror "] expected")))
(!line 303)(!return posn)))
(!line 307)(!define recfield)(!assign recfield (!lambda (s pos buffer)
@@ -245,7 +245,7 @@
(!line 319)(!massign (capt posn) ((!callmeth capt_equal match s pos)))
(!line 320)(!if (!not posn)
(!do
-(!call syntaxerror "= expected")))
+(!line 321)(!call syntaxerror "= expected")))
(!line 323)(!assign (!index buffer (!len buffer)) ": ")
(!line 324)(!assign pos (!call skip_ws s posn))
(!line 325)(!return (!call expr s pos buffer !true))))
@@ -270,7 +270,7 @@
(!line 354)(!define (capt posn) ((!callmeth capt_left_brace match s pos)))
(!line 355)(!if (!not posn)
(!do
-(!call syntaxerror "{ expected")))
+(!line 356)(!call syntaxerror "{ expected")))
(!line 358)(!assign (!index buffer (!len buffer)) "(")
(!line 359)(!assign pos (!call skip_ws s posn))
(!line 360)(!repeat
@@ -288,7 +288,7 @@
(!line 372)(!massign (capt posn) ((!callmeth capt_right_brace match s pos)))
(!line 373)(!if (!not posn)
(!do
-(!call syntaxerror "} expected")))
+(!line 374)(!call syntaxerror "} expected")))
(!line 376)(!assign (!index buffer (!len buffer)) ")")
(!line 377)(!return posn)))
@@ -312,7 +312,7 @@
(!do
(!line 399)(!assign (!index buffer (!len buffer)) "!vararg")
(!line 400)(!return posn))(!do
-(!call syntaxerror "<name> or '...' expected")))))
+(!line 402)(!call syntaxerror "<name> or '...' expected")))))
(!line 405)(!assign pos (!call skip_ws s pos))
(!line 406)(!massign (capt posn) ((!callmeth capt_comma match s pos)))
(!line 407)(!if posn
@@ -326,7 +326,7 @@
(!line 419)(!define (capt posn) ((!callmeth capt_left_paren match s pos)))
(!line 420)(!if (!not posn)
(!do
-(!call syntaxerror "( expected")))
+(!line 421)(!call syntaxerror "( expected")))
(!line 423)(!assign (!index buffer (!len buffer)) "(")
(!line 424)(!assign pos (!call skip_ws s posn))
(!line 425)(!assign pos (!call parlist s pos buffer ismethod))
@@ -334,14 +334,14 @@
(!line 427)(!massign (capt posn) ((!callmeth capt_right_paren match s pos)))
(!line 428)(!if (!not posn)
(!do
-(!call syntaxerror ") expected")))
+(!line 429)(!call syntaxerror ") expected")))
(!line 431)(!assign (!index buffer (!len buffer)) ")")
(!line 432)(!assign pos (!call statlist s posn buffer))
(!line 433)(!assign pos (!call skip_ws s pos))
(!line 434)(!massign (capt posn) ((!callmeth capt_end match s pos)))
(!line 435)(!if (!not posn)
(!do
-(!call syntaxerror "'end' expected")))
+(!line 436)(!call syntaxerror "'end' expected")))
(!line 438)(!assign (!index buffer (!len buffer)) ")")
(!line 439)(!return posn)))
@@ -372,7 +372,7 @@
(!line 470)(!if posn
(!do
(!line 471)(!return posn))(!do
-(!call syntaxerror ") expected")))))
+(!line 473)(!call syntaxerror ") expected")))))
(!line 477)(!if (!callmeth1 tok_left_brace match s pos)
(!do
(!line 478)(!return (!call constructor s pos buffer))))
@@ -381,7 +381,7 @@
(!do
(!line 483)(!assign (!index buffer (!len buffer)) capt)
(!line 484)(!return posn)))
-(!call syntaxerror "function arguments expected")))
+(!line 486)(!call syntaxerror "function arguments expected")))
(!line 490)(!define prefixexpr)(!assign prefixexpr (!lambda (s pos buffer)
(!line 492)(!assign pos (!call skip_ws s pos))
@@ -394,13 +394,13 @@
(!line 498)(!if posn
(!do
(!line 499)(!return posn))(!do
-(!call syntaxerror ") expected")))))
+(!line 501)(!call syntaxerror ") expected")))))
(!line 504)(!massign (capt posn) ((!callmeth capt_identifier match s pos)))
(!line 505)(!if posn
(!do
(!line 506)(!assign (!index buffer (!len buffer)) capt)
(!line 507)(!return posn)))
-(!call syntaxerror "unexpected symbol")))
+(!line 509)(!call syntaxerror "unexpected symbol")))
(!line 513)(!define primaryexpr)(!assign primaryexpr (!lambda (s pos buffer one)
(!line 516)(!define buf ())
@@ -437,7 +437,7 @@
(!line 546)(!define (capt posn) ((!callmeth capt_identifier match s pos)))
(!line 547)(!if (!not posn)
(!do
-(!call syntaxerror "<name> expected")))
+(!line 548)(!call syntaxerror "<name> expected")))
(!line 550)(!assign (!index buf (!len buf)) capt)
(!line 551)(!assign (!index buf (!len buf)) " ")
(!line 552)(!assign pos (!call skip_ws s posn))
@@ -552,7 +552,7 @@
(!line 719)(!massign (capt posn) ((!callmeth capt_equal match s pos)))
(!line 720)(!if (!not posn)
(!do
-(!call syntaxerror "= expected")))
+(!line 721)(!call syntaxerror "= expected")))
(!line 723)(!if (!eq n 1)
(!do
(!line 724)(!define var (!index buffer (!sub (!len buffer) 1)))
@@ -572,7 +572,7 @@
(!line 744)(!define breakstat)(!assign breakstat (!lambda (s pos buffer)
(!line 745)(!define (capt posn) ((!callmeth capt_break match s pos)))
-(!call assert posn)
+(!line 746)(!call assert posn)
(!line 747)(!assign (!index buffer (!len buffer)) "(!line ")
(!line 748)(!assign (!index buffer (!len buffer)) lineno)
(!line 749)(!assign (!index buffer (!len buffer)) ")(!break)")
@@ -580,7 +580,7 @@
(!line 754)(!define gotostat)(!assign gotostat (!lambda (s pos buffer)
(!line 755)(!define (capt posn) ((!callmeth capt_goto match s pos)))
-(!call assert posn)
+(!line 756)(!call assert posn)
(!line 757)(!assign (!index buffer (!len buffer)) "(!line ")
(!line 758)(!assign (!index buffer (!len buffer)) lineno)
(!line 759)(!assign (!index buffer (!len buffer)) ")(!goto ")
@@ -588,7 +588,7 @@
(!line 761)(!massign (capt posn) ((!callmeth capt_identifier match s pos)))
(!line 762)(!if (!not posn)
(!do
-(!call syntaxerror "<name> expected")))
+(!line 763)(!call syntaxerror "<name> expected")))
(!line 765)(!assign (!index buffer (!len buffer)) capt)
(!line 766)(!assign (!index buffer (!len buffer)) ")")
(!line 767)(!return posn)))
@@ -597,7 +597,7 @@
(!line 773)(!define (capt posn) ((!callmeth capt_identifier match s pos)))
(!line 774)(!if (!not posn)
(!do
-(!call syntaxerror "<name> expected")))
+(!line 775)(!call syntaxerror "<name> expected")))
(!line 777)(!assign (!index buffer (!len buffer)) "(!line ")
(!line 778)(!assign (!index buffer (!len buffer)) lineno)
(!line 779)(!assign (!index buffer (!len buffer)) ")(!label ")
@@ -607,12 +607,12 @@
(!line 783)(!massign (capt posn) ((!callmeth capt_dbcolon match s pos)))
(!line 784)(!if (!not posn)
(!do
-(!call syntaxerror ":: expected")))
+(!line 785)(!call syntaxerror ":: expected")))
(!line 787)(!return posn)))
(!line 791)(!define whilestat)(!assign whilestat (!lambda (s pos buffer)
(!line 793)(!define (capt posn) ((!callmeth capt_while match s pos)))
-(!call assert posn)
+(!line 794)(!call assert posn)
(!line 795)(!assign (!index buffer (!len buffer)) "(!line ")
(!line 796)(!assign (!index buffer (!len buffer)) lineno)
(!line 797)(!assign (!index buffer (!len buffer)) ")(!while ")
@@ -623,19 +623,19 @@
(!line 802)(!massign (capt posn) ((!callmeth capt_do match s pos)))
(!line 803)(!if (!not posn)
(!do
-(!call syntaxerror "do expected")))
+(!line 804)(!call syntaxerror "do expected")))
(!line 806)(!assign pos (!call skip_ws s posn))
(!line 807)(!assign pos (!call block s pos buffer))
(!line 808)(!assign pos (!call skip_ws s pos))
(!line 809)(!massign (capt posn) ((!callmeth capt_end match s pos)))
(!line 810)(!if (!not posn)
(!do
-(!call syntaxerror "end expected")))
+(!line 811)(!call syntaxerror "end expected")))
(!line 813)(!return posn)))
(!line 817)(!define repeatstat)(!assign repeatstat (!lambda (s pos buffer)
(!line 819)(!define (capt posn) ((!callmeth capt_repeat match s pos)))
-(!call assert posn)
+(!line 820)(!call assert posn)
(!line 821)(!assign (!index buffer (!len buffer)) "(!line ")
(!line 822)(!assign (!index buffer (!len buffer)) lineno)
(!line 823)(!assign (!index buffer (!len buffer)) ")(!repeat")
@@ -645,7 +645,7 @@
(!line 827)(!massign (capt posn) ((!callmeth capt_until match s pos)))
(!line 828)(!if (!not posn)
(!do
-(!call syntaxerror "until expected")))
+(!line 829)(!call syntaxerror "until expected")))
(!line 831)(!assign pos (!call skip_ws s posn))
(!line 832)(!assign (!index buffer (!len buffer)) "\x0a")
(!line 833)(!assign pos (!call expr s pos buffer !true))
@@ -657,7 +657,7 @@
(!line 842)(!define (capt posn) ((!callmeth capt_do match s pos)))
(!line 843)(!if (!not posn)
(!do
-(!call syntaxerror "do expected")))
+(!line 844)(!call syntaxerror "do expected")))
(!line 846)(!if name
(!do
(!line 847)(!assign (!index buffer (!len buffer)) "(!define ")
@@ -672,7 +672,7 @@
(!line 860)(!define (capt posn) ((!callmeth capt_equal match s pos)))
(!line 861)(!if (!not posn)
(!do
-(!call syntaxerror "= expected")))
+(!line 862)(!call syntaxerror "= expected")))
(!line 864)(!assign (!index buffer (!len buffer)) "(!line ")
(!line 865)(!assign (!index buffer (!len buffer)) lineno)
(!line 866)(!assign (!index buffer (!len buffer)) ")(!loop ")
@@ -683,7 +683,7 @@
(!line 871)(!massign (capt posn) ((!callmeth capt_comma match s pos)))
(!line 872)(!if (!not posn)
(!do
-(!call syntaxerror ", expected")))
+(!line 873)(!call syntaxerror ", expected")))
(!line 875)(!assign (!index buffer (!len buffer)) " ")
(!line 876)(!assign pos (!call skip_ws s posn))
(!line 877)(!assign pos (!call expr s pos buffer !true))
@@ -709,14 +709,14 @@
(!line 900)(!define (capt posnn) ((!callmeth capt_identifier match s pos)))
(!line 901)(!if (!not posnn)
(!do
-(!call syntaxerror "<name> expected")))
+(!line 902)(!call syntaxerror "<name> expected")))
(!line 904)(!assign (!index buffer (!len buffer)) capt)
(!line 905)(!assign pos (!call skip_ws s posnn))
(!line 906)(!massign (capt posn) ((!callmeth capt_comma match s pos))))
(!line 908)(!massign (capt posn) ((!callmeth capt_in match s pos)))
(!line 909)(!if (!not posn)
(!do
-(!call syntaxerror "in expected")))
+(!line 910)(!call syntaxerror "in expected")))
(!line 912)(!assign (!index buffer (!len buffer)) ") (")
(!line 913)(!assign pos (!call skip_ws s posn))
(!line 914)(!assign pos (!call explist s pos buffer))
@@ -725,24 +725,24 @@
(!line 920)(!define forstat)(!assign forstat (!lambda (s pos buffer)
(!line 922)(!define (capt posn) ((!callmeth capt_for match s pos)))
-(!call assert posn)
+(!line 923)(!call assert posn)
(!line 924)(!assign pos (!call skip_ws s posn))
(!line 925)(!massign (capt posn) ((!callmeth capt_identifier match s pos)))
(!line 926)(!if (!not posn)
(!do
-(!call syntaxerror "<name> expected")))
+(!line 927)(!call syntaxerror "<name> expected")))
(!line 929)(!assign pos (!call skip_ws s posn))
(!line 930)(!if (!callmeth1 tok_equal match s pos)
(!do
(!line 931)(!assign pos (!call fornum s pos buffer capt)))(!if (!or (!callmeth1 tok_comma match s pos) (!callmeth tok_in match s pos))
(!do
(!line 933)(!assign pos (!call forlist s pos buffer capt)))(!do
-(!call syntaxerror "'=' or 'in' expected"))))
+(!line 935)(!call syntaxerror "'=' or 'in' expected"))))
(!line 937)(!assign pos (!call skip_ws s pos))
(!line 938)(!massign (capt posn) ((!callmeth capt_end match s pos)))
(!line 939)(!if (!not posn)
(!do
-(!call syntaxerror "end expected")))
+(!line 940)(!call syntaxerror "end expected")))
(!line 942)(!return posn)))
(!line 946)(!define test_then_block)(!assign test_then_block (!lambda (s pos buffer)
@@ -750,7 +750,7 @@
(!line 949)(!if (!not posn)
(!do
(!line 950)(!massign (capt posn) ((!callmeth capt_elseif match s pos)))
-(!call assert posn)))
+(!line 951)(!call assert posn)))
(!line 953)(!assign (!index buffer (!len buffer)) "(!if ")
(!line 954)(!assign pos (!call skip_ws s posn))
(!line 955)(!assign pos (!call expr s pos buffer !true))
@@ -759,7 +759,7 @@
(!line 958)(!massign (capt posn) ((!callmeth capt_then match s pos)))
(!line 959)(!if (!not posn)
(!do
-(!call syntaxerror "then expected")))
+(!line 960)(!call syntaxerror "then expected")))
(!line 962)(!assign (!index buffer (!len buffer)) "(!do")
(!line 963)(!assign pos (!call skip_ws s posn))
(!line 964)(!return (!call block s pos buffer))))
@@ -783,7 +783,7 @@
(!line 984)(!massign (capt posn) ((!callmeth capt_end match s pos)))
(!line 985)(!if (!not posn)
(!do
-(!call syntaxerror "end expected")))
+(!line 986)(!call syntaxerror "end expected")))
(!line 988)(!loop i 1 n 1
(!define i i)
(!line 989)(!assign (!index buffer (!len buffer)) ")"))
@@ -791,12 +791,12 @@
(!line 995)(!define localfunc)(!assign localfunc (!lambda (s pos buffer)
(!line 996)(!define (capt posn) ((!callmeth capt_function match s pos)))
-(!call assert posn)
+(!line 997)(!call assert posn)
(!line 998)(!assign pos (!call skip_ws s posn))
(!line 999)(!massign (capt posn) ((!callmeth capt_identifier match s pos)))
(!line 1000)(!if (!not posn)
(!do
-(!call syntaxerror "<name> expected")))
+(!line 1001)(!call syntaxerror "<name> expected")))
(!line 1003)(!assign (!index buffer (!len buffer)) "(!line ")
(!line 1004)(!assign (!index buffer (!len buffer)) lineno)
(!line 1005)(!assign (!index buffer (!len buffer)) ")(!define ")
@@ -819,7 +819,7 @@
(!line 1025)(!massign (capt posn) ((!callmeth capt_identifier match s pos)))
(!line 1026)(!if (!not pos)
(!do
-(!call syntaxerror "<name> expected")))
+(!line 1027)(!call syntaxerror "<name> expected")))
(!line 1029)(!define ident capt)
(!line 1030)(!assign (!index buffer (!len buffer)) ident)
(!line 1031)(!assign pos (!call skip_ws s posn))
@@ -856,7 +856,7 @@
(!line 1065)(!define (exp posn) ((!callmeth capt_identifier match s pos)))
(!line 1066)(!if (!not posn)
(!do
-(!call syntaxerror "identifier expected")))
+(!line 1067)(!call syntaxerror "identifier expected")))
(!line 1069)(!assign pos (!call skip_ws s posn))
(!line 1070)(!assign posn (!callmeth tok_dot match s pos))
(!line 1071)(!while posn
@@ -880,7 +880,7 @@
(!line 1092)(!define funcstat)(!assign funcstat (!lambda (s pos buffer)
(!line 1094)(!define (capt posn) ((!callmeth capt_function match s pos)))
-(!call assert posn)
+(!line 1095)(!call assert posn)
(!line 1096)(!assign pos (!call skip_ws s posn))
(!line 1097)(!assign (!index buffer (!len buffer)) "(!line ")
(!line 1098)(!assign (!index buffer (!len buffer)) lineno)
@@ -894,115 +894,120 @@
(!line 1109)(!define exprstat)(!assign exprstat (!lambda (s pos buffer)
(!line 1111)(!define buf ())
-(!line 1112)(!assign pos (!call primaryexpr s pos buf))
-(!line 1113)(!assign (!index buffer (!len buffer)) (!call tconcat buf))
+(!line 1112)(!define lineno lineno)
+(!line 1113)(!assign pos (!call primaryexpr s pos buf))
(!line 1114)(!assign pos (!call skip_ws s pos))
(!line 1115)(!if (!or (!callmeth1 tok_comma match s pos) (!callmeth tok_equal match s pos))
(!do
-(!line 1116)(!return (!call assignment s pos buffer 1))))
-(!line 1118)(!return pos)))
-
-(!line 1122)(!define retstat)(!assign retstat (!lambda (s pos buffer)
-(!line 1124)(!assign (!index buffer (!len buffer)) "(!line ")
-(!line 1125)(!assign (!index buffer (!len buffer)) lineno)
-(!line 1126)(!assign (!index buffer (!len buffer)) ")(!return ")
-(!line 1127)(!if (!and (!not (!call block_follow s pos !true)) (!not (!callmeth tok_semicolon match s pos)))
-(!do
-(!line 1128)(!assign pos (!call explist s pos buffer))))
-(!line 1130)(!assign (!index buffer (!len buffer)) ")")
-(!line 1131)(!define (capt posn) ((!callmeth capt_semicolon match s pos)))
-(!line 1132)(!if posn
-(!do
-(!line 1133)(!return posn)))
-(!line 1135)(!return pos)))
-
-(!line 1139)(!assign statement (!lambda (s pos buffer)
-(!line 1141)(!assign pos (!call skip_ws s pos))
-(!line 1142)(!define (capt posn) ((!callmeth capt_semicolon match s pos)))
-(!line 1143)(!if posn
-(!do
-(!line 1144)(!return posn)))
-(!line 1147)(!if (!callmeth1 tok_if match s pos)
-(!do
-(!line 1148)(!return (!call ifstat s pos buffer))))
-(!line 1151)(!if (!callmeth1 tok_while match s pos)
-(!do
-(!line 1152)(!return (!call whilestat s pos buffer))))
-(!line 1155)(!massign (capt posn) ((!callmeth capt_do match s pos)))
-(!line 1156)(!if posn
-(!do
-(!line 1157)(!assign (!index buffer (!len buffer)) "(!line ")
-(!line 1158)(!assign (!index buffer (!len buffer)) lineno)
-(!line 1159)(!assign (!index buffer (!len buffer)) ")(!do")
-(!line 1160)(!assign pos (!call block s posn buffer))
-(!line 1161)(!massign (capt posn) ((!callmeth capt_end match s pos)))
+(!line 1116)(!assign (!index buffer (!len buffer)) (!call tconcat buf))
+(!line 1117)(!return (!call assignment s pos buffer 1)))(!do
+(!line 1119)(!assign (!index buffer (!len buffer)) "(!line ")
+(!line 1120)(!assign (!index buffer (!len buffer)) lineno)
+(!line 1121)(!assign (!index buffer (!len buffer)) ")")
+(!line 1122)(!assign (!index buffer (!len buffer)) (!call tconcat buf))))
+(!line 1124)(!return pos)))
+
+(!line 1128)(!define retstat)(!assign retstat (!lambda (s pos buffer)
+(!line 1130)(!assign (!index buffer (!len buffer)) "(!line ")
+(!line 1131)(!assign (!index buffer (!len buffer)) lineno)
+(!line 1132)(!assign (!index buffer (!len buffer)) ")(!return ")
+(!line 1133)(!if (!and (!not (!call block_follow s pos !true)) (!not (!callmeth tok_semicolon match s pos)))
+(!do
+(!line 1134)(!assign pos (!call explist s pos buffer))))
+(!line 1136)(!assign (!index buffer (!len buffer)) ")")
+(!line 1137)(!define (capt posn) ((!callmeth capt_semicolon match s pos)))
+(!line 1138)(!if posn
+(!do
+(!line 1139)(!return posn)))
+(!line 1141)(!return pos)))
+
+(!line 1145)(!assign statement (!lambda (s pos buffer)
+(!line 1147)(!assign pos (!call skip_ws s pos))
+(!line 1148)(!define (capt posn) ((!callmeth capt_semicolon match s pos)))
+(!line 1149)(!if posn
+(!do
+(!line 1150)(!return posn)))
+(!line 1153)(!if (!callmeth1 tok_if match s pos)
+(!do
+(!line 1154)(!return (!call ifstat s pos buffer))))
+(!line 1157)(!if (!callmeth1 tok_while match s pos)
+(!do
+(!line 1158)(!return (!call whilestat s pos buffer))))
+(!line 1161)(!massign (capt posn) ((!callmeth capt_do match s pos)))
(!line 1162)(!if posn
(!do
-(!line 1163)(!return posn))(!do
-(!call syntaxerror "'end' expected")))))
-(!line 1169)(!if (!callmeth1 tok_for match s pos)
+(!line 1163)(!assign (!index buffer (!len buffer)) "(!line ")
+(!line 1164)(!assign (!index buffer (!len buffer)) lineno)
+(!line 1165)(!assign (!index buffer (!len buffer)) ")(!do")
+(!line 1166)(!assign pos (!call block s posn buffer))
+(!line 1167)(!massign (capt posn) ((!callmeth capt_end match s pos)))
+(!line 1168)(!if posn
(!do
-(!line 1170)(!return (!call forstat s pos buffer))))
-(!line 1173)(!if (!callmeth1 tok_repeat match s pos)
+(!line 1169)(!return posn))(!do
+(!line 1171)(!call syntaxerror "'end' expected")))))
+(!line 1175)(!if (!callmeth1 tok_for match s pos)
(!do
-(!line 1174)(!return (!call repeatstat s pos buffer))))
-(!line 1177)(!if (!callmeth1 tok_function match s pos)
+(!line 1176)(!return (!call forstat s pos buffer))))
+(!line 1179)(!if (!callmeth1 tok_repeat match s pos)
(!do
-(!line 1178)(!return (!call funcstat s pos buffer))))
-(!line 1181)(!massign (capt posn) ((!callmeth capt_local match s pos)))
-(!line 1182)(!if posn
+(!line 1180)(!return (!call repeatstat s pos buffer))))
+(!line 1183)(!if (!callmeth1 tok_function match s pos)
(!do
-(!line 1183)(!assign pos (!call skip_ws s posn))
-(!line 1184)(!if (!callmeth1 tok_function match s pos)
+(!line 1184)(!return (!call funcstat s pos buffer))))
+(!line 1187)(!massign (capt posn) ((!callmeth capt_local match s pos)))
+(!line 1188)(!if posn
(!do
-(!line 1185)(!return (!call localfunc s pos buffer)))(!do
-(!line 1187)(!return (!call localstat s pos buffer))))))
-(!line 1191)(!massign (capt posn) ((!callmeth capt_dbcolon match s pos)))
-(!line 1192)(!if posn
+(!line 1189)(!assign pos (!call skip_ws s posn))
+(!line 1190)(!if (!callmeth1 tok_function match s pos)
(!do
-(!line 1193)(!assign pos (!call skip_ws s posn))
-(!line 1194)(!return (!call labelstat s pos buffer))))
-(!line 1197)(!massign (capt posn) ((!callmeth capt_return match s pos)))
+(!line 1191)(!return (!call localfunc s pos buffer)))(!do
+(!line 1193)(!return (!call localstat s pos buffer))))))
+(!line 1197)(!massign (capt posn) ((!callmeth capt_dbcolon match s pos)))
(!line 1198)(!if posn
(!do
(!line 1199)(!assign pos (!call skip_ws s posn))
-(!line 1200)(!return (!call retstat s pos buffer))))
-(!line 1203)(!if (!callmeth1 tok_break match s pos)
-(!do
-(!line 1204)(!return (!call breakstat s pos buffer))))
-(!line 1207)(!if (!callmeth1 tok_goto match s pos)
-(!do
-(!line 1208)(!return (!call gotostat s pos buffer))))
-(!line 1211)(!return (!call exprstat s pos buffer))))
-
-(!line 1215)(!define translate)(!assign translate (!lambda (s fname)
-(!line 1216)(!if (!callmeth1 bytecode match s)
-(!do
-(!line 1217)(!return s)))
-(!line 1219)(!define pos (!or (!callmeth (!call sequence bom position) match s 0) 0))
-(!line 1220)(!assign pos (!or (!callmeth (!call sequence shebang position) match s pos) pos))
-(!line 1221)(!assign lineno 1)
-(!line 1222)(!define buffer ("(!line " lineno " " (!call quoted fname) ")"))
-(!line 1223)(!assign pos (!call statlist s pos buffer))
-(!line 1224)(!if (!not (!callmeth eos match s pos))
-(!do
-(!call syntaxerror (!concat "<eof> expected at " pos))))
-(!line 1227)(!assign (!index buffer (!len buffer)) "\x0a; end of generation")
-(!line 1228)(!return (!call tconcat buffer))))
-
-(!line 1231)(!assign (!index !G "_COMPILER") translate)
-(!line 1233)(!define fname (!and arg (!index arg 1)))
-(!line 1234)(!if fname
-(!do
-(!line 1235)(!define (f msg) ((!call (!index (!index !G "tvm") "open") fname "r")))
-(!line 1236)(!if (!not f)
-(!do
-(!call error msg)))
-(!line 1239)(!define s (!callmeth f slurp ))
-(!callmeth f close )
-(!line 1241)(!define code (!call translate s fname))
-(!line 1242)(!assign code (!callmeth (!call gsub (!call sequence (!call literal "_G") (!call not_followed_by (!call literal "\""))) "!G") match code))
-(!line 1243)(!assign code (!callmeth (!call gsub (!call sequence (!call literal "_ENV") (!call not_followed_by (!call literal "\""))) "!ENV") match code))
-(!call print "; bootstrap")
-(!call print code)))
+(!line 1200)(!return (!call labelstat s pos buffer))))
+(!line 1203)(!massign (capt posn) ((!callmeth capt_return match s pos)))
+(!line 1204)(!if posn
+(!do
+(!line 1205)(!assign pos (!call skip_ws s posn))
+(!line 1206)(!return (!call retstat s pos buffer))))
+(!line 1209)(!if (!callmeth1 tok_break match s pos)
+(!do
+(!line 1210)(!return (!call breakstat s pos buffer))))
+(!line 1213)(!if (!callmeth1 tok_goto match s pos)
+(!do
+(!line 1214)(!return (!call gotostat s pos buffer))))
+(!line 1217)(!return (!call exprstat s pos buffer))))
+
+(!line 1221)(!define translate)(!assign translate (!lambda (s fname)
+(!line 1222)(!if (!callmeth1 bytecode match s)
+(!do
+(!line 1223)(!return s)))
+(!line 1225)(!define pos (!or (!callmeth (!call sequence bom position) match s 0) 0))
+(!line 1226)(!assign pos (!or (!callmeth (!call sequence shebang position) match s pos) pos))
+(!line 1227)(!assign lineno 1)
+(!line 1228)(!define buffer ("(!line " lineno " " (!call quoted fname) ")"))
+(!line 1229)(!assign pos (!call statlist s pos buffer))
+(!line 1230)(!if (!not (!callmeth eos match s pos))
+(!do
+(!line 1231)(!call syntaxerror (!concat "<eof> expected at " pos))))
+(!line 1233)(!assign (!index buffer (!len buffer)) "\x0a; end of generation")
+(!line 1234)(!return (!call tconcat buffer))))
+
+(!line 1237)(!assign (!index !G "_COMPILER") translate)
+(!line 1239)(!define fname (!and arg (!index arg 1)))
+(!line 1240)(!if fname
+(!do
+(!line 1241)(!define (f msg) ((!call (!index (!index !G "tvm") "open") fname "r")))
+(!line 1242)(!if (!not f)
+(!do
+(!line 1243)(!call error msg)))
+(!line 1245)(!define s (!callmeth f slurp ))
+(!line 1246)(!callmeth f close )
+(!line 1247)(!define code (!call translate s fname))
+(!line 1248)(!assign code (!callmeth (!call gsub (!call sequence (!call literal "_G") (!call not_followed_by (!call literal "\""))) "!G") match code))
+(!line 1249)(!assign code (!callmeth (!call gsub (!call sequence (!call literal "_ENV") (!call not_followed_by (!call literal "\""))) "!ENV") match code))
+(!line 1250)(!call print "; bootstrap")
+(!line 1251)(!call print code)))
; end of generation
Please sign in to comment.
Something went wrong with that request. Please try again.