From d369ff33faa4bf5654db3f1eb105141fccf2270d Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sat, 11 Apr 2015 16:51:38 +0200 Subject: Reimplement closeToken handling Idea: Only start unrolling anything on the parser stack if an element that matches the given close token is found. This requires the endToken method in DocumentChildHandler to search for the given descriptor that might be ended. While performing this search, only a specified number of "explicit" structures/fields opened by the Stack class may be skipped (those with implicit default fields). Added an integration test ("python_code") which requires this new (hopefully sane) behaviour. --- .../user_defined_syntax/python_code.out.osxml | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 testdata/integration/user_defined_syntax/python_code.out.osxml (limited to 'testdata/integration/user_defined_syntax/python_code.out.osxml') diff --git a/testdata/integration/user_defined_syntax/python_code.out.osxml b/testdata/integration/user_defined_syntax/python_code.out.osxml new file mode 100644 index 0000000..6235833 --- /dev/null +++ b/testdata/integration/user_defined_syntax/python_code.out.osxml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + import random + import sys + for i in range(int(sys.argv[1])): + + randomNumber = random.randint(1, i) + print("Generated a random number between 1 and {}." % i) + print("It is: {}" % randomNumber) + for k in range(randomNumber): + + print(k) + + print("Done with this number!") + + print("Done.") + + + -- cgit v1.2.3