Comments (4)
Hello, @SweetVishnya I am sorry, I've only seen your message now.
I was going to tell you that the project doesn't support it, but it was a simple thing to add so I just did it:
Now it should be easy to use hex numbers and also octal numbers, e.g.:
// Hex number:
calculator::calculate("0x1f").asInt()
// Octal number:
calculator::calculate("010").asInt()
from cparse.
I will close this issue, but feel free to reopen it if you find this solution doesn't solve your problem.
from cparse.
Hi!
I already implemented a shutting yard algorithm for my specific application. Also, your solution won't support uint64_t numbers.
from cparse.
Hello @SweetVishnya, my fault for taking so long to answer sorry 😅 , but regarding uint64_t yeah I wont support it by default since the idea is to have a simple generic parser, but you should be able to personalize it creating:
And then a new reserved word such as 10u
that would convert the previous token from an int into an unsigned int, or alternatively if you used it as a prefix u10
then you could actually parse the number as an unsigned int from the start, which would be better.
Even though if you have already implemented it its probably better for you to just use your own implementation =P
from cparse.
Related Issues (20)
- exception on simple calculatorexample
- Segmentation fault on bad inputs
- group/vector operation possible? Naive iteration can be expensive when number of elements is huge HOT 5
- terminating with uncaught exception of type syntax_error: Invalid operator: - HOT 4
- Token names cannot have UTF8 characters HOT 4
- Project doesn't install anything HOT 10
- Syntax errors cause crashes HOT 21
- calculator ignores variable HOT 3
- Consider adding a namespace to cparse code HOT 6
- Program treats "." in numeric "0.x" as an operator and throw an exception! HOT 5
- Thread Safety HOT 4
- Is not operator supported? HOT 1
- Warning c4099 is everywhere. HOT 3
- Invalid operators, but with ALL operators HOT 1
- It doesn't compile in Windows and Linux, am I doing something wrong? HOT 3
- Buffer-overflow (out-of-bounds read) occured in two positions HOT 1
- cparse/builtin-features/operators.inc HOT 9
- Solved. Errors with Linux emulator using GCC. HOT 22
- TokenMap value change to None,when using getChild() HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cparse.