Comments (3)
Indeed! The grammar doesn't take into consideration signed numbers (how silly!).
I don't have a lot of bandwidth right now to work on this - it's an easy fix, but requires adding tests (such as your example that doesn't work).
The key fix is changing the lines at
GIFT-grammar-PEG.js/GIFT.pegjs
Lines 294 to 301 in 0cb5735
with
Number
= value:DecimalValue { return parseFloat(value.join('')); }
DecimalValue
= IntegerPart ('.' FractionalPart)?
IntegerPart
= Sign? Digits
FractionalPart
= Digits
Sign
= [+-]
Digits
= [0-9]+
from gift-grammar-peg.js.
I created a PR for this issue.
from gift-grammar-peg.js.
Thanks @Sho-ki for your PR
from gift-grammar-peg.js.
Related Issues (20)
- some parse problems
- some parse problems HOT 3
- How can I parse cyrillic symbols correctly (for ukrainian and russian languages)? HOT 2
- Matching Questions HOT 5
- Error handling HOT 1
- Categories can have special characters, not parsing properly
- New line handling and delimiting HOT 19
- Transforming JSON to GIFT
- Support parsing tags (in comments) HOT 5
- Mixed case True and False are not valid in Moodle
- Including Typescript types in package.json
- Switching to Peggy HOT 2
- Validate acceptable weights for multiple-choice answers HOT 1
- This question is shown as error but its correct (unescaped : and = in question stem) HOT 4
- Trouble with explicit newlines, using `\n` HOT 1
- Bracket characters are not escaped when output from Moodle in GIFT
- Consider not removing additional spaces and new lines in also in Markdown like HTML HOT 4
- Ambiguity and misalignment of feedback on True - False questions HOT 1
- Spaces and lines are removed from html/markdown when format is inferred HOT 3
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 gift-grammar-peg.js.