aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.cpp
AgeCommit message (Collapse)Author
2019-01-30Move tokenizer error location to offending charMatthew McAllister
Previously, it pointed to the start of the current token, but this made it difficult to tell where the error occurred when it was, say, in the middle of a string.
2019-01-29simpler implementation of `&&` and `||` hintsAndrew Kelley
This accomplishes the same goal, but with less changes, so that I can backport copy elision stuff easier.
2019-01-25Hint at use of and/or when &&/|| is improperly used (#1886)kristopher tate
2018-11-17rename `section` keyword to `linksection`Andrew Kelley
add zig fmt support for this syntax closes #1152
2018-11-13New Zig formal grammar (#1685)Jimmi Holst Christensen
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-09-26Tweak SYMBOL_CHAR define in tokenizer.cppWink Saville
Make it a little clearer what a SYMBOL_CHAR is, use ALPHA instead of ALPHA_EXCEPT_C and case 'c', which is ALPHA's definition.
2018-09-13remove `this`. add `@This()`.Andrew Kelley
closes #1283
2018-07-18fix invalid character test on windowsAndrew Kelley
2018-06-28Correct hex-float parsingMarc Tiehuis
Unblocks #495.
2018-06-10breaking syntax change: orelse keyword instead of ?? (#1096)Andrew Kelley
use the `zig-fmt-optional-default` branch to have zig fmt automatically do the changes. closes #1023
2018-06-09breaking syntax change: ??x to x.? (#1095)Andrew Kelley
See #1023 This also renames Nullable/Maybe to Optional
2018-06-02introduce [*] for unknown length pointersAndrew Kelley
See #770 Currently it does not have any different behavior than `*` but it is now recommended to use `[*]` for unknown length pointers to be future-proof. Instead of [ * ] being separate tokens as the proposal suggested, this commit implements `[*]` as a single token.
2018-03-24add promise->T syntax parsingAndrew Kelley
closes #857
2018-02-19add async, await, suspend, resume, cancel keywordsAndrew Kelley
See #727
2018-02-14std.zig.parser understands try. zig fmt respects a double line break.Andrew Kelley
2018-02-02*WIP* error sets - correctly resolve inferred error setsAndrew Kelley
2018-01-23replace %defer with errdeferAndrew Kelley
See #632 now we have 1 less sigil
2018-01-22add new kind of test: generating .h files. and moreAndrew Kelley
* docgen supports obj_err code kind for demonstrating errors without explicit test cases * add documentation for `extern enum`. See #367 * remove coldcc keyword and add @setIsCold. See #661 * add compile errors for non-extern struct, enum, unions in function signatures * add .h file generation for extern struct, enum, unions
2018-01-09remove %% prefix operatorAndrew Kelley
See #632 closes #545 closes #510 this makes #651 higher priority
2018-01-07replace `a %% b` with `a catch b`Andrew Kelley
See #632 better fits the convention of using keywords for control flow
2018-01-07replace `%return` with `try`Andrew Kelley
See #632 better fits the convention of using keywords for control flow
2017-12-19wip bring back export keywordAndrew Kelley
2017-12-18wip export rewriteAndrew Kelley
2017-10-26Improve invalid character error messages (#566)Marc Tiehuis
See #544
2017-09-28fix build on mingwAndrew Kelley
2017-09-28Allow 128-bit hex float literalsMarc Tiehuis
Closes #499.
2017-09-13fix up msvc stuff to make it work on linux and macos tooAndrew Kelley
2017-09-11Add support for MSVCJonathan Marler
2017-08-29introduce align keywordAndrew Kelley
* remove `@setGlobalAlign` * add align keyword for setting alignment on functions and variables. * loads and stores use alignment from pointer * memcpy, memset use alignment from pointer * add syntax for pointer alignment * slices can have volatile * add u2, i2 primitives * ignore preferred align and use abi align everywhere * back to only having alignOf builtin. preferredAlignOf is too tricky to be useful. See #432. Partial revert of e726925e802eddab53cbfd9aacbc5eefe95c356f. See #37
2017-08-20compile-time f32, f64 operations are now correctly lossyAndrew Kelley
previously we used the bigfloat abstraction to do all compile-time float math. but runtime code and comptime code are supposed to get the same result. so now if you add a f32 to a f32 at compile time it does it with f32 math instead of the bigfloat. float literals still get the bigfloat math. closes #424
2017-08-09more intuitive left shift and right shift operatorsAndrew Kelley
Before: * << is left shift, not allowed to shift 1 bits out * <<% is left shift, allowed to shift 1 bits out * >> is right shift, allowed to shift 1 bits out After: * << is left shift, allowed to shift 1 bits out * >> is right shift, allowed to shift 1 bits out * @shlExact is left shift, not allowed to shift 1 bits out * @shrExact is right shift, not allowed to shift 1 bits out Closes #413
2017-08-07Correct floating-point literal allowed rangesMarc Tiehuis
The exponent range for floating-point values is [-1022, 1023]. Fixes #399.
2017-07-08better bigint/bigfloat implementationAndrew Kelley
2017-06-14progress toward windows hello world workingAndrew Kelley
2017-05-19change slicing syntax from ... to ..Andrew Kelley
See #359
2017-05-03remove test and try expressions in favor of if expressionsAndrew Kelley
See #357
2017-04-13typedefpocalypseAndrew Kelley
closes #314
2017-04-10fix some -Wconversion errorsAndrew Kelley
2017-03-26replace "&&" and "||" with "and" and "or"Andrew Kelley
closes #272
2017-03-26new unreachable syntaxAndrew Kelley
* `noreturn` is the primitive type. * `unreachable` is a control flow keyword. * `@unreachable()` builtin function is deleted. closes #214
2017-03-16introduce new test syntaxAndrew Kelley
* remove setFnTest builtin * add test "name" { ... } syntax * remove --check-unused argument. functions are always lazy now.
2017-02-12fix tokenization assertion failure on some float numbersAndrew Kelley
See #258
2017-02-03implement packed structsAndrew Kelley
closes #183
2017-02-02add try expressionAndrew Kelley
See #83
2017-01-22use comptime instead of inline for var and paramsAndrew Kelley
See #221
2017-01-16get rid of zeroes literalAndrew Kelley
closes #222
2016-09-28remove compiler directivesAndrew Kelley
* add `setFnTest`, `setFnVisible`, `setFnStaticEval`, `setFnNoInline` builtin functions to replace previous directive functionality * add `coldcc` and `nakedcc` as keywords which can be used as part of a function prototype. * `setDebugSafety` builtin can be used to set debug safety features at a per block scope level. * closes #169
2016-09-26add this keyword refers to thing in immediate scopeAndrew Kelley
See #169
2016-09-19use size_t for indexesAndrew Kelley
protect against incorrect copies in debug mode
2016-09-06build: add missing static in tokenizerAndrew Kelley