Skip to content

Commit 81c8634

Browse files
author
Pascal "Pixel" Rigaux
committed
1 parent c939309 commit 81c8634

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Perl5Parser/Expr.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ fmap_maybe _ Nothing = return Nothing
6565
fmap_maybe f (Just e) = fmap Just (f e)
6666

6767
op = toList . operator_node
68-
operator' s = if isWordAny (last s) then symbol_node s else try $ operator_node s
68+
operator' s = if s == "x" then fmap Tokens (pcons (fmap Symbol (string s)) spaces_comments)
69+
else if isWordAny (last s) then symbol_node s else try $ operator_node s
6970
operator_to_parser (i, prio, op) = fmap (\s -> (i, prio, (s,op))) (operator' op)
7071

7172
data ZZ = ZZ { z_op :: NodeName

test.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ ok_exprs = [
147147
, ("return ($v)[$w]", "return (($v)[$w])")
148148
, ("return <F>", "return <F>")
149149
, ("foo.bar", "foo.bar")
150+
, ("0 x2", "0 x2")
150151
-- complex ?: calls
151152
, ("($v ? N() . '; ' . N() . ': ' . $w : N())", "($v ? ((((N() ). '; ' ). ((N() ). ': ' )). $w ): (N()))")
152153
, ("$a = 0 || !1 ? 2 : 3", "$a = ((0 || (!1 ))? 2 : 3)")

0 commit comments

Comments
 (0)