Skip to content

feat(parser): add integer, dimen, glue group parsers#2139

Draft
ylemkimon wants to merge 32 commits intomainfrom
scan
Draft

feat(parser): add integer, dimen, glue group parsers#2139
ylemkimon wants to merge 32 commits intomainfrom
scan

Conversation

@ylemkimon
Copy link
Member

@ylemkimon ylemkimon commented Oct 27, 2019

Size argument
Primitive commands, such as \above and kern commands don't not allow braced size argument. This PR introduces a new argument type size_primitive to parse it. For backward compatibility, braced size arguments are allowed in non-strict mode. (BREAKING CHANGE) Fixes #1936.

Furthermore, a blank size argument was allowed for most commands. This PR introduces a new argument type size_or_blank, which allows a blank argument, and use it only for \genfrac.[2]

ylemkimon added a commit that referenced this pull request Oct 28, 2019
@k4b7
Copy link
Member

k4b7 commented Feb 21, 2020

@ylemkimon the tests are passing now. Is there more that you wanted to do with this PR or is it ready for review now?

@codecov-commenter
Copy link

codecov-commenter commented Jul 11, 2020

Codecov Report

Merging #2139 into master will decrease coverage by 2.01%.
The diff coverage is 56.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2139      +/-   ##
==========================================
- Coverage   93.81%   91.80%   -2.02%     
==========================================
  Files          84       85       +1     
  Lines        6128     6366     +238     
  Branches     1260     1349      +89     
==========================================
+ Hits         5749     5844      +95     
- Misses        348      467     +119     
- Partials       31       55      +24     
Impacted Files Coverage Δ
contrib/render-a11y-string/render-a11y-string.js 84.02% <0.00%> (-1.01%) ⬇️
src/functions.js 100.00% <ø> (ø)
src/parseNode.js 73.33% <ø> (ø)
src/functions/arithmetic.js 7.46% <7.46%> (ø)
src/units.js 86.66% <62.50%> (-8.99%) ⬇️
src/functions/def.js 97.50% <66.66%> (-1.21%) ⬇️
src/Parser.js 83.50% <67.28%> (-12.76%) ⬇️
src/MacroExpander.js 97.84% <100.00%> (+0.02%) ⬆️
src/environments/array.js 97.96% <100.00%> (ø)
src/functions/char.js 100.00% <100.00%> (+8.33%) ⬆️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e61fb6f...80b65f4. Read the comment docs.

@ylemkimon ylemkimon changed the title Add integer, dimen, glue group parsers feat(parser): add integer, dimen, glue group parsers Jul 17, 2020
@ylemkimon

This comment has been minimized.

@KaTeX KaTeX deleted a comment from codecov-io Jul 29, 2020
ylemkimon added a commit that referenced this pull request Sep 6, 2020
* Improve macro argument parsing

* Make \above a primitive command

* Fix screenshotter data

* Normalize argument where necessary

* Improve argument location info

* Update comments

* Minor refactor

* Modularize group parsers

* Allow braced and blank size argument

for non-strict mode and \genfrac, respectively.

* Minor refactor & update comments

* Remove raw option in parseStringGroup

* Update tests

* Fix { delimited parameter

* Update tests

* Update tests

* Normalize argument in \genfrac

* Update tests

* Consume space before scanning an optional argument

* Fix \\, \newline, and \cr behavior

* Fix flow error

* Update comments

* Remove unnecessary mode switching

Parser mode affects neither fetch nor consume.

* Allow single (active) character macro

* Add function property `primitive`

* Set \mathchoice and \*style primitive

* Separate size-related improvements out to #2139

* Fix flow error

* Update screenshots

* Update demo example

* Add a migration guide

* Fix capitalization

* Make a primitive function unexpandable

* Update screenshots

* Update screenshots

* Revert "Document \def doesn't support delimiters (#2288) (#2289)"

This reverts commit f96fba6.

* Update comments, errors, and tests

* Update screenshots
@ylemkimon ylemkimon mentioned this pull request Oct 31, 2021
3 tasks
@edemaine edemaine force-pushed the main branch 8 times, most recently from 9a985be to 0ef8921 Compare January 25, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kern commands accept braced size argument

3 participants