Coder Social home page Coder Social logo

ghv / svmprefs Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 0.0 54 KB

A code generation tool enable use of UserDefaults as computed properties in a class.

License: Apache License 2.0

Swift 99.65% Makefile 0.35%
swift5-1 preferences code-generator ios macos userdefaults preference swift4 swift5 swift-package-manager

svmprefs's People

Contributors

ghv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

svmprefs's Issues

Crash when I have an empty code mark after one or more non-empty code marks.

  • Provide a description of what the bug is about
  • Provide a minimal code snippet / example that reproduces the bug.
  • Provide a description of what you believe the output show be.

I am seeing a crash, "Fatal error: Index out of range" in updateBeginEndTailComments when the input looks like this:

            import Foundation
            import AppKit

            /*SVMPREFS
            S main | | RALL

            V Bool | boolVar1    | boolVar2 | IS |
            V Bool | hasBoolVar2 | boolVar2 | |
            V Bool | boolVar3    | boolVar3 | |
            V Bool | boolVar4    | boolVar4 | |

            S copy | | RALL

            V Bool | boolVar3 | boolVar3 | |
            V Bool | boolVar4 | boolVar4 | |

            M main | copy   | boolVar3 | boolVar3
            M main | copy   | boolVar4 | boolVar4
            M main | delete | hasBoolVar2

            SVMPREFS*/

            class MyMigrationTests {
                // MARK: BEGIN main
                // this will be deleted
                // MARK: END main

                // MARK: BEGIN copy
                // this will be deleted
                // MARK: END copy

                // MARK: BEGIN migrate
                // MARK: END migrate
            }

The migrate code mark has no code to delete and is therefore not having its code mark begin and code mark end indexes updated when removing the existing code between all code marks.

It should adjust these indexes because there are code marks for which there was some code to be deleted above it.

It is also possible that this would not crash if there are more lines after the empty code marks equal or greater in length to the number of lines removed in prior code marks. In this case the code would get inserted in the wrong place.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.