<qstring>[\\]["] addstr ("\"");
<qstring>[\\][\\] addstr ("\\\\");
<qstring>[\\][\n] line_num++; /* ignore escaped newlines */
-<qstring>([^"\\]*|[\\]) addstr(aagtext);
+<qstring>([^"\\\n]*|[\\]) addstr(aagtext);
[<] BEGIN(hstring); html_nest = 1; beginstr();
<hstring>[>] html_nest--; if (html_nest) addstr(aagtext); else {BEGIN(INITIAL); endstr_html(); return (T_qatom);}
<hstring>[<] html_nest++; addstr(aagtext);
--- /dev/null
+digraph G {
+ "/*
+ This mess is the project of *manually* .Dot-ify minor .JavaScript projects
+ Current state: creating nodes, none connection done for the moment
+ May contain lots of stupid english-speaking mistakes
+ */"
+
+ "var VERSION=2.0106;"
+ "var BETA=0;"
+
+ "/*=====================================================================================
+ MISC HELPER FUNCTIONS
+ =======================================================================================*/"
+ "function l(what) {return document.getElementById(what);}"
+ "function choose(arr) {return arr[Math.floor(Math.random()*arr.length)];}"
+
+ "function escapeRegExp(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");}"
+ "function replaceAll(find,replace,str){return str.replace(new RegExp(escapeRegExp(find),'g'),replace);}"
+
+ "//disable sounds (sorry)"
+ "var realAudio=Audio;//backup real audio"
+ "Audio=function(src){
+ if (src && src.indexOf('soundjay')>-1) {Game.Popup('Sorry, no sounds');this.play=function(){};}
+ else return new realAudio(src);
+ };"
+
+ "if(!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function(needle) {
+ for(var i = 0; i < this.length; i++) {
+ if(this[i] === needle) {return i;}
+ }
+ return -1;
+ };
+ }"
+
+ "function randomFloor(x) {if ((x%1)<Math.random()) return Math.floor(x); else return Math.ceil(x);}"
+
+ "function shuffle(array)
+ {
+ var counter = array.length, temp, index;
+ // While there are elements in the array
+ while (counter--)
+ {
+ // Pick a random index
+ index = (Math.random() * counter) | 0;
+
+ // And swap the last element with it
+ temp = array[counter];
+ array[counter] = array[index];
+ array[index] = temp;
+ }
+ return array;
+ }"
+
+ "var sinArray=[];"
+ "for (var i=0;i<360;i++)
+ {
+ //let's make a lookup table
+ sinArray[i]=Math.sin(i/360*Math.PI*2);
+ }"
+ "function quickSin(x)
+ {
+ //oh man this isn't all that fast actually
+ //why do I do this. why
+ var sign=x<0?-1:1;
+ return sinArray[Math.round(
+ (Math.abs(x)*360/Math.PI/2)%360
+ )]*sign;
+ }"
+
+ "/*function ajax(url,callback){
+ var ajaxRequest;
+ try{ajaxRequest = new XMLHttpRequest();} catch (e){try{ajaxRequest=new ActiveXObject('Msxml2.XMLHTTP');} catch (e) {try{ajaxRequest=new ActiveXObject('Microsoft.XMLHTTP');} catch (e){alert("Something broke!");return false;}}}
+ if (callback){ajaxRequest.onreadystatechange=function(){if(ajaxRequest.readyState==4){callback(ajaxRequest.responseText);}}}
+ ajaxRequest.open('GET',url+'&nocache='+(new Date().getTime()),true);ajaxRequest.send(null);
+ }*/"
+
+# var ajax=function(url,callback)
+//[lots of unfinished things who have been turned into comments using #]
+# /*=======
+}
# the execution did not fail as expected
pytest.fail('dot incorrectly exited with success')
+def test_1411():
+ '''
+ parsing strings containing newlines should not disrupt line number tracking
+ https://gitlab.com/graphviz/graphviz/-/issues/1411
+ '''
+
+ # locate our associated test case in this directory
+ input = os.path.join(os.path.dirname(__file__), '1411.dot')
+ assert os.path.exists(input), 'unexpectedly missing test case'
+
+ # process it with Graphviz (should fail)
+ p = subprocess.Popen(['dot', '-Tsvg', '-o', os.devnull, input],
+ stderr=subprocess.PIPE, universal_newlines=True)
+ _, output = p.communicate()
+
+ assert p.returncode != 0, 'Graphviz accepted broken input'
+
+ assert 'syntax error in line 17 near \'\\\'' in output, \
+ 'error message did not identify correct location'
+
def test_1436():
'''
test a segfault from https://gitlab.com/graphviz/graphviz/-/issues/1436 has