Skip to content
New issue

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

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

Already on GitHub? # to your account

Formatting 0xffff_ffc0 (Hex number with _ spacer errors with --verify #889

Open
Quenty opened this issue Aug 28, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Quenty
Copy link

Quenty commented Aug 28, 2024

Formatting a hex number with an _ spacer creates an error when running --verify --color Always

local nextMultipleOf64 = bit32.band(leftover + 32, 0xffff_ffc0)

Edit: Looks like may any hex number causes the failure

Reproduction

See this file for repro: https://github.com/Dekkonot/luau-hashing/blob/main/modules/sha256/init.luau

stylua --verify ./sha256/init.luau

Error:

   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: <stylua_lib::verify_ast::AstVerifier as full_moon::visitors::VisitorMut>::visit_number
   4: <full_moon::tokenizer::Token as full_moon::visitors::VisitMut>::visit_mut
   5: <full_moon::tokenizer::TokenReference as full_moon::visitors::VisitMut>::visit_mut
   6: full_moon::ast::visitors::<impl full_moon::visitors::VisitMut for full_moon::ast::Expression>::visit_mut
   7: full_moon::ast::visitors::<impl full_moon::visitors::VisitMut for full_moon::ast::Field>::visit_mut
   8: <full_moon::ast::punctuated::Pair<T> as full_moon::visitors::VisitMut>::visit_mut
   9: <alloc::vec::Vec<T> as full_moon::visitors::VisitMut>::visit_mut
  10: <full_moon::ast::TableConstructor as full_moon::visitors::VisitMut>::visit_mut
  11: full_moon::ast::visitors::<impl full_moon::visitors::VisitMut for full_moon::ast::Expression>::visit_mut
  12: <full_moon::ast::punctuated::Pair<T> as full_moon::visitors::VisitMut>::visit_mut
  13: <alloc::vec::Vec<T> as full_moon::visitors::VisitMut>::visit_mut
  14: <(A,B) as full_moon::visitors::VisitMut>::visit_mut
  15: <alloc::vec::Vec<T> as full_moon::visitors::VisitMut>::visit_mut
  16: <full_moon::ast::Block as full_moon::visitors::VisitMut>::visit_mut
  17: full_moon::visitors::VisitorMut::visit_ast
  18: stylua_lib::verify_ast::AstVerifier::compare
  19: stylua_lib::format_ast
  20: stylua_lib::format_code
  21: <F as threadpool::FnBox>::call_box
@Quenty Quenty changed the title Formatting 0xffff_ffc0 (Hex number with _ spacer errors. Formatting 0xffff_ffc0 (Hex number with _ spacer errors with --verify Aug 28, 2024
@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Sep 11, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants