aboutsummaryrefslogtreecommitdiffhomepage
path: root/cgo/const_test.go
AgeCommit message (Collapse)Author
2024-11-18cgo: support function-like macrosAyke van Laethem
This is needed for code like this: #define __WASI_ERRNO_INVAL (UINT16_C(28)) #define EINVAL __WASI_ERRNO_INVAL
2024-11-18cgo: define idents referenced only from macrosAyke van Laethem
2024-06-07cgo: implement shift operations in preprocessor macrosAyke van Laethem
2023-01-12cgo: add support for bitwise operatorsAyke van Laethem
2021-05-21cgo: implement prefix parsingAyke van Laethem
This implements expressions such as "-5" and "-5 - 2", in other words, negative numbers.
2021-05-21cgo: parse binary operatorsAyke van Laethem
This follows the Pratt parser design.
2021-05-21cgo: create skeleton of a Pratt parserAyke van Laethem
This converts the existing const parser to the basics of a Pratt parser, following the book "Writing An Interpreter In Go" by Thorsten Ball. It doesn't really do anything interesting yet, it simply converts the existing code (with existing tests) to the new structure.
2020-01-03cgo: fix a bug in number tokenizationAyke van Laethem
2020-01-03cgo: add support for symbolsAyke van Laethem
2019-11-05cgo: implement the constant parser as a real parserAyke van Laethem
Previously it was just a combination of heuristics to try to fit a constant in an *ast.BasicLit. For more complex expressions, this is not enough. This change also introduces proper syntax error with locations, if parsing a constant failed. For example, this will print a real error message with source location: #define FOO 5)
2019-11-05cgo: refactor constant expressionsAyke van Laethem
Put them in a separate file for separation of concerns (making them testable) and add some tests.