Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relatively small Unicode wins #290

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions examples/fizzbuzz.peggy
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ line
/ buzz

fizzbuzz = f:fizz _ b:buzz { return f + b }
fizz = @"fizz"i !{ return currentNumber % 3 }
buzz = @"buzz"i !{ return currentNumber % 5 }
\u0066izz 'fizz' = @"fizz"i !{ return currentNumber % 3 }
Copy link

@reverofevil reverofevil Jun 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(oh god not another language of this please)

image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I'd rather ban everything outside of [a-z_]i[a-z0-9_]i.

// That's U+1F41D: HONEYBEE
\u{62}uzz 'buzz' = @("buzz"i / "\u{1F41D}") !{ return currentNumber % 5 }

// Arbitrary requirement needing &
number "number without trailing comment"
= "0x" n:$[0-9a-f]i+ &"\n" { return parseInt(n, 16) }
/ n:$[0-9]+ &"\n" { return parseInt(n, 10) }

_ = $[ \t]*

extr𐳀 = "Test non-BMP identifiers"
Loading