Announcement

Collapse
No announcement yet.

[CLOSED] [#542] [1.10] Comment are emitted as code

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [CLOSED] [#542] [1.10] Comment are emitted as code

    Test with 0.9 ( http://live.bridge.net/#1eb66d9a3158bd432c4f )
    /// <summary>
    /// Creates a simple init class for our Application
    /// </summary>
    public class App
    {
        public static void Main()
        {
            var blable = "";
            /*
                vBoubli (@"/faaa");
            */
        }
    }
    gives
    Bridge.define('Demo.App', {
        statics: {
            main: function () {
                var blable = "";
                "/faaa");
            
            }
        }
    });
    Not sure, if it a feature or a bug but the feature is not documented or i do not find it.
    Last edited by geoffrey.mcgill; 2016-03-15 @ 05:56 PM.

    #2
    It's a defect. You found an overly greedy regex.

    There is a fun /*@ comment syntax for writing inline code. The following sample demonstrates:

    public class App
    {
        public static void Main()
        {
            var blable = "";
            /*@
                vBoubli (@"/faaa");
            */
        }
    }
    http://live.bridge.net/#84ead126da7967df82a8

    The above will compile to the following JavaScript:

    Bridge.define('Demo.App', {
        statics: {
            main: function () {
                var blable = "";
                
                vBoubli (@"/faaa");
            
            }
        }
    });
    The problem is the regex pattern which searches for the /*@ is not stopping on the first line and continues the match until it finds your @. To greedy.

    We will fix.
    Last edited by geoffrey.mcgill; 2016-03-15 @ 05:56 PM.

    Comment


      #3
      I've created a new Issue to track this defect:

      https://github.com/bridgedotnet/Bridge/issues/542

      Comment


        #4
        We have fixed the issue - it will be included in 1.10 release.

        Comment

        Working...
        X