Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of git@github.com:rakudo/rakudo
  • Loading branch information
jnthn committed Apr 4, 2009
2 parents f17a691 + 4698d3f commit 64a8988
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/spectest-progress.csv
Expand Up @@ -316,3 +316,4 @@
"2009-04-01 00:00",78cb4c3,8049,0,342,1819,10210,15518,340
"2009-04-02 00:00",64e33af,8049,0,342,1819,10210,15518,340
"2009-04-03 00:00",913094f,8081,0,342,1816,10239,15534,344
"2009-04-04 00:00",68ea385,8406,0,342,1964,10712,15534,347
6 changes: 5 additions & 1 deletion src/parser/grammar.pg
Expand Up @@ -94,7 +94,11 @@ token nofun { <!before '(' | '.(' | '\\' > }
token unv {
|| \h+
|| ^^ <.pod_comment>
|| '#' \N*
|| ^^ '#' <?opener> <.panic: "Can't use embedded columns in column 1">
|| '#' [
| <?opener> <quote_expression: >
| \N*
]
}

## The <afterws> rule returns true if we're immediate after
Expand Down
30 changes: 29 additions & 1 deletion src/parser/quote_expression.pir
Expand Up @@ -5,11 +5,39 @@

.namespace ['Perl6';'Grammar']

.sub '' :anon :load :init
.local pmc brackets
brackets = box unicode:"<>[](){}\xab\xbb\u0f3a\u0f3b\u0f3c\u0f3d\u169b\u169c\u2045\u2046\u207d\u207e\u208d\u208e\u2329\u232a\u2768\u2769\u276a\u276b\u276c\u276d\u276e\u276f\u2770\u2771\u2772\u2773\u2774\u2775\u27c5\u27c6\u27e6\u27e7\u27e8\u27e9\u27ea\u27eb\u2983\u2984\u2985\u2986\u2987\u2988\u2989\u298a\u298b\u298c\u298d\u298e\u298f\u2990\u2991\u2992\u2993\u2994\u2995\u2996\u2997\u2998\u29d8\u29d9\u29da\u29db\u29fc\u29fd\u3008\u3009\u300a\u300b\u300c\u300d\u300e\u300f\u3010\u3011\u3014\u3015\u3016\u3017\u3018\u3019\u301a\u301b\u301d\u301e\ufd3e\ufd3f\ufe17\ufe18\ufe35\ufe36\ufe37\ufe38\ufe39\ufe3a\ufe3b\ufe3c\ufe3d\ufe3e\ufe3f\ufe40\ufe41\ufe42\ufe43\ufe44\ufe47\ufe48\ufe59\ufe5a\ufe5b\ufe5c\ufe5d\ufe5e\uff08\uff09\uff3b\uff3d\uff5b\uff5d\uff5f\uff60\uff62\uff63"
set_global '$!brackets', brackets
.end

.sub 'opener' :method
.local string brackets
$P0 = get_global '$!brackets'
brackets = $P0

.local pmc mob
.local string target
.local int pos
(mob, pos, target) = self.'new'(self)
$S0 = substr target, pos, 1
$I0 = index brackets, $S0
if $I0 < 0 goto fail
$I0 = $I0 % 2
if $I0 goto fail
inc pos
mob.'to'(pos)
fail:
.return (mob)
.end

.sub 'peek_brackets' :method
.param string target
.param int pos
.local string brackets, start, stop
brackets = unicode:"<>[](){}\xab\xbb\u0f3a\u0f3b\u0f3c\u0f3d\u169b\u169c\u2045\u2046\u207d\u207e\u208d\u208e\u2329\u232a\u2768\u2769\u276a\u276b\u276c\u276d\u276e\u276f\u2770\u2771\u2772\u2773\u2774\u2775\u27c5\u27c6\u27e6\u27e7\u27e8\u27e9\u27ea\u27eb\u2983\u2984\u2985\u2986\u2987\u2988\u2989\u298a\u298b\u298c\u298d\u298e\u298f\u2990\u2991\u2992\u2993\u2994\u2995\u2996\u2997\u2998\u29d8\u29d9\u29da\u29db\u29fc\u29fd\u3008\u3009\u300a\u300b\u300c\u300d\u300e\u300f\u3010\u3011\u3014\u3015\u3016\u3017\u3018\u3019\u301a\u301b\u301d\u301e\ufd3e\ufd3f\ufe17\ufe18\ufe35\ufe36\ufe37\ufe38\ufe39\ufe3a\ufe3b\ufe3c\ufe3d\ufe3e\ufe3f\ufe40\ufe41\ufe42\ufe43\ufe44\ufe47\ufe48\ufe59\ufe5a\ufe5b\ufe5c\ufe5d\ufe5e\uff08\uff09\uff3b\uff3d\uff5b\uff5d\uff5f\uff60\uff62\uff63"

$P0 = get_global '$!brackets'
brackets = $P0

start = substr target, pos, 1
if start == ':' goto err_colon_delim
Expand Down
4 changes: 2 additions & 2 deletions t/01-sanity/09-types.t
Expand Up @@ -26,5 +26,5 @@ sub typeof(::T $x) { return T }
# Stuff that goes crashy-crashy right now
#$num = 0;
#my Array of Int $intarray;
#($num == $int) && say 'ok 2';
#($str == $num) && say 'ok 3';
# ($num == $int) && say 'ok 2';
# ($str == $num) && say 'ok 3';
3 changes: 3 additions & 0 deletions t/spectest.data
Expand Up @@ -77,6 +77,7 @@ S02-names_and_variables/fmt.t
S02-names_and_variables/varnames.t
S02-one-pass-parsing/less-than.t
S02-polymorphic_types/subset.t
S02-whitespace_and_comments/comments.t
S02-whitespace_and_comments/minimal-whitespace.t
S02-whitespace_and_comments/one-pass-parsing.t
S02-whitespace_and_comments/pod-in-multi-line-exprs.t
Expand Down Expand Up @@ -164,6 +165,7 @@ S05-grammar/inheritance.t
S05-grammar/namespace.t
S05-grammar/parse_and_parsefile.t
S05-grammar/ws.t
S05-mass/named-chars.t # icu
S05-mass/rx.t
S05-mass/recursive.t
S05-mass/stdrules.t
Expand Down Expand Up @@ -258,6 +260,7 @@ S12-enums/basic.t
S12-introspection/can.t
S12-methods/calling_sets.t
S12-methods/calling_syntax.t
S12-methods/class-and-instance.t
S12-methods/default-trait.t
S12-methods/indirect_notation.t
S12-methods/instance.t
Expand Down

0 comments on commit 64a8988

Please sign in to comment.