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

Syntax error on code comments #20928

Closed
devraymondsh opened this issue Aug 3, 2024 · 3 comments
Closed

Syntax error on code comments #20928

devraymondsh opened this issue Aug 3, 2024 · 3 comments
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@devraymondsh
Copy link

Zig Version

0.14.0-dev.839+a931bfada

Steps to Reproduce and Observed Behavior

Here's the code for x.zig:

/// Comments
/// Comments
/// Comments
/// Comments
pub const file_index_alloc: c_uint = ~@as(c_uint, 0);

/// IOSQE_BUFFER_SELECT
///			Comments
///			Comments
///			Comments
pub const cqe_buffer_shift = 16;

/// skip updating fd indexes set to this value in the fd table
pub const register_files_skip: c_int = -2;

And y.zig:

/// Comments
/// Comments
pub const Mask = packed struct {
    --snip--
    /// blocks
    blocks: bool = false,
}

Here's the error:

test
└─ install start_start1-void_tests
   └─ zig build-exe start_start1-void_tests Debug native 2 errors
x.zig:13:24: error: expected type expression, found 'invalid token'
/// IOSQE_BUFFER_SELECT
                       ^
y.zig:46:26: error: expected type expression, found 'invalid token'
    blocks: bool = false,
                         ^
error: the following command failed with 2 compilation errors:
/home/raymond/.zvm/master/zig build-exe -ODebug --dep vortex -Mroot=/home/raymond/projects/x/tests/start/start1-void.zig -Mvortex=/home/raymond/projects/x/src/root.zig --cache-dir /home/raymond/projects/x/.zig-cache --global-cache-dir /home/raymond/.cache/zig --name start_start1-void_tests --zig-lib-dir /home/raymond/.zvm/master/lib/ --listen=-

Expected Behavior

Should have compiled it.

@devraymondsh devraymondsh added the bug Observed behavior contradicts documented or intended behavior label Aug 3, 2024
@devraymondsh
Copy link
Author

I tried compiling using the stable 0.13.0 and things just worked perfectly. There should be a bug in recent commits. I tried deleting both local and global caches but it didn't work either.

@alexrp
Copy link
Member

alexrp commented Aug 3, 2024

Don't use tabs.

@Vexu
Copy link
Member

Vexu commented Aug 3, 2024

You can't have tabs in comments, see #20900 for improving the error.

@Vexu Vexu closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2024
chrboesch pushed a commit to ziglings-org/exercises that referenced this issue Aug 4, 2024
chrboesch pushed a commit to ziglings-org/exercises that referenced this issue Aug 4, 2024
s-0-a-r added a commit to s-0-a-r/ziglings-exercises that referenced this issue Feb 22, 2025
* Fix zig_exe location in Build struct

Reflect Zig breaking changes as of ziglang/zig@105db13

* Text improvement

closes #47

* Zig version adjusted.

* Added notes to exercise 94 c_math.

* Added threading exercise

* Fixed unicode literal

* Minor corrections to the "contributing"

* fix exercise 82 output

zig commit bd24e66 changed the floating point formatting implementation so output for exercise 82 no longer matched

* Improved the explanation about passing arguments and added an example.

* Changes for a new Zig version.

* Fixed the renaming of std.os to std.posix

* Added second threading exercise.

* Update exercises/105_threading2.zig

Fixed typo.

* Update .woodpecker/eowyn.yml

fix warning

* Update .woodpecker/eowyn.yml

* Update .woodpecker/eowyn.yml

* added exercise/106_files.zig

* modified build.zig

* 106_files.zig format

* add patch files for 106_files.zig

* 106_files.zig actual test

* 106_files.patches actual

* remove header of patch files of 106

* specify directory on patch file 106

* specify directory on patch file 106

* Pass CI test locally

* 106 & 107

* added format parameter {d}

* fix typo

* Fix breaking zig change to @fieldParentPtr parameters

See ziglang/zig#19470

* Zig version changed

* Update README.md

* Greater gradation of timers built into the threads

* Additional timer in thread start added

* Update .woodpecker/eowyn.yml

* Fixed woodpecker warnings

* fixing little typo on exercise 107_files2.zig

* Switch to new zig dev release 0.13

* Update .woodpecker/eowyn.yaml

Add tag "latest"

* Update .woodpecker/eowyn.yaml

Add pull command

* fix: typo: % instead of @ for a builtin function

* fix: typo: removed extra s

* fix: many grammatical errors

* fix: some grammatical errors

* Fix patches for 106 and 107

* Fix some typos

* Add devcontainer.json

* Nobody wants the long version of finding out if a variable is set.
So switched to the short version with 'orelse'. ;)

* Update exercises/105_threading2.zig

The last word, '"diggits" was misspelled.

* the Earth

* Verbs agree with the head of the noun phrase, not the closest noun

the result...are passed→the result...is passed
the number...vary→the number...varies

* Fixed the changes from reworking std.Progress.
For details: ziglang/zig#20059

* Ignore .zig-cache for new zig versions

zig cache directory was updated in ziglang/zig#20115

* New Zig version

* fixed typo

* English fixes for 107_files2.zig

* English fixes for 106_files.zig

* Calling `split` is deprecated

The `split` function in std mem is depreacted and a `@compileError`, splitSequence,
splitAny, or splitScalar should be used instead.

* Fixes because of a new Zig version, which changes some functions.

* 046: Show usage of `.?` and hint towards new solution.

* Add patch.

* attempt at implementing #113 "Add a way to do one random exercise"

* Rename 'std.rand' to 'std.Random'

* Update .woodpecker/eowyn.yaml

Add pull request

* document -Drandom

* fix build files broken by latest 0.14.0-dev changes to Build.Step.MakeOptions

* fix tests build file broken by addRemoveDirTree now requiring LazyPath

* Fixed error message through a TAB in the comment, see ziglang/zig#20928

* Changed needed zig version.

* Add build parameter to start at a specific exercise

* Clarification in description for ranges in loops.

* Simplified de-referencing for clarification

* Added license to contributing

* Fixes changes in zig build system.

* Insert wrong version number into build file.

* Fixes several changes in std.builtin.zig

* fixed typo: the date in version changes

* Reseted the simplification for de-referencing.

* Update LICENSE

* Corrects the description of the new @typeinfo().@"struct".fields

* New patch file for 82

* Update README.md

Added new todo for core lang

* 108: Add a exercise for a labeled switch

* Add .patch for 108_labeled_switch

* update zig version in build and readme

* update labeled switch to also have a break statement

* downgrade zig version to eowyn version

It is just 2 days behind so all features are already present for the new labeled switch test

* improve explanantions in labeled switch

* update108 .patch due to line change

* Minor improvements.

* Added Dave as initiator of Ziglings.

* Deleted .devcontainer because ist was a test.

* Rephrase instruction for clarity

* Fixed patch from quiz7 after text changes
 #Please enter the commit message for your changes. Lines starting

* reuse fields

* zero

* patch

* Improved maximumNarcissism

* created a new exercise about vectors in zig, gave it number 109

* removed commented solution lines in vectors exercise, added ??? into lines instead

* added patch file for 109_vectors

* line ending format patch attempt

* Fixed formating, created patch file.

* Added SIMD.

* Fixed link to format source code.

* Added missing space after a sentence.

* Minor case-related changes.

* Deleted unnecessary pointer.

* Added patch file.

* Updated credits

* Updated credits

* Update: 108 Labeled switch example to contain default case for exhaustion

Update example text to give clarity on default/exhaustive case.

Reasoning:
The input for the example will not compile if user would want to test this for the logic of a labeled switch. Due the input not being an exhaustive input but rather "any u8 integer" (for the lack of better terminology) we need to use the else branch to indicate that the default case is handled, in this case by just emulating the '4' branch, but this could return an error.InvalidCaseProvided for example.

Signed-off-by: mikkurogue <[email protected]>

* Fix typo vaild → valid

* Update: Remove the 4th branch in favour of just making that the else branch

Probably easier to not have an "unused" branch that returns the same as the else branch in the example.

Signed-off-by: mikkurogue <[email protected]>

* Use print alias in exercise 100_for4.zig

* Fix patch after print alias fix in 100_fo4.zig

* Fix a typo: we need do we need to -> we need to

Morning delirium does not help when looking at lots of words

* Update exercises/108_labeled_switch.zig

The sentence was slightly unclear

Signed-off-by: chrboesch <[email protected]>

* Update exercises/108_labeled_switch.zig

Fixed an error in the debug statement and made the text a bit more coherent.

Signed-off-by: chrboesch <[email protected]>

* Suggesting a third exercise for bit manipulation

* changed the order of the sections to improve flow

* rearranged order of expected output in build.zig

* added newline between toggle and set sections to
make the expected output match

* reset and completed exercise tracking wired in

* fmt

* tracking, skipping and reset all wired in

* cleanup for PR

* cleanup for PR

* cleanup for PR

* cleanup for PR

* format fix

* added patch file for exercise 110

* Skip 74, the compiler corrects this now.

* Added deletion of progress.txt for eowyn

* Added delte_progress additional to the end of eowyn

* Fix repo link

* converted 110 to a quiz (quiz 9)

* moved explanatory content below the broken code in
main so that the exercise functions more like a quiz

* made some simple changes to the wording to reflect
the fact that this is a quiz

* edited the first two paragraphs

* added blank lines between sections to make them
easier to find

* added header for quiz problems

* fixed incorrect bitmask in xor example

* fixed minor spelling and grammar typos

* fixed formatting

* fixed spelling of 'bitmask'

* Shuttle weight fixed

* Output from #60 adapted

* fix: exercises/001_hello.zig (#1)

* fix: exercises/002_std.zig (#2)

* Exercises/003 assignment (#3)

* fix: exercises/003_assignment.zig

- assign new constant

* fix: exercises/003_assignment.zig

- change type of pi to u32

* fix: exercises/003_assignment.zig

- change type of negative_eleven to i8

* doc: add HOWTO_REBASE_ORIGINAL_REPO.md (#4)

---------

Signed-off-by: mikkurogue <[email protected]>
Signed-off-by: mikkurogue <[email protected]>
Signed-off-by: chrboesch <[email protected]>
Co-authored-by: Alexander Saltanov <[email protected]>
Co-authored-by: Chris Boesch <[email protected]>
Co-authored-by: dolichomps <[email protected]>
Co-authored-by: Dizzyi <[email protected]>
Co-authored-by: kamidev <[email protected]>
Co-authored-by: susubub <[email protected]>
Co-authored-by: David Hain <[email protected]>
Co-authored-by: Rafael Áquila <[email protected]>
Co-authored-by: rpm0372 <[email protected]>
Co-authored-by: Roman Frołow <[email protected]>
Co-authored-by: hippietrail <[email protected]>
Co-authored-by: Nico Elbers <[email protected]>
Co-authored-by: Andrew Dunbar <[email protected]>
Co-authored-by: Sebastian <[email protected]>
Co-authored-by: Alex McHugh <[email protected]>
Co-authored-by: bsubei <[email protected]>
Co-authored-by: Michael Cooper <[email protected]>
Co-authored-by: Seeingu <[email protected]>
Co-authored-by: Nuno Mendes <[email protected]>
Co-authored-by: factormystic <[email protected]>
Co-authored-by: bgthompson <[email protected]>
Co-authored-by: innerviewer <[email protected]>
Co-authored-by: innerviewer <[email protected]>
Co-authored-by: mikkurogue <[email protected]>
Co-authored-by: David Pape <[email protected]>
Co-authored-by: mikkurogue <[email protected]>
Co-authored-by: Zorgatone <[email protected]>
Co-authored-by: Alexander Sisco <[email protected]>
Co-authored-by: Zendril <[email protected]>
Co-authored-by: Alexander Sisco <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

3 participants