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

Discuss binary fontification #1

Open
yurrriq opened this issue Dec 13, 2016 · 1 comment
Open

Discuss binary fontification #1

yurrriq opened this issue Dec 13, 2016 · 1 comment

Comments

@yurrriq
Copy link
Contributor

yurrriq commented Dec 13, 2016

alpaca/test_files/basic_binary.alp:

module basic_binary

export count_one_twos/1,first_three_bits/1, utf8_bins/1, drop_hello/1

count_one_twos bin =
  match bin with
      <<1: size=8, 2: size=8, rest: type=binary>> -> 1 + (count_one_twos rest)
    | _ -> 0

first_three_bits bin =
  match bin with
      <<x: size=1 unit=3 type=int, y: type=binary size=1 unit=5>> -> x
    | _ -> 0

utf8_bins () =
  <<"안녕": type=utf8>>

drop_hello bin =
  match bin with
    <<"hello": type=utf8, rest: type=utf8>> -> rest
@yurrriq yurrriq changed the title Discussion binary font locking Discuss binary font locking Dec 13, 2016
@yurrriq
Copy link
Contributor Author

yurrriq commented Dec 13, 2016

@yurrriq yurrriq changed the title Discuss binary font locking Discuss binary fontification Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant