-
Notifications
You must be signed in to change notification settings - Fork 1
enhance minifier #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Rudxain
wants to merge
79
commits into
baris-inandi:main
Choose a base branch
from
Rudxain:pr-min
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
e03a643
Update minify.go
Rudxain e2ff7ab
Update minify.go
Rudxain 54d301d
Update minify.go
Rudxain 7c37afc
Update minify.go
Rudxain 833e53b
Add validator
Rudxain 25be574
remove my useless comment
Rudxain b5a56d7
I realized that infinite loops exist lol
Rudxain cbc9524
remove validator (for now)
Rudxain 2a7b588
Merge branch 'baris-inandi:main' into pr-min
Rudxain d43d95a
Update minify.go
Rudxain 50edc00
Update minify.go
Rudxain 843a102
Update minify.go
Rudxain e23145f
Update minify.go
Rudxain 7995a68
`:=` -> `var`
Rudxain 238eeb8
fmt, rename func
Rudxain 0d6eb3a
comment on panic
Rudxain 2f8657b
remove useless `ReplaceAll`
Rudxain afa390e
bring back `ReplaceAll`
Rudxain f628c3b
comment-out static simulator
Rudxain 7d0c173
mutual-cancel opt
Rudxain 2845152
comment-out `indexNoBrace`
Rudxain 77a6a83
declare `size`, no assign
Rudxain c7a2837
using regexp instead of strings
Rudxain 8c2ec28
reset opt
Rudxain d35bd0f
fix odd regex bug
Rudxain 5d197b7
merge +- regexes
Rudxain c17f425
opt compression ratio
Rudxain a3f49c9
smarter compression
Rudxain f5231d2
comment about compressor optimizer
Rudxain c48c3dd
idiomatic Go
Rudxain 0c1ae91
concise and objective comment
Rudxain a77c752
remove special-casing. concise comments
Rudxain c800e30
"modularize" CRO
Rudxain 4672513
simulator
Rudxain 0e5892e
more idiomatic
Rudxain 9700cf7
subjective FP comment
Rudxain 493cff7
comment: order of opts
Rudxain 56dd461
convert simulator to func
Rudxain d8070de
memSimulator doc
Rudxain b61bb81
move regexes out of `minify`
Rudxain 215262b
Update minify.go
Rudxain 25ee7bf
prefix reset
Rudxain 144c40b
remove possessive quantifier
Rudxain 3b13ff8
fix infinite loop
Rudxain cbcd3f4
"cell" is redundant
Rudxain b84531e
better docs
Rudxain 505ab22
minor correction
Rudxain 7352840
getMatchingBraces
Rudxain e939170
last dot
Rudxain b962da2
add doc, better name
Rudxain d3fbb36
specialize `isPrefixReset`, for speed
Rudxain 4be0593
simpler compressor
Rudxain 9021638
corrected bias in compressor
Rudxain 0c0b5bc
inline `IsMorePlusThanMinus`
Rudxain ab570c9
{ODD|EVEN}_RESET
Rudxain 0ba6830
naming, comments
Rudxain 1f3eca9
Update minify.go
Rudxain 6c9bc91
fmt
Rudxain 0972561
minor corrections, comment about speed
Rudxain 3869b96
Merge branch 'baris-inandi:main' into pr-min
Rudxain cfc441e
Merge branch 'baris-inandi:main' into pr-min
Rudxain 3fed9f2
forgot a doc
Rudxain 302f5ff
fix bug in `noOutputRemover`
Rudxain 402dd9a
single-quote literals
Rudxain 3cd3711
move doc-comment in utils
Rudxain 6c79e6c
fix RuneInSlice doc-comment?
Rudxain 1062a73
add RelativeIndex to utils
Rudxain 87f240d
use `RelativeIndex`
Rudxain 7c78170
inc `go.mod` version to support generic fn applier
Rudxain dd23f37
rename some helper funcs
Rudxain 31dd0b1
Merge branch 'main' into pr-min
Rudxain c8c09a4
Merge branch 'baris-inandi:main' into pr-min
Rudxain f54293a
mem-sim pseudo-code
Rudxain 8841359
improve `removeAfterLastDot`, better comments
33de383
`getMatchingBraces` update
2fbef02
impl `zeroLoopRemover`
120161c
rm outdated doc
812d5d0
impl multi-pass minify
fa8e050
Merge branch 'baris-inandi:main' into pr-min
Rudxain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module github.com/baris-inandi/bfgo | ||
|
|
||
| go 1.17 | ||
| go 1.18 | ||
|
|
||
| require ( | ||
| github.com/urfave/cli/v2 v2.27.1 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,35 @@ | ||
| // other utility functions | ||
| package utils | ||
|
|
||
| // other utility functions | ||
| /* | ||
| Gets param a where a is a rune, | ||
| and list is a list of runes, | ||
| checks if a is in list | ||
| */ | ||
| func RuneInSlice(a rune, list []rune) bool { | ||
| /* | ||
| func runeInSlice | ||
| Gets param a where a is a rune, | ||
| and list is a list of runes, | ||
| checks if a is in list | ||
| */ | ||
| for _, b := range list { | ||
| if b == a { | ||
| return true | ||
| } | ||
| } | ||
| return false | ||
| } | ||
|
|
||
| func RelativeIndex(i, size int) int { | ||
| if i < 0 { | ||
| i += size | ||
| } | ||
| if i < 0 { | ||
| // should it return an err instead of panicking? | ||
| panic("Index out of bounds") | ||
| } | ||
| return i | ||
| } | ||
|
|
||
| // emulation of "pipeline operator" | ||
| func Apply[T any](s T, fs ...func(T) T) T { | ||
| for _, f := range fs { | ||
| s = f(s) | ||
| } | ||
| return s | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.