Skip to content

Instantly share code, notes, and snippets.

@sivabudh
Created January 21, 2016 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sivabudh/286b5110e646e9387b11 to your computer and use it in GitHub Desktop.
Save sivabudh/286b5110e646e9387b11 to your computer and use it in GitHub Desktop.
# Input:
data = '''
undo traffic-policy inbound # regular statement
<% # command
module: create-variable
name: 'display blah'
%>
quit # regular statement
'''
# Output
output = [ # an array of...
'undo traffic-policy inbound', # first element is a plain string
{ # second element is a dictionary of attributes
'module': 'create-variable'
'name': 'display blah'
},
'quit', # third element is a plain string
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment