summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAverter <averter@users.noreply.github.com>2021-03-14 08:07:43 +0000
committerGitHub <noreply@github.com>2021-03-14 09:07:43 +0100
commitb872095ed5c7c71ae119bb4e04bdf70689cc2336 (patch)
treed3e7d491f429836597d1c2582baf7394c77dfead
parentbf5230460d47f23651f3b894c3f59508115fc0ad (diff)
downloadpygments-git-b872095ed5c7c71ae119bb4e04bdf70689cc2336.tar.gz
Add apdl and gcode lexers (#1714)
* Add apdl and gcode lexers * Added requested changes except words function * Added requested changes except words function * Added words function to handle lists of keywords * Add two testing example files * Delete two_dimensional_truss.ans * Delete coupled_example.ans * Create example1apdl.ans * Create example2apdl.ans * General cleanup of apdlexer and creation of mapfiles * Escaped backslashes in string literals on apdlexer * Removed backslashes. None was necessary in the first place * Added apdl aliase and a * based command in the test file * Forgot to create the map files * Tested version. Also removed an unused function from apdlexer * Added examples for gcode and golden output * Trimming of gcode files to a few dozens of lines * Removed duplicates from elafunb
-rw-r--r--pygments/lexers/_mapping.py2
-rw-r--r--pygments/lexers/apdlexer.py446
-rw-r--r--pygments/lexers/gcodelexer.py34
-rw-r--r--tests/examplefiles/apdl/example1apdl.ans53
-rw-r--r--tests/examplefiles/apdl/example1apdl.ans.output285
-rw-r--r--tests/examplefiles/apdl/example2apdl.ans69
-rw-r--r--tests/examplefiles/apdl/example2apdl.ans.output429
-rw-r--r--tests/examplefiles/gcode/SupportLogo.gcode67
-rw-r--r--tests/examplefiles/gcode/SupportLogo.gcode.output639
-rw-r--r--tests/examplefiles/gcode/boomerangv4.gcode52
-rw-r--r--tests/examplefiles/gcode/boomerangv4.gcode.output349
11 files changed, 2425 insertions, 0 deletions
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py
index a1d5cb5d..b2cb6f99 100644
--- a/pygments/lexers/_mapping.py
+++ b/pygments/lexers/_mapping.py
@@ -504,6 +504,8 @@ LEXERS = {
'ZeekLexer': ('pygments.lexers.dsls', 'Zeek', ('zeek', 'bro'), ('*.zeek', '*.bro'), ()),
'ZephirLexer': ('pygments.lexers.php', 'Zephir', ('zephir',), ('*.zep',), ()),
'ZigLexer': ('pygments.lexers.zig', 'Zig', ('zig',), ('*.zig',), ('text/zig',)),
+ 'apdlexer': ('pygments.lexers.apdlexer', 'ANSYS parametric design language', ('ansys', 'apdl'), ('*.ans',), ()),
+ 'gcodeLexer': ('pygments.lexers.gcodelexer', 'g-code', ('gcode',), ('*.gcode',), ()),
}
if __name__ == '__main__': # pragma: no cover
diff --git a/pygments/lexers/apdlexer.py b/pygments/lexers/apdlexer.py
new file mode 100644
index 00000000..3e11bc08
--- /dev/null
+++ b/pygments/lexers/apdlexer.py
@@ -0,0 +1,446 @@
+# -*- coding: utf-8 -*-
+"""
+ pygments.lexers.apdlexer.py
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Lexers for ANSYS Parametric Design Language.
+
+ :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import re
+
+from pygments.lexer import RegexLexer, include, words
+from pygments.token import *
+
+__all__ = ['apdlexer']
+
+
+class apdlexer(RegexLexer):
+ """
+ For APDL source code.
+
+ .. versionadded:: 2.80
+ """
+ name = 'ANSYS parametric design language'
+ aliases = ['ansys', 'apdl']
+ filenames = ['*.ans']
+ flags = re.IGNORECASE
+
+ # list of elements
+ elafunb = ["SURF152", "SURF153", "SURF154", "SURF156", "SHELL157",
+ "SURF159", "LINK160", "BEAM161", "PLANE162",
+ "SHELL163", "SOLID164", "COMBI165", "MASS166",
+ "LINK167", "SOLID168", "TARGE169", "TARGE170",
+ "CONTA171", "CONTA172", "CONTA173", "CONTA174",
+ "CONTA175", "CONTA176", "CONTA177", "CONTA178",
+ "PRETS179", "LINK180", "SHELL181", "PLANE182",
+ "PLANE183", "MPC184", "SOLID185", "SOLID186",
+ "SOLID187", "BEAM188", "BEAM189", "SOLSH190",
+ "INTER192", "INTER193", "INTER194", "INTER195",
+ "MESH200", "FOLLW201", "INTER202", "INTER203",
+ "INTER204", "INTER205", "SHELL208", "SHELL209",
+ "CPT212", "CPT213", "COMBI214", "CPT215", "CPT216",
+ "CPT217", "FLUID220", "FLUID221", "PLANE223",
+ "SOLID226", "SOLID227", "PLANE230", "SOLID231",
+ "SOLID232", "PLANE233", "SOLID236", "SOLID237",
+ "PLANE238", "SOLID239", "SOLID240", "HSFLD241",
+ "HSFLD242", "SURF251", "SURF252", "REINF263",
+ "REINF264", "REINF265", "SOLID272", "SOLID273",
+ "SOLID278", "SOLID279", "SHELL281", "SOLID285",
+ "PIPE288", "PIPE289", "ELBOW290", "USER300", "BEAM3",
+ "BEAM4", "BEAM23", "BEAM24", "BEAM44", "BEAM54",
+ "COMBIN7", "FLUID79", "FLUID80", "FLUID81", "FLUID141",
+ "FLUID142", "INFIN9", "INFIN47", "PLANE13", "PLANE25",
+ "PLANE42", "PLANE53", "PLANE67", "PLANE82", "PLANE83",
+ "PLANE145", "PLANE146", "CONTAC12", "CONTAC52",
+ "LINK1", "LINK8", "LINK10", "LINK32", "PIPE16",
+ "PIPE17", "PIPE18", "PIPE20", "PIPE59", "PIPE60",
+ "SHELL41", "SHELL43", "SHELL57", "SHELL63", "SHELL91",
+ "SHELL93", "SHELL99", "SHELL150", "SOLID5", "SOLID45",
+ "SOLID46", "SOLID65", "SOLID69", "SOLID92", "SOLID95",
+ "SOLID117", "SOLID127", "SOLID128", "SOLID147",
+ "SOLID148", "SOLID191", "VISCO88", "VISCO89",
+ "VISCO106", "VISCO107", "VISCO108", "TRANS109"]
+
+ elafunc = ["PGRAPH", "/VT", "VTIN", "VTRFIL", "VTTEMP", "PGRSET",
+ "VTCLR", "VTMETH", "VTRSLT", "VTVMOD", "PGSELE",
+ "VTDISC", "VTMP", "VTSEC", "PGWRITE", "VTEVAL", "VTOP",
+ "VTSFE", "POUTRES", "VTFREQ", "VTPOST", "VTSL",
+ "FLDATA1-40", "HFPCSWP", "MSDATA", "MSVARY", "QFACT",
+ "FLOCHECK", "HFPOWER", "MSMASS", "PERI", "SPADP",
+ "FLREAD", "HFPORT", "MSMETH", "PLFSS", "SPARM",
+ "FLOTRAN", "HFSCAT", "MSMIR", "PLSCH", "SPFSS",
+ "HFADP", "ICE", "MSNOMF", "PLSYZ", "SPICE", "HFARRAY",
+ "ICEDELE", "MSPROP", "PLTD", "SPSCAN", "HFDEEM",
+ "ICELIST", "MSQUAD", "PLTLINE", "SPSWP", "HFEIGOPT",
+ "ICVFRC", "MSRELAX", "PLVFRC", "HFEREFINE", "LPRT",
+ "MSSOLU", "/PICE", "HFMODPRT", "MSADV", "MSSPEC",
+ "PLWAVE", "HFPA", "MSCAP", "MSTERM", "PRSYZ"]
+
+ elafund = ["*VOPER", "VOVLAP", "*VPLOT", "VPLOT", "VPTN", "*VPUT",
+ "VPUT", "*VREAD", "VROTAT", "VSBA", "VSBV", "VSBW",
+ "/VSCALE", "*VSCFUN", "VSEL", "VSLA", "*VSTAT", "VSUM",
+ "VSWEEP", "VSYMM", "VTRAN", "VTYPE", "/VUP", "*VWRITE",
+ "/WAIT", "WAVES", "WERASE", "WFRONT", "/WINDOW",
+ "WMID", "WMORE", "WPAVE", "WPCSYS", "WPLANE", "WPOFFS",
+ "WPROTA", "WPSTYL", "WRFULL", "WRITE", "WRITEMAP",
+ "*WRK", "WSORT", "WSPRINGS", "WSTART", "WTBCREATE",
+ "XFDATA", "XFENRICH", "XFLIST", "/XFRM", "/XRANGE",
+ "XVAR", "/YRANGE", "/ZOOM", "/WB", "XMLO", "/XML",
+ "CNTR", "EBLOCK", "CMBLOCK", "NBLOCK", "/TRACK",
+ "CWZPLOT", "~EUI", "NELE", "EALL", "NALL", "FLITEM",
+ "LSLN", "PSOLVE", "ASLN", "/VERIFY", "/SSS", "~CFIN",
+ "*EVAL", "*MOONEY", "/RUNSTAT", "ALPFILL",
+ "ARCOLLAPSE", "ARDETACH", "ARFILL", "ARMERGE",
+ "ARSPLIT", "FIPLOT", "GAPFINISH", "GAPLIST",
+ "GAPMERGE", "GAPOPT", "GAPPLOT", "LNCOLLAPSE",
+ "LNDETACH", "LNFILL", "LNMERGE", "LNSPLIT", "PCONV",
+ "PLCONV", "PEMOPTS", "PEXCLUDE", "PINCLUDE", "PMETH",
+ "/PMETH", "PMOPTS", "PPLOT", "PPRANGE", "PRCONV",
+ "PRECISION", "RALL", "RFILSZ", "RITER", "RMEMRY",
+ "RSPEED", "RSTAT", "RTIMST", "/RUNST", "RWFRNT",
+ "SARPLOT", "SHSD", "SLPPLOT", "SLSPLOT", "VCVFILL",
+ "/OPT", "OPEQN", "OPFACT", "OPFRST", "OPGRAD",
+ "OPKEEP", "OPLOOP", "OPPRNT", "OPRAND", "OPSUBP",
+ "OPSWEEP", "OPTYPE", "OPUSER", "OPVAR", "OPADD",
+ "OPCLR", "OPDEL", "OPMAKE", "OPSEL", "OPANL", "OPDATA",
+ "OPRESU", "OPSAVE", "OPEXE", "OPLFA", "OPLGR",
+ "OPLIST", "OPLSW", "OPRFA", "OPRGR", "OPRSW",
+ "PILECALC", "PILEDISPSET", "PILEGEN", "PILELOAD",
+ "PILEMASS", "PILERUN", "PILESEL", "PILESTIF",
+ "PLVAROPT", "PRVAROPT", "TOCOMP", "TODEF", "TOFREQ",
+ "TOTYPE", "TOVAR", "TOEXE", "TOLOOP", "TOGRAPH",
+ "TOLIST", "TOPLOT", "TOPRINT", "TOSTAT", "TZAMESH",
+ "TZDELE", "TZEGEN", "XVAROPT", "PGSAVE", "SOLCONTROL",
+ "TOTAL", "VTGEOM", "VTREAL", "VTSTAT"]
+
+ elafune = ["/ANUM", "AOFFST", "AOVLAP", "APLOT", "APPEND", "APTN",
+ "ARCLEN", "ARCTRM", "AREAS", "AREFINE", "AREMESH",
+ "AREVERSE", "AROTAT", "ARSCALE", "ARSYM", "ASBA",
+ "ASBL", "ASBV", "ASBW", "ASCRES", "ASEL", "ASIFILE",
+ "*ASK", "ASKIN", "ASLL", "ASLV", "ASOL", "/ASSIGN",
+ "ASUB", "ASUM", "ATAN", "ATRAN", "ATYPE", "/AUTO",
+ "AUTOTS", "/AUX2", "/AUX3", "/AUX12", "/AUX15",
+ "AVPRIN", "AVRES", "AWAVE", "/AXLAB", "*AXPY",
+ "/BATCH", "BCSOPTION", "BETAD", "BF", "BFA", "BFADELE",
+ "BFALIST", "BFCUM", "BFDELE", "BFE", "BFECUM",
+ "BFEDELE", "BFELIST", "BFESCAL", "BFINT", "BFK",
+ "BFKDELE", "BFKLIST", "BFL", "BFLDELE", "BFLIST",
+ "BFLLIST", "BFSCALE", "BFTRAN", "BFUNIF", "BFV",
+ "BFVDELE", "BFVLIST", "BIOOPT", "BIOT", "BLC4", "BLC5",
+ "BLOCK", "BOOL", "BOPTN", "BSAX", "BSMD", "BSM1",
+ "BSM2", "BSPLIN", "BSS1", "BSS2", "BSTE", "BSTQ",
+ "BTOL", "BUCOPT", "C", "CALC", "CAMPBELL", "CBDOF",
+ "CBMD", "CBMX", "CBTE", "CBTMP", "CDOPT", "CDREAD",
+ "CDWRITE", "CE", "CECHECK", "CECMOD", "CECYC",
+ "CEDELE", "CEINTF", "CELIST", "CENTER", "CEQN",
+ "CERIG", "CESGEN", "CFACT", "*CFCLOS", "*CFOPEN",
+ "*CFWRITE", "/CFORMAT", "CGLOC", "CGOMGA", "CGROW",
+ "CHECK", "CHKMSH", "CINT", "CIRCLE", "CISOL",
+ "/CLABEL", "/CLEAR", "CLOCAL", "CLOG", "/CLOG",
+ "CLRMSHLN", "CM", "CMACEL", "/CMAP", "CMATRIX",
+ "CMDELE", "CMDOMEGA", "CMEDIT", "CMGRP", "CMLIST",
+ "CMMOD", "CMOMEGA", "CMPLOT", "CMROTATE", "CMSEL",
+ "CMSFILE", "CMSOPT", "CMWRITE", "CNCHECK", "CNKMOD",
+ "CNTR", "CNVTOL", "/COLOR", "/COM", "*COMP", "COMBINE",
+ "COMPRESS", "CON4", "CONE", "/CONFIG", "CONJUG",
+ "/CONTOUR", "/COPY", "CORIOLIS", "COUPLE", "COVAL",
+ "CP", "CPCYC", "CPDELE", "CPINTF", "/CPLANE", "CPLGEN",
+ "CPLIST", "CPMERGE", "CPNGEN", "CPSGEN", "CQC",
+ "*CREATE", "CRPLIM", "CS", "CSCIR", "CSDELE", "CSKP",
+ "CSLIST", "CSWPLA", "CSYS", "/CTYPE", "CURR2D",
+ "CUTCONTROL", "/CVAL", "CVAR", "/CWD", "CYCCALC",
+ "/CYCEXPAND", "CYCFILES", "CYCFREQ", "*CYCLE",
+ "CYCLIC", "CYCOPT", "CYCPHASE", "CYCSPEC", "CYL4",
+ "CYL5", "CYLIND", "CZDEL", "CZMESH", "D", "DA",
+ "DADELE", "DALIST", "DAMORPH", "DATA", "DATADEF",
+ "DCGOMG", "DCUM", "DCVSWP", "DDASPEC", "DDELE",
+ "DDOPTION", "DEACT", "DEFINE", "*DEL", "DELETE",
+ "/DELETE", "DELTIM", "DEMORPH", "DERIV", "DESIZE",
+ "DESOL", "DETAB", "/DEVDISP", "/DEVICE", "/DFLAB",
+ "DFLX", "DFSWAVE", "DIG", "DIGIT", "*DIM",
+ "/DIRECTORY", "DISPLAY", "/DIST", "DJ", "DJDELE",
+ "DJLIST", "DK", "DKDELE", "DKLIST", "DL", "DLDELE",
+ "DLIST", "DLLIST", "*DMAT", "DMOVE", "DMPEXT",
+ "DMPOPTION", "DMPRAT", "DMPSTR", "DNSOL", "*DO", "DOF",
+ "DOFSEL", "DOMEGA", "*DOT", "*DOWHILE", "DSCALE",
+ "/DSCALE", "DSET", "DSPOPTION", "DSUM", "DSURF",
+ "DSYM", "DSYS", "DTRAN", "DUMP", "/DV3D", "DVAL",
+ "DVMORPH", "DYNOPT", "E", "EALIVE", "EDADAPT", "EDALE",
+ "EDASMP", "EDBOUND", "EDBX", "EDBVIS", "EDCADAPT",
+ "EDCGEN", "EDCLIST", "EDCMORE", "EDCNSTR", "EDCONTACT",
+ "EDCPU", "EDCRB", "EDCSC", "EDCTS", "EDCURVE",
+ "EDDAMP", "EDDBL", "EDDC", "EDDRELAX", "EDDUMP",
+ "EDELE", "EDENERGY", "EDFPLOT", "EDGCALE", "/EDGE",
+ "EDHGLS", "EDHIST", "EDHTIME", "EDINT", "EDIPART",
+ "EDIS", "EDLCS", "EDLOAD", "EDMP", "EDNB", "EDNDTSD",
+ "EDNROT", "EDOPT", "EDOUT", "EDPART", "EDPC", "EDPL",
+ "EDPVEL", "EDRC", "EDRD", "EDREAD", "EDRI", "EDRST",
+ "EDRUN", "EDSHELL", "EDSOLV", "EDSP", "EDSTART",
+ "EDTERM", "EDTP", "EDVEL", "EDWELD", "EDWRITE",
+ "EEXTRUDE", "/EFACET", "EGEN", "*EIGEN", "EINFIN",
+ "EINTF", "EKILL", "ELBOW", "ELEM", "ELIST", "*ELSE",
+ "*ELSEIF", "EMAGERR", "EMATWRITE", "EMF", "EMFT",
+ "EMID", "EMIS", "EMODIF", "EMORE", "EMSYM", "EMTGEN",
+ "EMUNIT", "EN", "*END", "*ENDDO", "*ENDIF",
+ "ENDRELEASE", "ENERSOL", "ENGEN", "ENORM", "ENSYM",
+ "EORIENT", "EPLOT", "EQSLV", "ERASE", "/ERASE",
+ "EREAD", "EREFINE", "EREINF", "ERESX", "ERNORM",
+ "ERRANG", "ESCHECK", "ESEL", "/ESHAPE", "ESIZE",
+ "ESLA", "ESLL", "ESLN", "ESLV", "ESOL", "ESORT",
+ "ESSOLV", "ESTIF", "ESURF", "ESYM", "ESYS", "ET",
+ "ETABLE", "ETCHG", "ETCONTROL", "ETDELE", "ETLIST",
+ "ETYPE", "EUSORT", "EWRITE", "*EXIT", "/EXIT", "EXP",
+ "EXPAND", "/EXPAND", "EXPASS", "*EXPORT", "EXPROFILE",
+ "EXPSOL", "EXTOPT", "EXTREM", "EXUNIT", "F", "/FACET",
+ "FATIGUE", "FC", "FCCHECK", "FCDELE", "FCLIST", "FCUM",
+ "FCTYP", "FDELE", "/FDELE", "FE", "FEBODY", "FECONS",
+ "FEFOR", "FELIST", "FESURF", "*FFT", "FILE",
+ "FILEAUX2", "FILEAUX3", "FILEDISP", "FILL", "FILLDATA",
+ "/FILNAME", "FINISH", "FITEM", "FJ", "FJDELE",
+ "FJLIST", "FK", "FKDELE", "FKLIST", "FL", "FLIST",
+ "FLLIST", "FLST", "FLUXV", "FLUREAD", "FMAGBC",
+ "FMAGSUM", "/FOCUS", "FOR2D", "FORCE", "FORM",
+ "/FORMAT", "FP", "FPLIST", "*FREE", "FREQ", "FRQSCL",
+ "FS", "FSCALE", "FSDELE", "FSLIST", "FSNODE", "FSPLOT",
+ "FSSECT", "FSSPARM", "FSUM", "FTCALC", "FTRAN",
+ "FTSIZE", "FTWRITE", "FTYPE", "FVMESH", "GAP", "GAPF",
+ "GAUGE", "GCDEF", "GCGEN", "/GCMD", "/GCOLUMN",
+ "GENOPT", "GEOM", "GEOMETRY", "*GET", "/GFILE",
+ "/GFORMAT", "/GLINE", "/GMARKER", "GMATRIX", "GMFACE",
+ "*GO", "/GO", "/GOLIST", "/GOPR", "GP", "GPDELE",
+ "GPLIST", "GPLOT", "/GRAPHICS", "/GRESUME", "/GRID",
+ "/GROPT", "GRP", "/GRTYP", "/GSAVE", "GSBDATA",
+ "GSGDATA", "GSLIST", "GSSOL", "/GST", "GSUM", "/GTHK",
+ "/GTYPE", "HARFRQ", "/HBC", "HBMAT", "/HEADER", "HELP",
+ "HELPDISP", "HEMIOPT", "HFANG", "HFSYM", "HMAGSOLV",
+ "HPGL", "HPTCREATE", "HPTDELETE", "HRCPLX", "HREXP",
+ "HROPT", "HROCEAN", "HROUT", "IC", "ICDELE", "ICLIST",
+ "/ICLWID", "/ICSCALE", "*IF", "IGESIN", "IGESOUT",
+ "/IMAGE", "IMAGIN", "IMESH", "IMMED", "IMPD",
+ "INISTATE", "*INIT", "/INPUT", "/INQUIRE", "INRES",
+ "INRTIA", "INT1", "INTSRF", "IOPTN", "IRLF", "IRLIST",
+ "*ITENGINE", "JPEG", "JSOL", "K", "KATT", "KBC",
+ "KBETW", "KCALC", "KCENTER", "KCLEAR", "KDELE",
+ "KDIST", "KEEP", "KESIZE", "KEYOPT", "KEYPTS", "KEYW",
+ "KFILL", "KGEN", "KL", "KLIST", "KMESH", "KMODIF",
+ "KMOVE", "KNODE", "KPLOT", "KPSCALE", "KREFINE",
+ "KSCALE", "KSCON", "KSEL", "KSLL", "KSLN", "KSUM",
+ "KSYMM", "KTRAN", "KUSE", "KWPAVE", "KWPLAN", "L",
+ "L2ANG", "L2TAN", "LANG", "LARC", "/LARC", "LAREA",
+ "LARGE", "LATT", "LAYER", "LAYERP26", "LAYLIST",
+ "LAYPLOT", "LCABS", "LCASE", "LCCALC", "LCCAT",
+ "LCDEF", "LCFACT", "LCFILE", "LCLEAR", "LCOMB",
+ "LCOPER", "LCSEL", "LCSL", "LCSUM", "LCWRITE",
+ "LCZERO", "LDELE", "LDIV", "LDRAG", "LDREAD", "LESIZE",
+ "LEXTND", "LFILLT", "LFSURF", "LGEN", "LGLUE",
+ "LGWRITE", "/LIGHT", "LINA", "LINE", "/LINE", "LINES",
+ "LINL", "LINP", "LINV", "LIST", "*LIST", "LLIST",
+ "LMATRIX", "LMESH", "LNSRCH", "LOCAL", "LOVLAP",
+ "LPLOT", "LPTN", "LREFINE", "LREVERSE", "LROTAT",
+ "LSBA", "*LSBAC", "LSBL", "LSBV", "LSBW", "LSCLEAR",
+ "LSDELE", "*LSDUMP", "LSEL", "*LSENGINE", "*LSFACTOR",
+ "LSLA", "LSLK", "LSOPER", "/LSPEC", "LSREAD",
+ "*LSRESTORE", "LSSCALE", "LSSOLVE", "LSTR", "LSUM",
+ "LSWRITE", "/LSYMBOL", "LSYMM", "LTAN", "LTRAN",
+ "LUMPM", "LVSCALE", "LWPLAN", "M", "MADAPT", "MAGOPT",
+ "MAGSOLV", "/MAIL", "MAP", "/MAP", "MAP2DTO3D",
+ "MAPSOLVE", "MAPVAR", "MASTER", "MAT", "MATER",
+ "MCHECK", "MDAMP", "MDELE", "MDPLOT", "MEMM", "/MENU",
+ "MESHING", "MFANALYSIS", "MFBUCKET", "MFCALC", "MFCI",
+ "MFCLEAR", "MFCMMAND", "MFCONV", "MFDTIME", "MFELEM",
+ "MFEM", "MFEXTER", "MFFNAME", "MFFR", "MFIMPORT",
+ "MFINTER", "MFITER", "MFLCOMM", "MFLIST", "MFMAP",
+ "MFORDER", "MFOUTPUT", "*MFOURI", "MFPSIMUL", "MFRC",
+ "MFRELAX", "MFRSTART", "MFSORDER", "MFSURFACE",
+ "MFTIME", "MFTOL", "*MFUN", "MFVOLUME", "MFWRITE",
+ "MGEN", "MIDTOL", "/MKDIR", "MLIST", "MMASS", "MMF",
+ "MODCONT", "MODE", "MODIFY", "MODMSH", "MODSELOPTION",
+ "MODOPT", "MONITOR", "*MOPER", "MOPT", "MORPH", "MOVE",
+ "MP", "MPAMOD", "MPCHG", "MPCOPY", "MPDATA", "MPDELE",
+ "MPDRES", "/MPLIB", "MPLIST", "MPPLOT", "MPREAD",
+ "MPRINT", "MPTEMP", "MPTGEN", "MPTRES", "MPWRITE",
+ "/MREP", "MSAVE", "*MSG", "MSHAPE", "MSHCOPY",
+ "MSHKEY", "MSHMID", "MSHPATTERN", "MSOLVE", "/MSTART",
+ "MSTOLE", "*MULT", "*MWRITE", "MXPAND", "N", "NANG",
+ "NAXIS", "NCNV", "NDELE", "NDIST", "NDSURF", "NEQIT",
+ "/NERR", "NFORCE", "NGEN", "NKPT", "NLADAPTIVE",
+ "NLDIAG", "NLDPOST", "NLGEOM", "NLHIST", "NLIST",
+ "NLMESH", "NLOG", "NLOPT", "NMODIF", "NOCOLOR",
+ "NODES", "/NOERASE", "/NOLIST", "NOOFFSET", "NOORDER",
+ "/NOPR", "NORA", "NORL", "/NORMAL", "NPLOT", "NPRINT",
+ "NREAD", "NREFINE", "NRLSUM", "*NRM", "NROPT",
+ "NROTAT", "NRRANG", "NSCALE", "NSEL", "NSLA", "NSLE",
+ "NSLK", "NSLL", "NSLV", "NSMOOTH", "NSOL", "NSORT",
+ "NSTORE", "NSUBST", "NSVR", "NSYM", "/NUMBER",
+ "NUMCMP", "NUMEXP", "NUMMRG", "NUMOFF", "NUMSTR",
+ "NUMVAR", "NUSORT", "NWPAVE", "NWPLAN", "NWRITE",
+ "OCDATA", "OCDELETE", "OCLIST", "OCREAD", "OCTABLE",
+ "OCTYPE", "OCZONE", "OMEGA", "OPERATE", "OPNCONTROL",
+ "OUTAERO", "OUTOPT", "OUTPR", "/OUTPUT", "OUTRES",
+ "OVCHECK", "PADELE", "/PAGE", "PAGET", "PAPUT",
+ "PARESU", "PARTSEL", "PARRES", "PARSAV", "PASAVE",
+ "PATH", "PAUSE", "/PBC", "/PBF", "PCALC", "PCGOPT",
+ "PCIRC", "/PCIRCLE", "/PCOPY", "PCROSS", "PDANL",
+ "PDCDF", "PDCFLD", "PDCLR", "PDCMAT", "PDCORR",
+ "PDDMCS", "PDDOEL", "PDEF", "PDEXE", "PDHIST",
+ "PDINQR", "PDLHS", "PDMETH", "PDOT", "PDPINV",
+ "PDPLOT", "PDPROB", "PDRESU", "PDROPT", "/PDS",
+ "PDSAVE", "PDSCAT", "PDSENS", "PDSHIS", "PDUSER",
+ "PDVAR", "PDWRITE", "PERBC2D", "PERTURB", "PFACT",
+ "PHYSICS", "PIVCHECK", "PLCAMP", "PLCFREQ", "PLCHIST",
+ "PLCINT", "PLCPLX", "PLCRACK", "PLDISP", "PLESOL",
+ "PLETAB", "PLFAR", "PLF2D", "PLGEOM", "PLLS", "PLMAP",
+ "PLMC", "PLNEAR", "PLNSOL", "/PLOPTS", "PLORB", "PLOT",
+ "PLOTTING", "PLPAGM", "PLPATH", "PLSECT", "PLST",
+ "PLTIME", "PLTRAC", "PLVAR", "PLVECT", "PLZZ",
+ "/PMACRO", "PMAP", "PMGTRAN", "PMLOPT", "PMLSIZE",
+ "/PMORE", "PNGR", "/PNUM", "POINT", "POLY", "/POLYGON",
+ "/POST1", "/POST26", "POWERH", "PPATH", "PRANGE",
+ "PRAS", "PRCAMP", "PRCINT", "PRCPLX", "PRED",
+ "PRENERGY", "/PREP7", "PRERR", "PRESOL", "PRETAB",
+ "PRFAR", "PRI2", "PRIM", "PRINT", "*PRINT", "PRISM",
+ "PRITER", "PRJSOL", "PRNEAR", "PRNLD", "PRNSOL",
+ "PROD", "PRORB", "PRPATH", "PRRFOR", "PRRSOL",
+ "PRSCONTROL", "PRSECT", "PRTIME", "PRVAR", "PRVECT",
+ "PSCONTROL", "PSCR", "PSDCOM", "PSDFRQ", "PSDGRAPH",
+ "PSDRES", "PSDSPL", "PSDUNIT", "PSDVAL", "PSDWAV",
+ "/PSEARCH", "PSEL", "/PSF", "PSMAT", "PSMESH",
+ "/PSPEC", "/PSTATUS", "PSTRES", "/PSYMB", "PTR",
+ "PTXY", "PVECT", "/PWEDGE", "QDVAL", "QRDOPT", "QSOPT",
+ "QUAD", "/QUIT", "QUOT", "R", "RACE", "RADOPT",
+ "RAPPND", "RATE", "/RATIO", "RBE3", "RCON", "RCYC",
+ "RDEC", "RDELE", "READ", "REAL", "REALVAR", "RECTNG",
+ "REMESH", "/RENAME", "REORDER", "*REPEAT", "/REPLOT",
+ "RESCOMBINE", "RESCONTROL", "RESET", "/RESET", "RESP",
+ "RESUME", "RESVEC", "RESWRITE", "*RETURN", "REXPORT",
+ "REZONE", "RFORCE", "/RGB", "RIGID", "RIGRESP",
+ "RIMPORT", "RLIST", "RMALIST", "RMANL", "RMASTER",
+ "RMCAP", "RMCLIST", "/RMDIR", "RMFLVEC", "RMLVSCALE",
+ "RMMLIST", "RMMRANGE", "RMMSELECT", "RMNDISP",
+ "RMNEVEC", "RMODIF", "RMORE", "RMPORDER", "RMRESUME",
+ "RMRGENERATE", "RMROPTIONS", "RMRPLOT", "RMRSTATUS",
+ "RMSAVE", "RMSMPLE", "RMUSE", "RMXPORT", "ROCK",
+ "ROSE", "RPOLY", "RPR4", "RPRISM", "RPSD", "RSFIT",
+ "RSOPT", "RSPLIT", "RSPLOT", "RSPRNT", "RSSIMS",
+ "RSTMAC", "RSTOFF", "RSURF", "RSYMM", "RSYS", "RTHICK",
+ "SABS", "SADD", "SALLOW", "SAVE", "SBCLIST", "SBCTRAN",
+ "SDELETE", "SE", "SECCONTROL", "SECDATA",
+ "SECFUNCTION", "SECJOINT", "/SECLIB", "SECLOCK",
+ "SECMODIF", "SECNUM", "SECOFFSET", "SECPLOT",
+ "SECREAD", "SECSTOP", "SECTYPE", "SECWRITE", "SED",
+ "SEDLIST", "SEEXP", "/SEG", "SEGEN", "SELIST", "SELM",
+ "SELTOL", "SENERGY", "SEOPT", "SESYMM", "*SET", "SET",
+ "SETFGAP", "SETRAN", "SEXP", "SF", "SFA", "SFACT",
+ "SFADELE", "SFALIST", "SFBEAM", "SFCALC", "SFCUM",
+ "SFDELE", "SFE", "SFEDELE", "SFELIST", "SFFUN",
+ "SFGRAD", "SFL", "SFLDELE", "SFLEX", "SFLIST",
+ "SFLLIST", "SFSCALE", "SFTRAN", "/SHADE", "SHELL",
+ "/SHOW", "/SHOWDISP", "SHPP", "/SHRINK", "SLIST",
+ "SLOAD", "SMALL", "*SMAT", "SMAX", "/SMBC", "SMBODY",
+ "SMCONS", "SMFOR", "SMIN", "SMOOTH", "SMRTSIZE",
+ "SMSURF", "SMULT", "SNOPTION", "SOLU", "/SOLU",
+ "SOLUOPT", "SOLVE", "SORT", "SOURCE", "SPACE",
+ "SPCNOD", "SPCTEMP", "SPDAMP", "SPEC", "SPFREQ",
+ "SPGRAPH", "SPH4", "SPH5", "SPHERE", "SPLINE", "SPLOT",
+ "SPMWRITE", "SPOINT", "SPOPT", "SPREAD", "SPTOPT",
+ "SPOWER", "SPUNIT", "SPVAL", "SQRT", "*SREAD", "SRSS",
+ "SSBT", "/SSCALE", "SSLN", "SSMT", "SSPA", "SSPB",
+ "SSPD", "SSPE", "SSPM", "SSUM", "SSTATE", "STABILIZE",
+ "STAOPT", "STAT", "*STATUS", "/STATUS", "STEF",
+ "/STITLE", "STORE", "SUBOPT", "SUBSET", "SUCALC",
+ "SUCR", "SUDEL", "SUEVAL", "SUGET", "SUMAP", "SUMTYPE",
+ "SUPL", "SUPR", "SURESU", "SUSAVE", "SUSEL", "SUVECT",
+ "SV", "SVPLOT", "SVTYP", "SWADD", "SWDEL", "SWGEN",
+ "SWLIST", "SYNCHRO", "/SYP", "/SYS", "TALLOW",
+ "TARGET", "*TAXIS", "TB", "TBCOPY", "TBDATA", "TBDELE",
+ "TBEO", "TBIN", "TBFIELD", "TBFT", "TBLE", "TBLIST",
+ "TBMODIF", "TBPLOT", "TBPT", "TBTEMP", "TCHG", "/TEE",
+ "TERM", "THEXPAND", "THOPT", "TIFF", "TIME",
+ "TIMERANGE", "TIMINT", "TIMP", "TINTP", "/TITLE",
+ "/TLABEL", "TOFFST", "*TOPER", "TORQ2D", "TORQC2D",
+ "TORQSUM", "TORUS", "TRANS", "TRANSFER", "*TREAD",
+ "TREF", "/TRIAD", "/TRLCY", "TRNOPT", "TRPDEL",
+ "TRPLIS", "TRPOIN", "TRTIME", "TSHAP", "/TSPEC",
+ "TSRES", "TUNIF", "TVAR", "/TXTRE", "/TYPE", "TYPE",
+ "/UCMD", "/UDOC", "/UI", "UIMP", "/UIS", "*ULIB",
+ "UNDELETE", "UNDO", "/UNITS", "UNPAUSE", "UPCOORD",
+ "UPGEOM", "*USE", "/USER", "USRCAL", "USRDOF",
+ "USRELEM", "V", "V2DOPT", "VA", "*VABS", "VADD",
+ "VARDEL", "VARNAM", "VATT", "VCLEAR", "*VCOL",
+ "/VCONE", "VCROSS", "*VCUM", "VDDAM", "VDELE", "VDGL",
+ "VDOT", "VDRAG", "*VEC", "*VEDIT", "VEORIENT", "VEXT",
+ "*VFACT", "*VFILL", "VFOPT", "VFQUERY", "VFSM",
+ "*VFUN", "VGEN", "*VGET", "VGET", "VGLUE", "/VIEW",
+ "VIMP", "VINP", "VINV", "*VITRP", "*VLEN", "VLIST",
+ "VLSCALE", "*VMASK", "VMESH", "VOFFST", "VOLUMES"]
+
+ # list of in-built () functions
+ elafunf = ["NX()", "NY()", "NZ()", "KX()", "KY()", "KZ()", "LX()",
+ "LY()", "LZ()", "LSX()", "LSY()", "LSZ()", "NODE()",
+ "KP()", "DISTND()", "DISTKP()", "DISTEN()", "ANGLEN()",
+ "ANGLEK()", "NNEAR()", "KNEAR()", "ENEARN()",
+ "AREAND()", "AREAKP()", "ARNODE()", "NORMNX()",
+ "NORMNY()", "NORMNZ()", "NORMKX()", "NORMKY()",
+ "NORMKZ()", "ENEXTN()", "NELEM()", "NODEDOF()",
+ "ELADJ()", "NDFACE()", "NMFACE()", "ARFACE()", "UX()",
+ "UY()", "UZ()", "ROTX()", "ROTY()", "ROTZ()", "TEMP()",
+ "PRES()", "VX()", "VY()", "VZ()", "ENKE()", "ENDS()",
+ "VOLT()", "MAG()", "AX()", "AY()", "AZ()",
+ "VIRTINQR()", "KWGET()", "VALCHR()", "VALHEX()",
+ "CHRHEX()", "STRFILL()", "STRCOMP()", "STRPOS()",
+ "STRLENG()", "UPCASE()", "LWCASE()", "JOIN()",
+ "SPLIT()", "ABS()", "SIGN()", "CXABS()", "EXP()",
+ "LOG()", "LOG10()", "SQRT()", "NINT()", "MOD()",
+ "RAND()", "GDIS()", "SIN()", "COS()", "TAN()",
+ "SINH()", "COSH()", "TANH()", "ASIN()", "ACOS()",
+ "ATAN()", "ATAN2()"]
+
+ elafung = ["NSEL()", "ESEL()", "KSEL()", "LSEL()", "ASEL()",
+ "VSEL()", "NDNEXT()", "ELNEXT()", "KPNEXT()",
+ "LSNEXT()", "ARNEXT()", "VLNEXT()", "CENTRX()",
+ "CENTRY()", "CENTRZ()"]
+
+ elafunh = ["~CAT5IN", "~CATIAIN", "~PARAIN", "~PROEIN", "~SATIN",
+ "~UGIN", "A", "AADD", "AATT", "ABEXTRACT", "*ABBR",
+ "ABBRES", "ABBSAV", "ABS", "ACCAT", "ACCOPTION",
+ "ACEL", "ACLEAR", "ADAMS", "ADAPT", "ADD", "ADDAM",
+ "ADELE", "ADGL", "ADRAG", "AESIZE", "AFILLT", "AFLIST",
+ "AFSURF", "*AFUN", "AGEN", "AGLUE", "AINA", "AINP",
+ "AINV", "AL", "ALIST", "ALLSEL", "ALPHAD", "AMAP",
+ "AMESH", "/AN3D", "ANCNTR", "ANCUT", "ANCYC", "ANDATA",
+ "ANDSCL", "ANDYNA", "/ANFILE", "ANFLOW", "/ANGLE",
+ "ANHARM", "ANIM", "ANISOS", "ANMODE", "ANMRES",
+ "/ANNOT", "ANORM", "ANPRES", "ANSOL", "ANSTOAQWA",
+ "ANSTOASAS", "ANTIME", "ANTYPE"]
+
+ tokens = {
+ 'root': [
+ (r'!.*\n', Comment),
+ include('strings'),
+ include('core'),
+ include('nums'),
+ (words((elafunb+elafunc+elafund+elafune+elafunh), suffix=r'\b'),Keyword),
+ (words((elafunf+elafung), suffix=r'\b'), Name.Builtin),
+ (r'AR[0-9]+', Name.Variable.Instance),
+ (r'[a-z][a-z0-9_]*', Name.Variable),
+ (r'[\s]+', Text),],
+ 'core': [
+ # Operators
+ (r'(\*\*|\*|\+|-|\/|<|>|<=|>=|==|\/=|=)', Operator),
+ (r'/EOF', Generic.Emph),
+ (r'[(),:&;]', Punctuation),
+ ],
+ 'strings': [
+ (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
+ (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
+ (r'[$%]', String.Symbol),
+ ],
+ 'nums': [
+ (r'\d+(?![.ef])', Number.Integer),
+ (r'[+-]?\d*\.?\d+([ef][-+]?\d+)?', Number.Float),
+ (r'[+-]?\d+\.?\d*([ef][-+]?\d+)?', Number.Float),
+ ]
+ }
diff --git a/pygments/lexers/gcodelexer.py b/pygments/lexers/gcodelexer.py
new file mode 100644
index 00000000..c7ca2dcc
--- /dev/null
+++ b/pygments/lexers/gcodelexer.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+"""
+ pygments.lexers.gcodelexer.py
+ ~~~~~~~~~~~~~~~~~~~~~~
+ Lexers for gcode Language.
+ :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from pygments.lexer import RegexLexer, bygroups, words
+from pygments.token import *
+
+__all__ = ['gcodeLexer']
+
+class gcodeLexer(RegexLexer):
+ """
+ For gcode source code.
+
+ .. versionadded:: 2.80
+ """
+ name = 'g-code'
+ aliases = ['gcode']
+ filenames = ['*.gcode']
+
+ tokens = {
+ 'root': [
+ (r';.*\n', Comment),
+ (r'^[gmGM]\d{1,4}\s',Name.Builtin), # M or G commands
+ (r'([^gGmM])([+-]?\d*[.]?\d+)', bygroups(Keyword,Number)),
+ (r'\s', Text.Whitespace),
+ (r'.*\n', Text),
+ ]
+ }
+
diff --git a/tests/examplefiles/apdl/example1apdl.ans b/tests/examplefiles/apdl/example1apdl.ans
new file mode 100644
index 00000000..232dbd7a
--- /dev/null
+++ b/tests/examplefiles/apdl/example1apdl.ans
@@ -0,0 +1,53 @@
+finish
+/clear
+
+/title, Thermal Stress Example
+/prep7 ! Enter preprocessor
+*VOPER,test
+
+k,1,0,0 ! Keypoints
+k,2,1,0
+
+l,1,2 ! Line connecting keypoints
+
+et,1,link33 ! Element type
+r,1,4e-4, ! Area
+mp,kxx,1,60.5 ! Thermal conductivity
+
+esize,0.1 ! Element size
+lmesh,all ! Mesh line
+physics,write,thermal ! Write physics environment as thermal
+physics,clear ! Clear the environment
+
+
+etchg,tts ! Element type
+mp,ex,1,200e9 ! Young's modulus
+mp,prxy,1,0.3 ! Poisson's ratio
+mp,alpx,1,12e-6 ! Expansion coefficient
+physics,write,struct ! Write physics environment as struct
+physics,clear
+finish
+
+/solu ! Enter the solution phase
+antype,0 ! Static analysis
+physics,read,thermal ! Read in the thermal environment
+dk,1,temp,348 ! Apply a temp of 75 to keypoint 1
+
+solve
+finish
+
+/solu ! Re-enter the solution phase
+physics,read,struct ! Read in the struct environment
+
+ldread,temp,,,,,,rth ! Apply loads derived from thermal environment
+tref,273
+
+dk,1,all,0 ! Apply structural constraints
+dk,2,UX,0
+
+solve
+finish
+
+/post1 ! Enter postprocessor
+etable,CompStress,LS,1 ! Create an element table for link stress
+PRETAB,CompStress ! Print the element table
diff --git a/tests/examplefiles/apdl/example1apdl.ans.output b/tests/examplefiles/apdl/example1apdl.ans.output
new file mode 100644
index 00000000..2c3e9254
--- /dev/null
+++ b/tests/examplefiles/apdl/example1apdl.ans.output
@@ -0,0 +1,285 @@
+'finish' Keyword
+'\n' Text
+
+'/' Operator
+'clear' Name.Variable
+'\n\n' Text
+
+'/' Operator
+'title' Name.Variable
+',' Punctuation
+' ' Text
+'Thermal' Name.Variable
+' ' Text
+'Stress' Name.Variable
+' ' Text
+'Example' Name.Variable
+'\n' Text
+
+'/' Operator
+'prep7' Name.Variable
+'\t\t\t\t\t' Text
+'! Enter preprocessor\n' Comment
+
+'*' Operator
+'VOPER' Name.Variable
+',' Punctuation
+'test' Name.Variable
+'\n\n' Text
+
+'k' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'0' Literal.Number.Integer
+',' Punctuation
+'0' Literal.Number.Integer
+'\t\t\t\t\t' Text
+'! Keypoints\n' Comment
+
+'k' Keyword
+',' Punctuation
+'2' Literal.Number.Integer
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'0' Literal.Number.Integer
+'\n\n' Text
+
+'l' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'2' Literal.Number.Integer
+'\t\t\t\t\t' Text
+'! Line connecting keypoints\n' Comment
+
+'\n' Text
+
+'et' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'link33' Name.Variable
+'\t\t\t\t' Text
+'! Element type\n' Comment
+
+'r' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'4e-4' Literal.Number.Float
+',' Punctuation
+'\t\t\t\t' Text
+'! Area\n' Comment
+
+'mp' Keyword
+',' Punctuation
+'kxx' Name.Variable
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'6' Literal.Number.Integer
+'0.5' Literal.Number.Float
+'\t\t\t\t' Text
+'! Thermal conductivity\n' Comment
+
+'\n' Text
+
+'esize' Keyword
+',' Punctuation
+'0.1' Literal.Number.Float
+'\t\t\t\t' Text
+'! Element size\n' Comment
+
+'lmesh' Keyword
+',' Punctuation
+'all' Name.Variable
+'\t\t\t\t' Text
+'! Mesh line\n' Comment
+
+'physics' Keyword
+',' Punctuation
+'write' Keyword
+',' Punctuation
+'thermal' Name.Variable
+'\t\t\t' Text
+'! Write physics environment as thermal\n' Comment
+
+'physics' Keyword
+',' Punctuation
+'clear' Name.Variable
+'\t\t\t\t' Text
+'! Clear the environment\n' Comment
+
+'\n\n' Text
+
+'etchg' Keyword
+',' Punctuation
+'tts' Name.Variable
+'\t\t\t\t' Text
+'! Element type\t\t\t\t\n' Comment
+
+'mp' Keyword
+',' Punctuation
+'ex' Name.Variable
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'20' Literal.Number.Integer
+'0e9' Literal.Number.Float
+'\t\t\t\t' Text
+"! Young's modulus\n" Comment
+
+'mp' Keyword
+',' Punctuation
+'prxy' Name.Variable
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'0.3' Literal.Number.Float
+'\t\t\t\t' Text
+"! Poisson's ratio\n" Comment
+
+'mp' Keyword
+',' Punctuation
+'alpx' Name.Variable
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'1' Literal.Number.Integer
+'2e-6' Literal.Number.Float
+'\t\t\t\t' Text
+'! Expansion coefficient\n' Comment
+
+'physics' Keyword
+',' Punctuation
+'write' Keyword
+',' Punctuation
+'struct' Name.Variable
+'\t\t\t' Text
+'! Write physics environment as struct\n' Comment
+
+'physics' Keyword
+',' Punctuation
+'clear' Name.Variable
+'\n' Text
+
+'finish' Keyword
+'\n\n' Text
+
+'/' Operator
+'solu' Keyword
+'\t\t\t\t\t' Text
+'! Enter the solution phase\n' Comment
+
+'antype' Keyword
+',' Punctuation
+'0' Literal.Number.Integer
+'\t\t\t\t' Text
+'! Static analysis\n' Comment
+
+'physics' Keyword
+',' Punctuation
+'read' Keyword
+',' Punctuation
+'thermal' Name.Variable
+'\t\t\t' Text
+'! Read in the thermal environment\n' Comment
+
+'dk' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'temp' Name.Variable
+',' Punctuation
+'348' Literal.Number.Integer
+'\t\t\t\t' Text
+'! Apply a temp of 75 to keypoint 1\n' Comment
+
+'\n' Text
+
+'solve' Keyword
+'\n' Text
+
+'finish' Keyword
+'\n\n' Text
+
+'/' Operator
+'solu' Keyword
+'\t\t\t\t\t' Text
+'! Re-enter the solution phase\n' Comment
+
+'physics' Keyword
+',' Punctuation
+'read' Keyword
+',' Punctuation
+'struct' Name.Variable
+'\t\t\t' Text
+'! Read in the struct environment\n' Comment
+
+'\n' Text
+
+'ldread' Keyword
+',' Punctuation
+'temp' Name.Variable
+',' Punctuation
+',' Punctuation
+',' Punctuation
+',' Punctuation
+',' Punctuation
+',' Punctuation
+'rth' Name.Variable
+'\t\t\t' Text
+'! Apply loads derived from thermal environment\n' Comment
+
+'tref' Keyword
+',' Punctuation
+'273' Literal.Number.Integer
+'\n\n' Text
+
+'dk' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'all' Name.Variable
+',' Punctuation
+'0' Literal.Number.Integer
+'\t\t\t\t' Text
+'! Apply structural constraints\n' Comment
+
+'dk' Keyword
+',' Punctuation
+'2' Literal.Number.Integer
+',' Punctuation
+'UX' Name.Variable
+',' Punctuation
+'0' Literal.Number.Integer
+'\n\n' Text
+
+'solve' Keyword
+'\n' Text
+
+'finish' Keyword
+'\n\n' Text
+
+'/' Operator
+'post1' Name.Variable
+'\t\t\t\t\t' Text
+'! Enter postprocessor\n' Comment
+
+'etable' Keyword
+',' Punctuation
+'CompStress' Name.Variable
+',' Punctuation
+'LS' Name.Variable
+',' Punctuation
+'1' Literal.Number.Integer
+'\t\t\t' Text
+'! Create an element table for link stress\n' Comment
+
+'PRETAB' Keyword
+',' Punctuation
+'CompStress' Name.Variable
+'\t\t\t' Text
+'! Print the element table\n' Comment
diff --git a/tests/examplefiles/apdl/example2apdl.ans b/tests/examplefiles/apdl/example2apdl.ans
new file mode 100644
index 00000000..238b62e7
--- /dev/null
+++ b/tests/examplefiles/apdl/example2apdl.ans
@@ -0,0 +1,69 @@
+! ANSYS command file to perform 2D Truss Tutorial (Chandrupatla p.123)
+!
+/title, Bridge Truss Tutorial
+/PREP7 ! preprocessor phase
+!
+! define parameters (mm)
+height = 3118
+width = 3600
+!
+! define keypoints
+!
+K,1, 0, 0 ! keypoint, #, x, y
+K,2, width/2,height
+K,3, width, 0
+K,4, 3*width/2, height
+K,5, 2*width, 0
+K,6, 5*width/2, height
+K,7, 3*width, 0
+!
+! define lines
+!
+L,1,2 ! line connecting kpoint 1 and 2
+L,1,3
+L,2,3
+L,2,4
+L,3,4
+L,3,5
+L,4,5
+L,4,6
+L,5,6
+L,5,7
+L,6,7
+
+!
+! element definition
+!
+ET,1,LINK1 ! element type #1; spring element
+R,1,3250 ! real constant #1; Xsect area: 3200 mm^2
+MP,EX,1,200e3 ! material property #1; Young's modulus: 200 GPa
+
+LESIZE,ALL, , ,1,1,1 ! specify divisions on unmeshed lines
+LMESH,all ! mesh all lines
+!
+FINISH ! finish pre-processor
+!
+/SOLU ! enter solution phase
+!
+! apply some constraints
+DK,1,ALL,0 ! define a DOF constraint at a keypoint
+DK,7,UY,0
+!
+! apply loads
+!
+FK,1,FY,-280e3 ! define a force load to a keypoint
+FK,3,FY,-210e3
+FK,5,FY,-280e3
+FK,7,FY,-360e3
+!
+SOLVE ! solve the resulting system of equations
+FINISH ! finish solution
+
+/POST1
+PRRSOL,F ! List Reaction Forces
+PLDISP,2 ! Plot Deformed shape
+PLNSOL,U,SUM,0,1 ! Contour Plot of deflection
+
+ETABLE,SAXL,LS, 1 ! Axial Stress
+PRETAB,SAXL ! List Element Table
+PLETAB,SAXL,NOAV ! Plot Axial Stress
diff --git a/tests/examplefiles/apdl/example2apdl.ans.output b/tests/examplefiles/apdl/example2apdl.ans.output
new file mode 100644
index 00000000..cefd4af2
--- /dev/null
+++ b/tests/examplefiles/apdl/example2apdl.ans.output
@@ -0,0 +1,429 @@
+'! ANSYS command file to perform 2D Truss Tutorial (Chandrupatla p.123)\n' Comment
+
+'!\n' Comment
+
+'/' Operator
+'title' Name.Variable
+',' Punctuation
+' ' Text
+'Bridge' Name.Variable
+' ' Text
+'Truss' Name.Variable
+' ' Text
+'Tutorial' Name.Variable
+'\n' Text
+
+'/' Operator
+'PREP7' Name.Variable
+' ' Text
+'! preprocessor phase\n' Comment
+
+'!\n' Comment
+
+'! define parameters (mm)\n' Comment
+
+'height' Name.Variable
+' ' Text
+'=' Operator
+' ' Text
+'3118' Literal.Number.Integer
+'\n' Text
+
+'width' Name.Variable
+' ' Text
+'=' Operator
+' ' Text
+'3600' Literal.Number.Integer
+'\n' Text
+
+'!\n' Comment
+
+'! define keypoints \n' Comment
+
+'!\n' Comment
+
+'K' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'0' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'0' Literal.Number.Integer
+' ' Text
+'! keypoint, #, x, y\n' Comment
+
+'K' Keyword
+',' Punctuation
+'2' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'width' Name.Variable
+'/' Operator
+'2' Literal.Number.Integer
+',' Punctuation
+'height' Name.Variable
+' \n' Text
+
+'K' Keyword
+',' Punctuation
+'3' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'width' Name.Variable
+',' Punctuation
+' ' Text
+'0' Literal.Number.Integer
+'\n' Text
+
+'K' Keyword
+',' Punctuation
+'4' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'3' Literal.Number.Integer
+'*' Operator
+'width' Name.Variable
+'/' Operator
+'2' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'height' Name.Variable
+'\n' Text
+
+'K' Keyword
+',' Punctuation
+'5' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'2' Literal.Number.Integer
+'*' Operator
+'width' Name.Variable
+',' Punctuation
+' ' Text
+'0' Literal.Number.Integer
+' \n' Text
+
+'K' Keyword
+',' Punctuation
+'6' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'5' Literal.Number.Integer
+'*' Operator
+'width' Name.Variable
+'/' Operator
+'2' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'height' Name.Variable
+'\n' Text
+
+'K' Keyword
+',' Punctuation
+'7' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'3' Literal.Number.Integer
+'*' Operator
+'width' Name.Variable
+',' Punctuation
+' ' Text
+'0' Literal.Number.Integer
+'\n' Text
+
+'!\n' Comment
+
+'! define lines\n' Comment
+
+'!\n' Comment
+
+'L' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'2' Literal.Number.Integer
+' ' Text
+'! line connecting kpoint 1 and 2\n' Comment
+
+'L' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'3' Literal.Number.Integer
+'\n' Text
+
+'L' Keyword
+',' Punctuation
+'2' Literal.Number.Integer
+',' Punctuation
+'3' Literal.Number.Integer
+'\n' Text
+
+'L' Keyword
+',' Punctuation
+'2' Literal.Number.Integer
+',' Punctuation
+'4' Literal.Number.Integer
+'\n' Text
+
+'L' Keyword
+',' Punctuation
+'3' Literal.Number.Integer
+',' Punctuation
+'4' Literal.Number.Integer
+'\n' Text
+
+'L' Keyword
+',' Punctuation
+'3' Literal.Number.Integer
+',' Punctuation
+'5' Literal.Number.Integer
+'\n' Text
+
+'L' Keyword
+',' Punctuation
+'4' Literal.Number.Integer
+',' Punctuation
+'5' Literal.Number.Integer
+'\n' Text
+
+'L' Keyword
+',' Punctuation
+'4' Literal.Number.Integer
+',' Punctuation
+'6' Literal.Number.Integer
+'\n' Text
+
+'L' Keyword
+',' Punctuation
+'5' Literal.Number.Integer
+',' Punctuation
+'6' Literal.Number.Integer
+'\n' Text
+
+'L' Keyword
+',' Punctuation
+'5' Literal.Number.Integer
+',' Punctuation
+'7' Literal.Number.Integer
+'\n' Text
+
+'L' Keyword
+',' Punctuation
+'6' Literal.Number.Integer
+',' Punctuation
+'7' Literal.Number.Integer
+'\n \n' Text
+
+'!\n' Comment
+
+'! element definition\n' Comment
+
+'!\n' Comment
+
+'ET' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'LINK1' Keyword
+' ' Text
+'! element type #1; spring element\n' Comment
+
+'R' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'3250' Literal.Number.Integer
+' ' Text
+'! real constant #1; Xsect area: 3200 mm^2\n' Comment
+
+'MP' Keyword
+',' Punctuation
+'EX' Name.Variable
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'20' Literal.Number.Integer
+'0e3' Literal.Number.Float
+' ' Text
+"! material property #1; Young's modulus: 200 GPa\n" Comment
+
+'\n' Text
+
+'LESIZE' Keyword
+',' Punctuation
+'ALL' Name.Variable
+',' Punctuation
+' ' Text
+',' Punctuation
+' ' Text
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'1' Literal.Number.Integer
+' ' Text
+'! specify divisions on unmeshed lines\n' Comment
+
+'LMESH' Keyword
+',' Punctuation
+'all' Name.Variable
+' ' Text
+'! mesh all lines\n' Comment
+
+'!\n' Comment
+
+'FINISH' Keyword
+' ' Text
+'! finish pre-processor\n' Comment
+
+'!\n' Comment
+
+'/' Operator
+'SOLU' Keyword
+' ' Text
+'! enter solution phase\n' Comment
+
+'!\n' Comment
+
+'! apply some constraints\n' Comment
+
+'DK' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'ALL' Name.Variable
+',' Punctuation
+'0' Literal.Number.Integer
+' ' Text
+'! define a DOF constraint at a keypoint\n' Comment
+
+'DK' Keyword
+',' Punctuation
+'7' Literal.Number.Integer
+',' Punctuation
+'UY' Name.Variable
+',' Punctuation
+'0' Literal.Number.Integer
+' \n' Text
+
+'!\n' Comment
+
+'! apply loads\n' Comment
+
+'!\n' Comment
+
+'FK' Keyword
+',' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+'FY' Name.Variable
+',' Punctuation
+'-' Operator
+'28' Literal.Number.Integer
+'0e3' Literal.Number.Float
+' ' Text
+'! define a force load to a keypoint\n' Comment
+
+'FK' Keyword
+',' Punctuation
+'3' Literal.Number.Integer
+',' Punctuation
+'FY' Name.Variable
+',' Punctuation
+'-' Operator
+'21' Literal.Number.Integer
+'0e3' Literal.Number.Float
+' \n' Text
+
+'FK' Keyword
+',' Punctuation
+'5' Literal.Number.Integer
+',' Punctuation
+'FY' Name.Variable
+',' Punctuation
+'-' Operator
+'28' Literal.Number.Integer
+'0e3' Literal.Number.Float
+' \n' Text
+
+'FK' Keyword
+',' Punctuation
+'7' Literal.Number.Integer
+',' Punctuation
+'FY' Name.Variable
+',' Punctuation
+'-' Operator
+'36' Literal.Number.Integer
+'0e3' Literal.Number.Float
+' \n' Text
+
+'!\n' Comment
+
+'SOLVE' Keyword
+' ' Text
+'! solve the resulting system of equations\n' Comment
+
+'FINISH' Keyword
+' ' Text
+'! finish solution\n' Comment
+
+'\n' Text
+
+'/' Operator
+'POST1' Name.Variable
+'\n' Text
+
+'PRRSOL' Keyword
+',' Punctuation
+'F' Keyword
+' ' Text
+'! List Reaction Forces\n' Comment
+
+'PLDISP' Keyword
+',' Punctuation
+'2' Literal.Number.Integer
+' ' Text
+'! Plot Deformed shape\n' Comment
+
+'PLNSOL' Keyword
+',' Punctuation
+'U' Name.Variable
+',' Punctuation
+'SUM' Name.Variable
+',' Punctuation
+'0' Literal.Number.Integer
+',' Punctuation
+'1' Literal.Number.Integer
+' ' Text
+'! Contour Plot of deflection\n' Comment
+
+'\n' Text
+
+'ETABLE' Keyword
+',' Punctuation
+'SAXL' Name.Variable
+',' Punctuation
+'LS' Name.Variable
+',' Punctuation
+' ' Text
+'1' Literal.Number.Integer
+' ' Text
+'! Axial Stress\n' Comment
+
+'PRETAB' Keyword
+',' Punctuation
+'SAXL' Name.Variable
+' ' Text
+'! List Element Table\n' Comment
+
+'PLETAB' Keyword
+',' Punctuation
+'SAXL' Name.Variable
+',' Punctuation
+'NOAV' Name.Variable
+' ' Text
+'! Plot Axial Stress\n' Comment
diff --git a/tests/examplefiles/gcode/SupportLogo.gcode b/tests/examplefiles/gcode/SupportLogo.gcode
new file mode 100644
index 00000000..6d27cda3
--- /dev/null
+++ b/tests/examplefiles/gcode/SupportLogo.gcode
@@ -0,0 +1,67 @@
+%
+O0000
+ N10 (MACH3 MILL - )
+N20 (AUTHOR - {SCOTT SHAFER}) G0 ( second comment )
+N30 (GROUP - TOOLPATH GROUP #1)
+N40 (SYSTEM- ONECNC-XR2 MILL ADVANTAGE - VERSION 8.12)
+N50 (NOTES - NONE)
+N60 G0 G40 G49 G50 G80 G94
+N70 (.1875 INCH 3/16 HSS END MILL ) ( )
+N80 T4 M06 G43 H4
+N90 S3411.0 F25.0 M3 M07
+N100 G4 P3
+N110 G00 X14.9375 Y1.4106 Z0.1
+N120 Z0.05
+N130 G01 X14.9358 Y1.3786 Z0.0466 F25.0
+N140 X14.9376 Y1.3149 Z0.0399
+N150 X14.9445 Y1.2515 Z0.0332
+N220 X15.2348 Y0.8636 Z-0.0205
+N230 X15.309 Y0.8443 Z-0.0285
+N240 X15.3096
+N250 X15.3101
+N260 X15.3106
+N270 X15.3111
+N280 X15.3116
+N290 X15.3121 Y0.8437
+N300 X15.3812 Y0.8329 Z-0.0362
+N310 X15.4511 Y0.8279 Z-0.0436
+N320 X15.521 Y0.8289 Z-0.0509
+N330 X15.5907 Y0.8357 Z-0.0583
+N340 X15.6595 Y0.8485 Z-0.0656
+N350 X15.727 Y0.867 Z-0.073
+N360 X15.7772 Y0.8886 Z-0.0787
+N450 X16.0252 Y1.2813 Z-0.1299
+N460 X16.0288 Y1.3346 Z-0.1356
+N470 X16.0285 Y1.3881 Z-0.1412
+N480 Y1.3892 Z-0.1413
+N490 Y1.3904 Z-0.1414
+N500 Y1.3916 Z-0.1415
+N510 Y1.3927 Z-0.1417
+N520 Y1.3939 Z-0.1418
+N530 Y1.3951 Z-0.1419
+N540 Y1.4324 Z-0.1458
+N550 X16.0257 Y1.4697 Z-0.1498
+N600 X15.9644 Y1.6626 Z-0.1712
+N610 X15.9323 Y1.707 Z-0.177
+N620 X15.8944 Y1.7466 Z-0.1827
+N630 X15.8515 Y1.7806 Z-0.1885
+N640 X15.8044 Y1.8086 Z-0.1942
+N650 X15.7539 Y1.8298 Z-0.2
+N660 X15.7528 Y1.8321
+N670 X15.7032 Y1.6737
+N680 G02 X15.774 Y1.6404 I-0.2085 J-0.5347
+N690 X15.8954 Y1.5145 I-0.1426 J-0.259
+N700 X15.8975 Y1.51 I-0.082 J-0.0413
+N92490 G03 X0.964 Y1.615 I0.1291 J-0.3825
+N92500 X0.9254 Y1.4125 I0.5116 J-0.2025
+N92510 X0.9257 Y1.395 I0.5503 J0.
+N92520 G02 X0.9257 Y1.3921 I-0.0918 J-0.0029
+N92530 X0.9256 Y1.3881 I-0.0918 J0.
+N92540 G03 X0.925 Y1.357 I0.7199 J-0.0312
+N92550 X0.9827 Y1.0743 I0.7206 J0.
+N92560 G00 Z0.1
+N92570 M05 M09
+N92580 (END TOOL)
+N92590 M05 M09
+N92600 M30
+%
diff --git a/tests/examplefiles/gcode/SupportLogo.gcode.output b/tests/examplefiles/gcode/SupportLogo.gcode.output
new file mode 100644
index 00000000..fee1a84a
--- /dev/null
+++ b/tests/examplefiles/gcode/SupportLogo.gcode.output
@@ -0,0 +1,639 @@
+'%\n' Text
+
+'O' Keyword
+'0000' Literal.Number
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+' ' Text.Whitespace
+' ' Text.Whitespace
+' ' Text.Whitespace
+'N' Keyword
+'10' Literal.Number
+' ' Text.Whitespace
+'(MACH3 MILL - )\n' Text
+
+'N' Keyword
+'20' Literal.Number
+' ' Text.Whitespace
+'(AUTHOR - {SCOTT SHAFER}) G0 ( second comment )\n' Text
+
+'N' Keyword
+'30' Literal.Number
+' ' Text.Whitespace
+'(GROUP - TOOLPATH GROUP #1)\n' Text
+
+'N' Keyword
+'40' Literal.Number
+' ' Text.Whitespace
+'(SYSTEM- ONECNC-XR2 MILL ADVANTAGE - VERSION 8.12)\n' Text
+
+'N' Keyword
+'50' Literal.Number
+' ' Text.Whitespace
+'(NOTES - NONE)\n' Text
+
+'N' Keyword
+'60' Literal.Number
+' ' Text.Whitespace
+'G0 G40 G49 G50 G80 G94\n' Text
+
+'N' Keyword
+'70' Literal.Number
+' ' Text.Whitespace
+'(' Keyword
+'.1875' Literal.Number
+' ' Text.Whitespace
+'INCH 3/16 HSS END MILL ) ( )\n' Text
+
+'N' Keyword
+'80' Literal.Number
+' ' Text.Whitespace
+'T' Keyword
+'4' Literal.Number
+' ' Text.Whitespace
+'M06 G43 H4\n' Text
+
+'N' Keyword
+'90' Literal.Number
+' ' Text.Whitespace
+'S' Keyword
+'3411.0' Literal.Number
+' ' Text.Whitespace
+'F' Keyword
+'25.0' Literal.Number
+' ' Text.Whitespace
+'M3 M07\n' Text
+
+'N' Keyword
+'100' Literal.Number
+' ' Text.Whitespace
+'G4 P3\n' Text
+
+'N' Keyword
+'110' Literal.Number
+' ' Text.Whitespace
+'G00 X14.9375 Y1.4106 Z0.1\n' Text
+
+'N' Keyword
+'120' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.05' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'130' Literal.Number
+' ' Text.Whitespace
+'G01 X14.9358 Y1.3786 Z0.0466 F25.0\n' Text
+
+'N' Keyword
+'140' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'14.9376' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.3149' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.0399' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'150' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'14.9445' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.2515' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.0332' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'220' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.2348' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.8636' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.0205' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'230' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.309' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.8443' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.0285' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'240' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.3096' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'250' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.3101' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'260' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.3106' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'270' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.3111' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'280' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.3116' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'290' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.3121' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.8437' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'300' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.3812' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.8329' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.0362' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'310' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.4511' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.8279' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.0436' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'320' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.521' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.8289' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.0509' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'330' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.5907' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.8357' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.0583' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'340' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.6595' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.8485' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.0656' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'350' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.727' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.867' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.073' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'360' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.7772' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.8886' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.0787' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'450' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'16.0252' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.2813' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1299' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'460' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'16.0288' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.3346' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1356' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'470' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'16.0285' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.3881' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1412' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'480' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.3892' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1413' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'490' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.3904' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1414' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'500' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.3916' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1415' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'510' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.3927' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1417' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'520' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.3939' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1418' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'530' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.3951' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1419' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'540' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.4324' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1458' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'550' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'16.0257' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.4697' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1498' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'600' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.9644' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.6626' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1712' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'610' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.9323' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.707' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.177' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'620' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.8944' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.7466' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1827' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'630' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.8515' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.7806' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1885' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'640' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.8044' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.8086' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.1942' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'650' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.7539' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.8298' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.2' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'660' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.7528' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.8321' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'670' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.7032' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.6737' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'680' Literal.Number
+' ' Text.Whitespace
+'G02 X15.774 Y1.6404 I-0.2085 J-0.5347\n' Text
+
+'N' Keyword
+'690' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.8954' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.5145' Literal.Number
+' ' Text.Whitespace
+'I' Keyword
+'-0.1426' Literal.Number
+' ' Text.Whitespace
+'J' Keyword
+'-0.259' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'700' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'15.8975' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.51' Literal.Number
+' ' Text.Whitespace
+'I' Keyword
+'-0.082' Literal.Number
+' ' Text.Whitespace
+'J' Keyword
+'-0.0413' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'92490' Literal.Number
+' ' Text.Whitespace
+'G03 X0.964 Y1.615 I0.1291 J-0.3825\n' Text
+
+'N' Keyword
+'92500' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'0.9254' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.4125' Literal.Number
+' ' Text.Whitespace
+'I' Keyword
+'0.5116' Literal.Number
+' ' Text.Whitespace
+'J' Keyword
+'-0.2025' Literal.Number
+'\n' Text.Whitespace
+
+'N' Keyword
+'92510' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'0.9257' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.395' Literal.Number
+' ' Text.Whitespace
+'I' Keyword
+'0.5503' Literal.Number
+' ' Text.Whitespace
+'J' Keyword
+'0' Literal.Number
+'.\n' Text
+
+'N' Keyword
+'92520' Literal.Number
+' ' Text.Whitespace
+'G02 X0.9257 Y1.3921 I-0.0918 J-0.0029\n' Text
+
+'N' Keyword
+'92530' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'0.9256' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.3881' Literal.Number
+' ' Text.Whitespace
+'I' Keyword
+'-0.0918' Literal.Number
+' ' Text.Whitespace
+'J' Keyword
+'0' Literal.Number
+'.\n' Text
+
+'N' Keyword
+'92540' Literal.Number
+' ' Text.Whitespace
+'G03 X0.925 Y1.357 I0.7199 J-0.0312\n' Text
+
+'N' Keyword
+'92550' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'0.9827' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.0743' Literal.Number
+' ' Text.Whitespace
+'I' Keyword
+'0.7206' Literal.Number
+' ' Text.Whitespace
+'J' Keyword
+'0' Literal.Number
+'.\n' Text
+
+'N' Keyword
+'92560' Literal.Number
+' ' Text.Whitespace
+'G00 Z0.1\n' Text
+
+'N' Keyword
+'92570' Literal.Number
+' ' Text.Whitespace
+'M05 M09\n' Text
+
+'N' Keyword
+'92580' Literal.Number
+' ' Text.Whitespace
+'(END TOOL)\n' Text
+
+'N' Keyword
+'92590' Literal.Number
+' ' Text.Whitespace
+'M05 M09\n' Text
+
+'N' Keyword
+'92600' Literal.Number
+' ' Text.Whitespace
+'M30\n' Text
+
+'%\n' Text
diff --git a/tests/examplefiles/gcode/boomerangv4.gcode b/tests/examplefiles/gcode/boomerangv4.gcode
new file mode 100644
index 00000000..91d44da4
--- /dev/null
+++ b/tests/examplefiles/gcode/boomerangv4.gcode
@@ -0,0 +1,52 @@
+( Made using CamBam - http://www.cambam.co.uk )
+( boomerangv3 1/14/2010 9:29:11 PM )
+( T0 : 0.25 )
+G20 G90 G64 G40
+G0 Z1.0
+( T0 : 0.25 )
+T0 M6
+( Profile1 )
+G17
+M3 S0
+G0 X11.4158 Y0.5132
+G1 F30.0 Z0.0
+G3 F300.0 X12.9975 Y1.714 I0.4346 J1.0696
+G0 Z1.0
+G0 X0.4562 Y1.7439
+G1 F30.0 Z0.0
+G3 F300.0 X2.018 Y0.538 I1.0998 J-0.1898
+( 3DSurface1 )
+S0
+G0 Z1.0
+G0 X0.1101 Y1.2205
+G1 F30.0 Z-0.0025
+G1 F300.0 Y1.4452
+G1 F30.0 X0.1851 Y1.5275
+G1 F300.0 Y1.504
+G1 Y1.479 Z0.001
+G1 Y1.404 Z0.0333
+G1 Y1.204
+G1 Y1.179 Z-0.0025
+G1 Y1.1581
+G1 F30.0 X0.2601 Y1.0964
+G1 F300.0 Y1.104
+G1 Y1.129 Z0.0973
+G1 Y1.329
+G1 Y1.379 Z0.0791
+G1 Y1.404 Z0.0688
+G1 Y1.554 Z0.0041
+G1 Y1.579 Z-0.0025
+G1 Y1.6098
+G1 F30.0 X0.3351 Y1.6921
+G1 F300.0 Y1.654
+G1 Y1.629 Z0.0072
+G1 Y1.479 Z0.0719
+G1 Y1.454 Z0.0817
+G1 Y1.304 Z0.1363
+G1 Y1.279 Z0.1451
+G1 Y1.079
+G1 Y1.054 Z-0.0025
+G1 Y1.0352
+G1 F30.0 X0.4101 Y0.9747
+M5
+M30
diff --git a/tests/examplefiles/gcode/boomerangv4.gcode.output b/tests/examplefiles/gcode/boomerangv4.gcode.output
new file mode 100644
index 00000000..cb337efe
--- /dev/null
+++ b/tests/examplefiles/gcode/boomerangv4.gcode.output
@@ -0,0 +1,349 @@
+'( Made using CamBam - http://www.cambam.co.uk )\n' Text
+
+'( boomerangv3 1/14/2010 9:29:11 PM )\n' Text
+
+'( T0 : 0.25 )\n' Text
+
+'G20 ' Name.Builtin
+'G90 G64 G40\n' Text
+
+'G0 ' Name.Builtin
+'Z' Keyword
+'1.0' Literal.Number
+'\n' Text.Whitespace
+
+'( T0 : 0.25 )\n' Text
+
+'T' Keyword
+'0' Literal.Number
+' ' Text.Whitespace
+'M6\n' Text
+
+'( Profile1 )\n' Text
+
+'G17\n' Name.Builtin
+
+'M3 ' Name.Builtin
+'S' Keyword
+'0' Literal.Number
+'\n' Text.Whitespace
+
+'G0 ' Name.Builtin
+'X' Keyword
+'11.4158' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.5132' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'F' Keyword
+'30.0' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.0' Literal.Number
+'\n' Text.Whitespace
+
+'G3 ' Name.Builtin
+'F' Keyword
+'300.0' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'12.9975' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.714' Literal.Number
+' ' Text.Whitespace
+'I' Keyword
+'0.4346' Literal.Number
+' ' Text.Whitespace
+'J' Keyword
+'1.0696' Literal.Number
+'\n' Text.Whitespace
+
+'G0 ' Name.Builtin
+'Z' Keyword
+'1.0' Literal.Number
+'\n' Text.Whitespace
+
+'G0 ' Name.Builtin
+'X' Keyword
+'0.4562' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.7439' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'F' Keyword
+'30.0' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.0' Literal.Number
+'\n' Text.Whitespace
+
+'G3 ' Name.Builtin
+'F' Keyword
+'300.0' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'2.018' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.538' Literal.Number
+' ' Text.Whitespace
+'I' Keyword
+'1.0998' Literal.Number
+' ' Text.Whitespace
+'J' Keyword
+'-0.1898' Literal.Number
+'\n' Text.Whitespace
+
+'( 3DSurface1 )\n' Text
+
+'S' Keyword
+'0' Literal.Number
+'\n' Text.Whitespace
+
+'G0 ' Name.Builtin
+'Z' Keyword
+'1.0' Literal.Number
+'\n' Text.Whitespace
+
+'G0 ' Name.Builtin
+'X' Keyword
+'0.1101' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.2205' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'F' Keyword
+'30.0' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.0025' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'F' Keyword
+'300.0' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.4452' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'F' Keyword
+'30.0' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'0.1851' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.5275' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'F' Keyword
+'300.0' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.504' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.479' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.001' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.404' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.0333' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.204' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.179' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.0025' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.1581' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'F' Keyword
+'30.0' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'0.2601' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.0964' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'F' Keyword
+'300.0' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.104' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.129' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.0973' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.329' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.379' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.0791' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.404' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.0688' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.554' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.0041' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.579' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.0025' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.6098' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'F' Keyword
+'30.0' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'0.3351' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.6921' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'F' Keyword
+'300.0' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'1.654' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.629' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.0072' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.479' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.0719' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.454' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.0817' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.304' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.1363' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.279' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'0.1451' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.079' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.054' Literal.Number
+' ' Text.Whitespace
+'Z' Keyword
+'-0.0025' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'Y' Keyword
+'1.0352' Literal.Number
+'\n' Text.Whitespace
+
+'G1 ' Name.Builtin
+'F' Keyword
+'30.0' Literal.Number
+' ' Text.Whitespace
+'X' Keyword
+'0.4101' Literal.Number
+' ' Text.Whitespace
+'Y' Keyword
+'0.9747' Literal.Number
+'\n' Text.Whitespace
+
+'M5\n' Name.Builtin
+
+'M30\n' Name.Builtin