comparison modules/parser.tp @ 262:9d93e65a34be

Fix whitespace problem in object grammar in new parser
author Michael Pavone <pavone@retrodev.com>
date Mon, 14 Jul 2014 09:29:49 -0700
parents 03a07e540b9f
children 27477c8c2823
comparison
equal deleted inserted replaced
261:074f885596ed 262:9d93e65a34be
17 memo:at:withId:length <- :val :at :id :len { 17 memo:at:withId:length <- :val :at :id :len {
18 _checkInitData: len 18 _checkInitData: len
19 (_posdata get: at) set: id val 19 (_posdata get: at) set: id val
20 self 20 self
21 } 21 }
22 22
23 getMemo:at:else <- :id :at :else { 23 getMemo:at:else <- :id :at :else {
24 if: (_posdata length) > at { 24 if: (_posdata length) > at {
25 (_posdata get: at) ifget: id :val { 25 (_posdata get: at) ifget: id :val {
26 val 26 val
27 } else: else 27 } else: else
84 isString? <- { true } 84 isString? <- { true }
85 isBasicString? <- { false } 85 isBasicString? <- { false }
86 base <- { _base } 86 base <- { _base }
87 start <- { _start } 87 start <- { _start }
88 memoData <- { _matchmemo } 88 memoData <- { _matchmemo }
89 89
90 memo:at:withId <- :val :at :id { 90 memo:at:withId <- :val :at :id {
91 _matchmemo memo: val at: (at + _start) withId: id length: (_base length) 91 _matchmemo memo: val at: (at + _start) withId: id length: (_base length)
92 self 92 self
93 } 93 }
94 94
95 getMemo:at:else <- :id :at :else { 95 getMemo:at:else <- :id :at :else {
96 _matchmemo getMemo: id at: (at + _start) else: else 96 _matchmemo getMemo: id at: (at + _start) else: else
97 } 97 }
98 } 98 }
99 } 99 }
575 withwhere addExpression: (quote: (ret <- if: matchres successLambda else: { 575 withwhere addExpression: (quote: (ret <- if: matchres successLambda else: {
576 matchres 576 matchres
577 })) 577 }))
578 withwhere addExpression: (quote: (tomatch memo: ret at: 0 withId: myid)) 578 withwhere addExpression: (quote: (tomatch memo: ret at: 0 withId: myid))
579 withwhere addExpression: (quote: ret) 579 withwhere addExpression: (quote: ret)
580 580
581 quote: :tomatch { 581 quote: :tomatch {
582 tomatch <- light: tomatch from: 0 582 tomatch <- light: tomatch from: 0
583 tomatch getMemo: myid at: 0 else: withwhere 583 tomatch getMemo: myid at: 0 else: withwhere
584 } 584 }
585 } else: { 585 } else: {
863 Expr <- match: expr 863 Expr <- match: expr
864 } yield: { 864 } yield: {
865 ast assign: Expr to: Symbol 865 ast assign: Expr to: Symbol
866 } 866 }
867 867
868 object <- match: "#{" . ws . Messages . "}" where: { 868 object <- match: "#{" . ws . Messages . ws . "}" where: {
869 Messages <- zeroPlus: (match: ws . El where: { 869 Messages <- zeroPlus: (match: ws . El where: {
870 El <- matchOne: [ 870 El <- matchOne: [
871 assignment 871 assignment
872 funcall 872 funcall
873 ] 873 ]