Пример #1
0
        public static Code Compile(
            string sourceCode,
            string sourceNameForErrorMessages)
        {
            // Compile the text to a code sequence.
            // Change ' to ’ right away. This both looks better and keeps it from interfering with Javascript quotes in HTML.
            // TODO: But what about double quotes? They must get converted just before display, because you can't tell whether to use left or right double quotes until the whole text is assembled. But that makes links with quotes in them not work.
            var tokens = Token.Tokenize(sourceCode.Replace('\'', '’'), sourceNameForErrorMessages);

            return(SequenceCode.BuildFromTokens(tokens, sourceCode, sourceNameForErrorMessages));
        }